Closed ALEXDINO7 closed 1 year ago
Hi @ALEXDINO7, can you share the following information?
Hi @ALEXDINO7, can you share the following information?
- SDK full code
- Logs
This is my code to Exchange the code for an access token
i use the docs here
url_api = "https://api.pinterest.com/v5/oauth/token"
headers = { 'Authorization': '{HERE I ADDED MY CORRET CLIENT_ID:CLIENT_SECRET}', 'Content-Type': 'application/x-www-form-urlencoded' } params = { 'grant_type':'authorization_code', 'code': 'HERE I ADDED MY CODE ITS WORKING ', 'redirect_uri':'https://www.HEREMYWEBSITE.com/'
}
response = requests.post(url_api, headers=headers, data=params)
print(response.status_code)
HERE I GET 401 CODE
Hi @ALEXDINO7 are you adding a Basic
and encoding the client_id:client_secret with base 64 prefix to the headers?
url_api = "https://api.pinterest.com/v5/oauth/token"
headers = {
'Authorization': 'Basic {HERE I ADDED MY CORRET CLIENT_ID:CLIENT_SECRET}',
'Content-Type': 'application/x-www-form-urlencoded'
}
params = {
'grant_type': 'authorization_code',
'code': 'HERE I ADDED MY CODE ITS WORKING ',
'redirect_uri': 'https://www.heremywebsite.com/'
}
response = requests.post(url_api, headers=headers, data=params)
print(response.status_code)
yes i use this website https://www.base64encode.org/
i generated Authorization by doing this client_id:client_secret
did you mean i include the word basic + client_id:client_secret ??
Yes, did you?
Yes, did you?
yes the same error
@ALEXDINO7 looks like you have some authentication error not related to the SDK, please ask for support for your developer app
You can request it here: https://help.pinterest.com/en/contact?page=overview_page_2 using the option Pinterest API and Developer Tools
> API Access
.
i created a new code and use this example as discribed in docs and i get a 401 error
https://www.pinterest.com/oauth/? client_id={YOUR_CLIENT_ID}& redirect_uri={YOUR_REDIRECT_URI}& response_type=code& scope=boards:read,pins:read& state={YOUR_OPTIONAL_STRING}