Ben*_*ong 7

v3的端点是:

PUT https://api.pinterest.com/v3/oauth/code_exchange/
Run Code Online (Sandbox Code Playgroud)

例:

curl -X PUT https://api.pinterest.com/v3/oauth/code_exchange/ -d "access_token={access token}&consumer_id={client id}&consumer_secret={client secret}&redirect_uri={redirect uri}&code={code}&grant_type=authorization_code"
Run Code Online (Sandbox Code Playgroud)

但奇怪的是,您必须传入有效的访问令牌才能使端点工作,否则它将返回Unauthenticated错误.访问令牌可以来自任何人或任何Pinterest应用程序,并且不需要来自身份验证用户或身份验证应用程序,只要它尚未过期即可.

到目前为止,获取有效访问令牌的最简单方法是在此处登录Pinterest for iPhone应用程序,您将在URL哈希中找到令牌:

https://www.pinterest.com/oauth/?consumer_id=1431594&response_type=token