My goal is to register, on a Google Account, all phone numbers that I save on my php based CRM. I've checked on Google APIs documentation but I've not understood which API I have to use. I can use PHP or JS to develop this function. The only information I found is in these two pages :
- https://developers.google.com/people/api/rest/v1/people/createContact?hl=i
- https://developers.google.com/people/quickstart/js?hl=it
The first is a REST call and this is good ... but I'm not understanding how to create this call. The second has a possibility to create contact just with CardDAV.
Can someone help me on this or is there somewhere a guide step by step about how to create a Google Contact using PHP or JS?
Google Workspace People API can be used to create a contact which will be displayed at contacts.google.com, you can follow these steps to set up Google Cloud Project and perform the API call in PHP:
1. Create a Google Cloud Project and enable the People API:
2. Create a Consent screen:
3. Download a credentials.json file.
credentials.json.4. Set up the project.
composer require google/apiclient:^2.12.15. The code:
References: