【问题标题】:Ride Reminders Uber Api got JSON error乘车提醒 Uber Api 出现 JSON 错误
【发布时间】:2023-04-04 21:50:01
【问题描述】:

您好,我正在尝试在我的项目中实现 Ride Reminder Uber API,但收到如下错误响应:

参考网址:

https://developer.uber.com/docs/v1-reminders-post

JSON 错误响应:

{
"message": "Unable to parse JSON in request body.",
"code": "invalid_json"
}

网址

https://api.uber.com/v1/reminders

标题:

Content-Type: application/json
Authorization: Token vzOv0AaaZVRaV1FiZLt9SPU2ZgIrBgQ6uZy6j4Gr

发布参数:

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

你能帮帮我吗,在此先感谢!

【问题讨论】:

    标签: uber-api


    【解决方案1】:

    您的 Content-Type 和令牌是有效的,不要在那里更改任何内容。

    只需在 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"
          }}
    

    【讨论】:

      猜你喜欢
      • 2020-11-17
      • 1970-01-01
      • 2017-01-01
      • 2016-08-07
      • 2015-07-09
      • 1970-01-01
      • 2016-05-21
      • 2017-02-12
      • 1970-01-01
      相关资源
      最近更新 更多