【问题标题】:Foursquare API - can't get User (my own) check in historyFoursquare API - 无法让用户(我自己的)签入历史记录
【发布时间】:2019-07-17 17:23:07
【问题描述】:

我一直在引用这个https://developer.foursquare.com/docs/api/users/checkins 尝试下载我自己的签到历史记录。

我能够从“入门”页面获得他们自己的示例来工作:

const request = require('request');

request({
  url: 'https://api.foursquare.com/v2/venues/explore',
  method: 'GET',
  qs: {
    client_id: 'CLIENT_ID',
    client_secret: 'CLIENT_SECRET',
    ll: '40.7243,-74.0018',
    query: 'coffee',
    v: '20180323',
    limit: 1
  }
}, function(err, res, body) {
  if (err) {
    console.error(err);
  } else {
    console.log(body);
  }
});

当我尝试通过替换此端点上方的 url https://api.foursquare.com/v2/users/USER_ID/checkins 来更改它以获取我自己的签入时,它给了我一个需要版本的错误(即使它不在参数文档中)。

我在示例中的 v 参数中留下了这个错误:“需要用户调用此端点。”我也尝试过更改 URL,因为一些在线示例/文档说关于用户 ID:“目前,仅支持自我”我尝试用我的用户 ID 替换 USER_ID 并尝试了这个:https://api.foursquare.com/v2/users/self/checkins,但它给出了我同样的错误。

qs: {
    client_id: 'CLIENT_ID',
    client_secret: 'CLIENT_SECRET',     
    v: '20180323',
    user_id: 'userid'  //tried with self, tried without it
  }

我并不关心如何让它工作,就像我能够下载我自己的foursquare数据一样。不再支持我大约 5 年前能够使用的链接。

【问题讨论】:

    标签: node.js foursquare


    【解决方案1】:

    您不能在此 API(用户身份验证 API)中使用 client_idclient_secret 参数。尝试以下参数:

    qs: {
      oauth_token: 'OAUTH_TOKEN',
      v: '20180323',
      user_id: 'self'
    }
    

    如何获得oauth_token https://developer.foursquare.com/docs/api/configuration/authentication

    【讨论】:

      猜你喜欢
      • 2011-12-31
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2014-01-07
      • 1970-01-01
      • 1970-01-01
      • 2012-06-14
      相关资源
      最近更新 更多