织梦CMS - 轻松建站从此开始!

欧博ABG官网-欧博官方网址-会员登入

Pinterst api: not able to get欧博 access token

时间:2025-07-18 06:21来源: 作者:admin 点击: 7 次
Below is the correct way to get the access token: client_id= 'my_client_id' client_secret = 'my_client_secret' data_string = f'{client_id}:{client_se

Below is the correct way to get the access token:

client_id= 'my_client_id' client_secret = 'my_client_secret' data_string = f'{client_id}:{client_secret}' token = base64.b64encode(data_string.encode()) headers = { 'Authorization': 'Basic ' + token.decode('utf-8'), 'Content-Type': 'application/x-www-form-urlencoded', } url = "https://api.pinterest.com/v5/oauth/token" code = "my_code_that_i_got_in_the_first_step" data= { 'grant_type':'authorization_code', 'code': code, 'redirect_uri':'https://my_redirect_uri' } r = requests.post(url, headers=headers, data=data) print(r.json())

In my question, I had mistyped redirect_uri as redirect_url. Also, when sending a POST, you should use data instead of params. See the comment by Amos Baker.

(责任编辑:)
------分隔线----------------------------
发表评论
请自觉遵守互联网相关的政策法规,严禁发布色情、暴力、反动的言论。
评价:
表情:
用户名: 验证码:
发布者资料
查看详细资料 发送留言 加为好友 用户等级: 注册时间:2025-07-23 01:07 最后登录:2025-07-23 01:07
栏目列表
推荐内容