July 2017
Beginner to intermediate
312 pages
7h 27m
English
Once we have successfully obtained the access token, we can make a test request to check if everything works correctly. To do this, we will use a simple endpoint returning the information about the authorized user.
url = 'https://api.pinterest.com/v1/me'
params = {'access_token': 'xxx'}
response = requests.get(url = url, params = params)
print(response, response.reason)
print(response.json())
The first print command should display the connection status. If the connection is working correctly, we get the following:
<Response [200]> OK
The next print command will display the authorized user's details, shown as follows:
{'data': {'first_name': NAME, 'id': 'YOUR_ID', 'last_name': LASTNAME', 'url': 'https://www.pinterest.com/USERNAME/'}} ...Read now
Unlock full access