我正在尝试在我正在使用的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
将返回预期的结果。所以我认为这不是访问令牌。
谢谢-Chris
只需添加&callback=在您的url末尾,即经度之后。