Skip to content

Instantly share code, notes, and snippets.

@thiagogds
Last active December 6, 2016 19:18
Show Gist options
  • Select an option

  • Save thiagogds/374a3466f7a197ba62953e5023b78d20 to your computer and use it in GitHub Desktop.

Select an option

Save thiagogds/374a3466f7a197ba62953e5023b78d20 to your computer and use it in GitHub Desktop.
# -*- coding: utf-8 *-*
import requests
client_code_url = 'https://graph.facebook.com/v2.7/oauth/client_code'
code_params = {
'access_token': {{ ACCESS_TOKEN }},
'client_id': {{ FACEBOOK_KEY }},
'client_secret': {{ FACEBOOK_SECRET }},
'redirect_uri': '',
}
code_response = requests.get(client_code_url, code_params).json()
token_url = 'https://graph.facebook.com/v2.7/oauth/access_token'
token_params = {
'client_id': {{ FACEBOOK_KEY }},
'code': code_response.get('code'),
'redirect_uri': '',
}
token_response = requests.get(token_url, token_params).json()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment