Ihor Sloboda
Ihor Sloboda

Reputation: 11

Google Calendar API + Service Account + PHP cURL

all. I have a situation where I need to pull dates for events from a specific calendar from google. Since this is my calendar I don't need anything from anyone. I have created a service account but got stuck how to get authenticated with it using PHP cURl, would appreciate any help!

At the moment I have:

*I don't see a point to install full google PHP API library for just this task

Upvotes: 0

Views: 997

Answers (1)

Zilog80
Zilog80

Reputation: 2562

Google API support OAuth2 authentication. You can use curl with --oauth2-bearer and the token you'll get from your service account on its account page (you have to go to the API console of the account, check the links below).

For PHP cURL, it's the CURLOPT_XOAUTH2_BEARER option, require cURL 7.33 at least. You have to set this with curl_setopt.

Here's the Google modus operandi for the account and the assitant for that.

Upvotes: 1

Related Questions