We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Hello,
I'm trying to add a photo to a new contact. That's my try:
function createContact(string $givenName, string $familyName, string $nickName) { $contact = new Contact($this->people); $contact->names[0] = new stdClass; $contact->names[0]->givenName = $givenName; $contact->names[0]->familyName = $familyName; $contact->nicknames[0] = new stdClass; $contact->nicknames[0]->value = $nickName; $contact->phoneNumbers[0] = new stdClass; $contact->phoneNumbers[0]->value = '0123456789'; $contact->photos[0] = new stdClass; $contact->photos[0]->url = 'my private url'; $contact->photos[0]->default = true; // I tried also false // no error, no photo $contact->save(); }
I have a new contact in Google Contacts but I can't see a photo. What I have to do? I'm looking forward for your advice. Thanks.
Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.
The text was updated successfully, but these errors were encountered:
I created this code, based in the function "save", from the class "GooglePeople".
public function savePhoto($resourceName,$photoBytes) { $requestObj = new \stdClass();
public function savePhoto($resourceName,$photoBytes) {
$requestObj = new \stdClass();
//If resource name exists, update the contact. $method = 'PATCH'; $url = self::PEOPLE_BASE_URL.$resourceName.':updateContactPhoto'; $requestObj = ['photoBytes'=>$photoBytes]; $requestBody = json_encode($requestObj); $response = $this->googleOAuth2Handler->performRequest($method, $url, $requestBody); $body = (string) $response->getBody(); if ($response->getStatusCode()!=200) { throw new Exception($body); } $responseObj = json_decode($body); return $responseObj; #return $this->convertResponseConnectionToContact($responseObj); }`
Sorry, something went wrong.
No branches or pull requests
Hello,
I'm trying to add a photo to a new contact. That's my try:
I have a new contact in Google Contacts but I can't see a photo. What I have to do? I'm looking forward for your advice. Thanks.
Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.
The text was updated successfully, but these errors were encountered: