Reputation: 11
In one of my application I have requirement where I want user's google contact update should be instantly sent from his google account to my application for which webhook would be better solution. So want to know where I can get documentation for using webhook with google contacts API. I was able to find it for user
and activity
resources but not for contacts
.
Any help would be appreciated. Thanks.
Upvotes: 0
Views: 1444
Reputation: 13469
As @Blake O'Hare stated, the Google Contacts API documentation doesn't mention anything about a web hook like the Google Calendar API has.
This thread provided a workaround which might help you.
I think that what you might have to do is the following:
- Set up a database to store your contact's info.
- Create a PHP script which will query Google Contacts for the contact's updated info:
a. Use PHP's curl function to connect to Google Contacts API query link.
b. Set the script to send the credentials requested by Google Contacts API.
c. Compare the contact's information read from the Google Contacts API against the information on that contact stored in your database. If the information is different then update your database.- Set your script to run periodically:
a. If using Linux
- Set your server's Cron function to run the script at certain times.
-or-
b. If using Windows- Set Windows Task Scheduler to run the script (or a batch file and the script) at certain times.
You can also check this tutorial.
Upvotes: 4
Reputation: 1880
Push notifications are not available for the Contacts API.
Upvotes: 3