Query Drier Location

Update Date: 2024-03-26 Recommended Online test(Sandbox)
This interface for China Mainland service is Mandatory, we suggest all vendor provide driver location data.


Summary

  1. This interface is used to obtain the driver's real-time location. Ctrip will request it starting one hour before the car is used, and you need to return the location information within 300ms.
  2. Data for multiple orders will be pulled each time, and the number of orders depends on your interface performance. Please contact the Ctrip PM to confirm.
  3. After the service is completed, please call "Order Completion" in a timely manner, and Ctrip will immediately stop the query. Otherwise, we will stop the query 12 hours after the service start time; if there are any abnormalities such as driver offline, the last obtained latitude and longitude data is required.
  4. It is recommended that the supplier updates the driver's location every 5-10 seconds

API address

API address Format:  {Domain}/JNT/querydriverlocation/2.0/{timeStamp}/{sign}

Request Payload

QueryDriverLocationRequest

Parameter Type Required Description Example Note
orderInfo List<OrderInfoDTO> Y List of Order    

OrderInfoDTO

Parameter Type Required Description Example Note
ctripPurchaseOrderId Long Y Ctrip Purchase Order ID 881823967638342968 18 digital
vendorOrderId String Y Vendor Order ID   Provide by Vendor
startTime string Y Last Queried Time   Queried Time: yyyy-MM-dd HH:mm:ss

Response Payload

QueryDriverLocationResponse

Parameter Type Required Description Example Note
orderDriverLocationInfo List<OrderDriverLocationDTO> Y Driver Location Data with Order    
msgCode String Y Response Code OK Response Code
message String N Response Detail Success Response Code

OrderDriverLocationDTO

Parameter Type Required Description Example Note
driverLocationInfo List<DriverLocationDTO> Y Driver Location Data    
ctripPurchaseOrderId Long Y Ctrip Purchase Order ID 881823967638342968 18 digital
msgCode String Y Response Code OK Response Code
message String N Response Detail Success Response Code

DriverLocationDTO

Parameter Type Required Description Example Note
longitude BigDecimal Y Longitude 121.351145 6 Decimal Places
latitude BigDecimal Y Latitude 31.221373 6 Decimal Places
coordinate String Y Geographic Coordinate System GCJ02 GCJ02; WGS84
locationTime String Y Time Stamp for This Query   yyyy-MM-dd HH:mm:ss
speed BigDecimal Y Driver Speed   Unit: km/h. If can't provide, please input 255.
direction BigDecimal Y Driver Moving Direction   North is 0. If can't provide, please input 511.
locationType Integer N Method 1 1:Base Station; 2:Cache; 3:GPS; 4:Wifi
height BigDecimal N Height   Unit: Meter, 2 Decimal Places
accuracy BigDecimal N Accuracy   Unit: Meter, 2 Decimal Places

Request Example

{
    "orderInfo": [{

        "ctripPurchaseOrderId": 881824123456949513,
        "vendorOrderId": "11259022228429",
        "startTime": "2020-10-20 22:22:22"
    }]
}

Response Example

{
    "msgCode":"OK",
    "massage":"SUCCESS",
    "orderDriverLocationInfo":[
        {
            "ctripPurchaseOrderId":881824250534949513,
            "msgCode":"OK",
            "message":"成功",
            "driverLocationInfo":[
                {
                    "longitude":119.192474,
                    "latitude":26.051053,
                    "coordinate":"GCJ02",
                    "locationTime":"2020-10-20 22:22:12",
                    "speed":12,
                    "direction":10,
                    "locationType":1
                }
            ]
        },
        {

            "ctripPurchaseOrderId":88123234955611233,
            "msgCode":"OK",
            "message":"成功",
            "driverLocationInfo":[
                {
                    "longitude":120.302474,
                    "latitude":30.012123,
                    "coordinate":"GCJ02",
                    "locationTime":"2020-10-20 22:22:12",
                    "speed":40,
                    "direction":20,
                    "locationType":1
                }
            ]
        }
    ]
}

Error Example

{
    "msgCode":"OK",
    "massage":"SUCCESS",
    "driverLocationInfo":[
        {
            "ctripPurchaseOrderId":881824250534949513,
            "msgCode":"OK",
            "message":"成功",
            "driverLocationInfo":[
                {
                    "longitude":119.192474,
                    "latitude":26.051053,
                    "coordinate":"GCJ02",
                    "locationTime":"2020-10-20 22:22:12",
                    "speed":12,
                    "direction":10,
                    "locationType":1
                }
            ]
        },
        {
            "ctripPurchaseOrderId":88123266666611233,
            "msgCode":"ERROR_NO_DRIVER_LOCATION",
            "message":"",
            "driverLocationInfo":[
            ]
        }
    ]
}

results matching ""

    No results matching ""