Ishank lakhmani
Ishank lakhmani

Reputation: 11

Get Pinterest API authorization code in Python

I am able to get my Ads API from Pinterest using the manual method of generating a authentication code using -

https://www.pinterest.com/oauth/?client_id=ABC&redirect_uri=xyz.com&scope=ads:read

But I want to be able to dynamically generate the authentication code for Pinterest so I do not have to manually grant access and copy paste the auth code to the -

requests.post(url, data = {"grant_type":"authorization_code","code":"asjnakjsdbsdcsl"})

to generate my access token. Please let me know if there is a way to generate the authentication code dynamically, reading the auth code from the url once the request is posted.

I have tried reading the documentation of Python Pinterest library to try generating the auth code. But unable to find a way through that

Upvotes: 1

Views: 293

Answers (0)

Related Questions