骑行请求返回在沙箱和产品中找不到的404页

时间:2019-06-21 09:09:59

标签: uber-api

我正在尝试超级乘车请求API。能够获得产品,在沙箱和产品中都可以估算票价。但是,找不到骑行请求重现404页。 在获得票价估算后,我立即提出乘车要求,以确保票价估算不会过期。我正在邮递员中对此进行测试,并给出了邮递员代码

在沙盒和产品中都尝试过,并返回相同的结果。 尝试在乘车请求中添加product_id并将其保持为可选状态

票价estimage代码

curl -X POST \
  https://api.uber.com/v1.2/requests/estimate \
  -H 'Accept: */*' \
  -H 'Authorization: Bearer token-xyzzabcd' \
  -H 'Connection: keep-alive' \
  -H 'Content-Type: application/json' \
  -H 'Host: api.uber.com' \
  -H 'User-Agent: PostmanRuntime/7.15.0' \
  -H 'accept-encoding: gzip, deflate' \
  -H 'content-length: 226' \
  -H 'cookie: marketing_vistor_id=59526eba-b6e3-4024-a8a9-0b9f1c88eb7b' \
  -b marketing_vistor_id=59526eba-b6e3-4024-a8a9-0b9f1c88eb7b \
  -d '{
       "start_latitude": 18.660952,
       "start_longitude": 73.828433,
       "end_latitude": 18.562113,
       "end_longitude": 73.8042427,
       "product_id": "3d67403a-afdc-41a1-9ea9-df68a3f4a835"

     }'

低于对票价估算的响应

{
    "fare": {
        "breakdown": [
            {
                "type": "base_fare",
                "name": "Base Fare",
                "value": 200.99
            }
        ],
        "value": 200.99,
        "fare_id": "df4b3a6da7cecd7d93bfd08aef2f096cb18b2374c87a97dd639ae54fe4088045",
        "expires_at": 1561107159,
        "display": "₹200.99",
        "currency_code": "INR"
    },
    "trip": {
        "distance_unit": "mile",
        "duration_estimate": 1800,
        "distance_estimate": 10.59
    },
    "pickup_estimate": 6
}

乘车要求

curl -X POST \
  https://api.uber.com/v1.2/requests/ \
  -H 'Accept: */*' \
  -H 'Authorization: Bearer tokenabcdxyz' \
  -H 'Connection: keep-alive' \
  -H 'Content-Type: application/json' \
  -H 'Host: api.uber.com' \
  -H 'User-Agent: PostmanRuntime/7.15.0' \
  -H 'accept-encoding: gzip, deflate' \
  -H 'content-length: 306' \
  -H 'cookie: marketing_vistor_id=59526eba-b6e3-4024-a8a9-0b9f1c88eb7b' \
  -b marketing_vistor_id=59526eba-b6e3-4024-a8a9-0b9f1c88eb7b \
  -d '{
       "start_latitude": 18.660952,
       "start_longitude": 73.828433,
       "end_latitude": 18.562113,
       "end_longitude": 73.8042427,
        "product_id": "3d67403a-afdc-41a1-9ea9-df68a3f4a835",
        "fair_id": "df4b3a6da7cecd7d93bfd08aef2f096cb18b2374c87a97dd639ae54fe4088045"
     }'

获得以下回应

404 page not found

1 个答案:

答案 0 :(得分:0)

解决了这个问题。这是因为/主机名https://api.uber.com/v1.2/requests/的末尾 删除后,api正常工作