How do I use Google's “Simple API Access key” to access Google Calendar info (PHP)?

后端 未结 5 1373
温柔的废话
温柔的废话 2020-12-18 20:04

I\'m trying to use the Google API v3 to access one google calendar and according to the documentation here : http://code.google.com/apis/calendar/v3/using.html#intro and her

5条回答
  •  情话喂你
    2020-12-18 20:34

    (i know this is an old question but i would've been glad if someone gave a real answer here so i'm doing it now)


    I came on the same problem, Simple API access is not well documented (or maybe just not where i searched), but using the Google API Explorer i found a way to get what i need, which is in fact pretty straightforward. You don't need specific lib or anything : it's actually really simple.

    In my case i simply needed to search a keyword on G+, so i just had to do a GET request:

    https://www.googleapis.com/plus/v1/activities?query={KEYWORD}&key={YOUR_API_KEY}
    

    Now, for a calendar access (see here), let's pretend we want to fetch access control rules list. We need to refer to calendar.acl.list which give us the URI :

    https://www.googleapis.com/calendar/v3/calendars/{CALENDAR_ID}/acl?key={YOUR_API_KEY}
    

    Fill in the blanks, and that's pretty much all you need to do. Get a server key (API Access submenu), store it somewhere in your project and call it within URIs you're requesting.

提交回复
热议问题