Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to get YOUR_ACCESS_TOKEN , YOUR_REFRESH_TOKEN? #3

Open
skanel opened this issue Jun 4, 2015 · 2 comments
Open

How to get YOUR_ACCESS_TOKEN , YOUR_REFRESH_TOKEN? #3

skanel opened this issue Jun 4, 2015 · 2 comments

Comments

@skanel
Copy link

skanel commented Jun 4, 2015

# Import the GoogleCalendarAPI Class.
from google_calendar_v3 import GoogleCalendarAPI

# Define a token handler for use on token refresh.
def new_token_handler(token):
    # Do something with your token. Like stick it in a db.
    print "A new token arrived: "
    print token

# Enter in your various credentials here.
access_token = "<YOUR_ACCESS_TOKEN>"
refresh_token = "<YOUR_REFRESH_TOKEN>"
client_id = "902453498010-ubvvvk714bada1o9tog10i3n5fq7cqm.apps.googleusercontent.com"
client_secret = "jK_7QqIZlcxzk-WuLo8Kyc9-"

# Create an instance of the Google Calendar API.
gapi = GoogleCalendarAPI(client_id=client_id, client_secret=client_secret,
             acc_token=access_token, ref_token=refresh_token, expires_in=-30,
             token_updater=new_token_handler)

# Do something with it.
r  = gapi.settings_list("dateFieldOrder")
print t.text
@jkatz50
Copy link

jkatz50 commented Jul 28, 2015

not an issue - register with google api console

https://code.google.com/apis/console/b/0/

@skanel
Copy link
Author

skanel commented Jul 28, 2015

thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants