July 2017
Beginner to intermediate
312 pages
7h 27m
English
To get an access code, we need to go to https://api.pinterest.com/oauth/ and obtain the code, which will be returned with a redirect URI. We can do it using Python's requests library.
When calling the authorization service, we must submit some parameters:
response_type - takes the value 'code' redirect_uri - our previously defined URI client_id - our App ID scope - list of permission scopes state - any value we can define (used for security reasons) import requests url = 'https://api.pinterest.com/oauth/' params = { 'response_type' : 'code', 'redirect_uri' : 'https://mysite.com/', 'client_id' : 'CLIENT_ID', 'scope' : 'read_public,write_public', 'state' : '145ABc' } response = requests.get(url, ...Read now
Unlock full access