Closed frdev closed 5 years ago
Here you have a mostly complete example:
$contact = new Contact($people); $contact->names[0] = new stdClass; $contact->names[0]->givenName = 'Test Name'; $contact->names[0]->familyName = 'Family Name'; $contact->emailAddresses[0] = new stdClass; $contact->emailAddresses[0]->value = 'your_email@yourcompany.com'; $contact->phoneNumbers[0] = new stdClass; $contact->phoneNumbers[0]->value = '666888999'; $contact->organizations[0] = new stdClass; $contact->organizations[0]->name = 'Your Company'; $contact->addresses[0] = new stdClass; $contact->addresses[0]->streetAddress = 'Your Street'; $contact->addresses[0]->city = 'Your City'; $contact->addresses[0]->region = 'Region'; $contact->addresses[0]->postalCode = '11111'; $contact->addresses[0]->country = 'IN'; $contact->save();
Hello,
$contact->save() returns 1 when successful. Is there any way to get the resourceName? eg "people/c4722530053606681048".
We need this in order to keep updating the contact in the future.
Thank you in advance
I found the solution. On apidwebltd\php-google-people-api\src\Contact.php I changed line 22 from "return true" to "return $this->resourceName;".
I found the solution. On apidwebltd\php-google-people-api\src\Contact.php I changed line 22 from "return true" to "return $this->resourceName;".
You can also do this withou editing the source code:
After saving the Contact with $contact->save(); You can get the output.
$contact->save();
$resourceName = $contact->resourceName;
echo $resourceName;
Please, help me!