【问题标题】:foursquare invalid_oauth error for /v2/checkins/add/v2/check ins/add 的foursquare invalid_auth 错误
【发布时间】:2012-06-15 15:54:47
【问题描述】:

为用户成功获取 oauth_token 后,我能够从端点获得成功响应,例如: https://api.foursquare.com/v2/users/self/checkins?oauth_token=MY_ACCESS_TOKEN

但是,当我尝试通过以下帖子添加签到时:

https://api.foursquare.com/v2/checkins/add

venueId=4d234b5bf7a9a1438f1a479f&shout=sdfasdfasdfasdf&oauth_token=MY_ACCESS_TOKEN

我收到以下回复:

{"meta":{"code":400,"errorType":"invalid_auth","errorDetail":"缺少访问凭据。有关详细信息,请参阅 https://developer.foursquare.com/docs/oauth.html ."},"响应":{}}

有其他人注意到将您的 oauth_token 用于某些 API 端点而不是其他端点的问题吗?

【问题讨论】:

    标签: oauth-2.0 foursquare


    【解决方案1】:

    我的猜测是你没有正确传递 POST 参数。 OAuth 令牌是我们在任何给定请求中检查的第一个参数,因此即使您丢失了所有参数,您也会看到 oauth_token 的错误。

    我会仔细检查您是否正确传递了您的 POST 参数。

    【讨论】:

    • 谢谢,我没有在我的帖子中指定内容类型标题,添加修复它。内容类型:application/x-www-form-urlencoded
    • @smehmood - 你能粘贴代码来支持你的答案吗?
    猜你喜欢
    • 1970-01-01
    • 2010-10-06
    • 1970-01-01
    • 2011-07-26
    • 1970-01-01
    • 2012-11-05
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多