您好我正在尝试在我的项目中实现Ride Reminder Uber API,但我得到了错误响应,如:
参考网址:
https://developer.uber.com/docs/v1-reminders-post
JSON错误响应:
{
"message": "Unable to parse JSON in request body.",
"code": "invalid_json"
}
URL
https://api.uber.com/v1/reminders
接头:
Content-Type: application/json
Authorization: Token vzOv0AaaZVRaV1FiZLt9SPU2ZgIrBgQ6uZy6j4Gr
Post Params:
reminder_time:1451496600(Unix UTC timestamp of when the reminder will occur.)
phone_number: +91xxxxxxxxxx(India's number)
server_token: vzOv0AaaZVRaV1FiZLt9SPU2ZgIrBgQ6uZy6j4Gr
event: {
"time": "1451498400",
"longitude": "72.5290",
"latitude": "23.0384",
"location": "Vastrapurlake",
"name": "Test"
}
更多细节检查PostMan屏幕截图:
邮政参数:Click here 标题参数:Click here
你能帮帮我吗,先谢谢!!
答案 0 :(得分:3)
您的内容类型和令牌有效,请勿更改任何内容。
只需在json中转换你的参数,别忘了使用双引号。
您必须在邮递员中以json格式传递这些数据。
{"reminder_time":"1451649600",
"phone_number": "+91<YOUR-MOBILE-NUMBER>",
"server_token": "vzOv0AaaZVRaV1FiZLt9SPU2ZgIrBgQ6uZy6j4Gr",
"event": {
"time": "1451649600",
"longitude": "72.5290",
"latitude": "23.0384",
"location": "Vastrapurlake",
"name": "Test"
}}