GoGoVan API documentation - TW
Getting a quote
Request:
curl -X GET \
-H 'GoGoVan-API-Key: b87d2da0-d333-4dbd-b984-b7d05d232fa3' \
-H 'GoGoVan-User-Language: zh-TW' \
-F 'order[name]=John' \
-F 'order[phone_number]=0919829929' \
-F 'order[pickup_time]=2016-01-17T18:00:00Z' \
-F 'order[vehicle]=motorcycle' \
-F 'order[extra_requirements][remark]=Please confirm the following 3 items:
http://example.com/list' \
-F 'order[locations]=[[25.0552809,121.544679,"台北市松山區興安街174巷6號1樓"],[25.1344639,121.506923,"台北市北投區溫泉路68巷24號1樓"]]' \
'https://stag-tw.gogovan.tech/api/v0/orders/price.json'
GoGoVan-User-Language
can be en-US
zh-TW
zh-CN
Response:
{
"base" : 80,
"total" : 149,
"breakdown" : {
"fee" : {
"title" : "運費",
"value" : 149
},
"night_extra_charge" : {
"value" : 149,
"title" : "夜間附加費"
},
}
}
Requesting for a van
Request:
curl -X POST \
-H 'GoGoVan-API-Key: b87d2da0-d333-4dbd-b984-b7d05d232fa3' \
-H 'GoGoVan-User-Language: zh-TW' \
-F 'order[name]=John' \
-F 'order[phone_number]=0989817829' \
-F 'order[pickup_time]=2016-01-17T18:24:01Z' \
-F 'order[vehicle]=motorcycle' \
-F 'order[extra_requirements][remark]=Please confirm the following 3 items:
http://example.com/list' \
-F 'order[locations]=[[25.0552809,121.544679,"台北市松山區興安街174巷6號1樓"],[25.1344639,121.506923,"台北市北投區溫泉路68巷24號1樓"]]' \
'https://stag-tw.gogovan.tech/api/v0/orders.json'
Response:
{ "id": 729 }
Canceling a request
curl -v -X POST \
-H 'GoGoVan-API-Key: b87d2da0-d333-4dbd-b984-b7d05d232fa3' \
-H 'GoGoVan-User-Language: zh-TW' \
'https://stag-tw.gogovan.tech/api/v0/orders/1885/cancel.json'
The response will be just HTTP 200 OK with no response body.
Checking status
Request:
curl -v -X GET \
-H 'GoGoVan-API-Key: b87d2da0-d333-4dbd-b984-b7d05d232fa3' \
-H 'GoGoVan-User-Language: zh-TW' \
'https://stag-tw.gogovan.tech/api/v0/orders/1885.json'
Response:
{
"name" : "John",
"price" : 220,
"id" : 729,
"phone_number" : "61577364",
"status" : "pending"
}
Pending - The order is not picked up by any driver yet assigned - A driver has been assigned to the order completed - The order has been marked "completed" by the driver canelled - The order has been marked "cancelled" by the driver
Getting status notification
An HTTP JSON POST request will be made to a designated URL when the status of an Order changed. It will contain the response in the format of checking status.
It will also contain a field named event
, with the following possible values:
assigned - A driver has been assigned to the order completed - The order has been marked "completed" by the driver canelled - The order has been marked "cancelled" by the driver