【问题标题】:Uber API PHP Longitude must be a float for dictionary valueUber API PHP Longitude 必须是字典值的浮点数
【发布时间】:2015-04-24 22:51:24
【问题描述】:

我正在尝试在我正在使用的 PHP 应用程序中使用 Uber API 列出附近的产品。

我使用 OAuth2 库来获取我的访问和刷新令牌,但在尝试进行以下调用 https://api.uber.com/v1/products?latitude=51.556924&longitude=0.106405 时,我收到以下错误响应

array(3) {
  ["result"]=>
  array(3) {
    ["fields"]=>
    array(1) {
      ["longitude"]=>
      string(46) "Longitude must be a float for dictionary value"
    }
    ["message"]=>
    string(15) "Invalid request"
    ["code"]=>
    string(17) "validation_failed"
  }
  ["code"]=>
  int(422)
  ["content_type"]=>
      string(16) "application/json"
}

这表明问题与我提供的经度有关(坐标是阿森纳足球俱乐部在伦敦体育场外的票房)。

我错过了什么吗?

调用https://api.uber.com/v1/me 会返回预期结果。所以我认为它不是访问令牌。

谢谢 -克里斯

【问题讨论】:

    标签: php oauth-2.0 uber-api


    【解决方案1】:

    只需在您的网址末尾添加 &callback=?,即在经度之后。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2017-12-19
      • 1970-01-01
      • 2018-07-13
      • 2021-01-11
      • 2018-01-27
      • 2012-11-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多