这个文档很清楚:http://developers.pinterest.com/api_docs/oauth_code_exchange/
我需要 code
用访问 token 交换它。但是访问此代码的端点在哪里?试过“经典”:
https://api.pinterest.com/oauth2/auth?client_id=&redirect_uri=&scope=&response_type=code
但似乎是 404。
最佳答案
v3 的端点是:
PUT https://api.pinterest.com/v3/oauth/code_exchange/
例子:
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"
但奇怪的是,您必须传入有效的访问 token 才能使端点工作,否则它将返回未经身份验证的错误。访问 token 可以来自任何人或任何 Pinterest 应用程序,不需要来自身份验证用户或身份验证应用程序,只要它没有过期。
目前获取有效访问 token 的最简单方法是在此处登录 Pinterest for iPhone 应用程序,您将在 URL 哈希中找到 token :
https://www.pinterest.com/oauth/?consumer_id=1431594&response_type=token
关于authentication - Pinterest 中的身份验证代码端点是什么?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21624632/