Xero - beautiful accounting software

Xero Developer Help Center

Xero Developer Community

Community > Wrapper libraries >

PHP Adding contact to group does not work

Started by Andre Truter -   in Wrapper libraries

I have been trying to add a newly created contact to a contact group, but I cannot get it to work.

I first tried to set the groups when I create the contact with : $contact->setContactGroups($groups).

The contact is created but it is not added to the group.

Then I tried to add the contact to the group afterwards with AccountingApi::createContactGroupContacts(), but that also does not work.
No errors, but no change also.

This is my code at the moment:
This code is provided by the developer community - Xero does not warrant it in any way

The result ($group_upd_res) is an empty set even though the contact create result ($xeroContactResult) is correct and the contact is created.

Any idea why this is not working?