Reputation: 639
I have enabled Google Calendar Push Notification API on my server. Everything is working fine, I am missing only the final set. That is returning the acknowledgment to Google that I have received the message and everything thing is fine. I know that I have to return a acknowledgment of 200 but I don't know how to do that in google-api-php-client.
$client = new Google_Client();
$client->setClientId($client_id);
$client->setDeveloperKey($developer_key);
$client->setClientSecret($client_secret);
$client->setRedirectUri($redirect_uri);
$client->addScope("https://www.googleapis.com/auth/drive");
$client->addScope("https://www.googleapis.com/auth/calendar");
$client->setAccessType('offline');
$refresh_token = $user['refresh_token'];
$client->refreshToken($refresh_token);
$service = new Google_Service_Calendar($client);
This is part of the code I use.
Upvotes: 0
Views: 196
Reputation: 3782
Response code 200 is the default. Another option is explicitly setting it using http_response_code(200) or using whatever your framework offers. AFAIK there is no special code in the google-api-php-client that would do receiving of notifications for you.
Upvotes: 1