PHP Classes

Google-Calendar

Recommend this page to a friend!

      PHP OAuth Library  >  All threads  >  Google-Calendar  >  (Un) Subscribe thread alerts  
Subject:Google-Calendar
Summary:Connect with Google_Kalender
Messages:18
Author:Schenk Philipp
Date:2012-11-14 13:26:36
Update:2012-11-21 02:56:27
 
  1 - 10   11 - 18  

  1. Google-Calendar   Reply   Report abuse  
Picture of Schenk Philipp Schenk Philipp - 2012-11-14 13:26:36
I've installed PHP OAuth APi and manage to also log on to Google. In https://code.google.com/apis/console requests counts one) high.

How can I get now to connect with my Google Calendar? Do I have something in login_with_google.php enter, so I can add events to the calendar?

  2. Re: Google-Calendar   Reply   Report abuse  
Picture of Manuel Lemos Manuel Lemos - 2012-11-14 16:25:47 - In reply to message 1 from Schenk Philipp
Yes, you need to specify a scope that grants you access to the user Google calendar.

There seems to be two scope values, one for read and write access and another for read-only access:

googleapis.com/auth/calendar
googleapis.com/auth/calendar.readon ...

Here you find more details:

developers.google.com/google-apps/c ...

  3. Re: Google-Calendar   Reply   Report abuse  
Picture of Schenk Philipp Schenk Philipp - 2012-11-14 21:03:56 - In reply to message 2 from Manuel Lemos
Where can I write purely this line?
In "login_with_google.php"?

At: $ client-> scope = .....
Or at: $ success = $ client-> CallAPI (.......

It looks as if I'm on the right track, but still not quite there.

  4. Re: Google-Calendar   Reply   Report abuse  
Picture of Manuel Lemos Manuel Lemos - 2012-11-14 23:12:07 - In reply to message 3 from Schenk Philipp
It is the $client->scope variable that you need to assign of of the two possible scope values to access Google Calendar API on behalf of the user.

  5. Re: Google-Calendar   Reply   Report abuse  
Picture of Schenk Philipp Schenk Philipp - 2012-11-15 07:41:40 - In reply to message 4 from Manuel Lemos
This code does not work:
$client-> scope = 'https://www.googleapis.com/auth/calendar'.
'https://www.googleapis.com/auth/userinfo.profile';

Why? What am I doing wrong or where is the mistake?

  6. Re: Google-Calendar   Reply   Report abuse  
Picture of Manuel Lemos Manuel Lemos - 2012-11-15 11:08:54 - In reply to message 5 from Schenk Philipp
It seems you are missing a space between permissions.

  7. Re: Google-Calendar   Reply   Report abuse  
Picture of Schenk Philipp Schenk Philipp - 2012-11-15 20:52:35 - In reply to message 6 from Manuel Lemos
also with a space it does not work.
have to / auth / calendar made ​​the space.

Https / /: code.google.com / apis / console requests always counts +1. Calendar API # of requests not.
Perhaps correctly so. I do not know.

  8. Re: Google-Calendar   Reply   Report abuse  
Picture of Manuel Lemos Manuel Lemos - 2012-11-16 05:19:58 - In reply to message 7 from Schenk Philipp
I just tried it here and it worked OK.

Can you execute the call to get the user info to this URL?

googleapis.com/oauth2/v1/userinfo

I did and it worked, as well doing a Google Calendar v3 API to get the list of calendars of the current user.

googleapis.com/calendar/v3/users/me ...

What errors are you getting?

  9. Re: Google-Calendar   Reply   Report abuse  
Picture of Schenk Philipp Schenk Philipp - 2012-11-17 21:35:32 - In reply to message 8 from Manuel Lemos
I get a Google Calendar which I have added to my account.

Calendar API # requests then counts each +1.

Ander this point, I add now a new event?

  10. Re: Google-Calendar   Reply   Report abuse  
Picture of Manuel Lemos Manuel Lemos - 2012-11-18 07:45:57 - In reply to message 9 from Schenk Philipp
I am not sure what you are asking.

Do you want to call the API to add a new event to a calendar?

I think you just need to figure the parameters you need to pass and call the right API URL.

Keep in mind that once you get the access token, you do not need to call the API when the user is accessing your site. The user is just needed to authorize the access and later to authorize again if the token is revoked.

 
  1 - 10   11 - 18