Customers API¶
Summary¶
| Resource | Operation | Description |
|---|---|---|
| GET /dcs/(dc_id)/customers/(customer_id)/waypoints | Get waypoint information for a given customer id` | |
| Customers | GET /dcs/(dc_id)/customers/(customer_id)/confident-location | Get the confident location for a customer if available |
| GET /dcs/(dc_id)/customers/(customer_id) | Get a customer |
Details¶
-
GET/dcs/(dc_id)/customers/(customer_id)/confident-location¶ Parameters: - dc_id (string) – The dc id
- customer_id (string) – The customer’s id
Status Codes: - 200 OK – A JSON object with the customer’s location and id is returned
- 400 Bad Request – Check error code within the response.
- 401 Unauthorized – API key is invalid.
- 403 Forbidden – DC does not exist or user does not have permission to access it.
- 404 Not Found – Customer does not exist.
Error Code Description 7001 Customer location not confident. Example request
{ "dc_id": "Foxtrot-DC", "customer_id": "johns-burger-shack" }
Example response
{ "status": "success", "data": { "customer_id: "johns-burger-shack", "latitude": 1.00456, "longitude": -3.123534 } }
-
GET/dcs/(dc_id)/customers/(customer_id)/waypoints¶ Parameters: - dc_id (string) – The dc id
- customer_id (string) – The customer’s id
Status Codes: - 200 OK – waypoints are returned.
- 401 Unauthorized – API key is invalid.
- 403 Forbidden – DC does not exist or user does not have permission to access it.
Example response
{ "waypoints": [ { "id": "The waypoint's id", "customer_id": "The customer's id", "status": "PENDING", "completed_timestamp": null, "estimated_time_of_arrival": 123456, "waypoints_ahead": 4, "waiting_time_seconds": 600, "route_id": "The route's id" }, ... ] }
Note that this only returns the most recent 10 waypoints for the customer.
-
GET/dcs/(dc_id)/customers/(customer_id)¶ Parameters: - dc_id (string) – The dc id
- customer_id (string) – The customer’s id
Status Codes: - 200 OK – Customer object is returned.
- 401 Unauthorized – API key is invalid.
- 403 Forbidden – DC does not exist or user does not have permission to access it.
- 404 Not Found – Customer does not exist.
Example response
{ "status": "success", "data": { "customer": { "id": "the customer's id", "name": "the customer's name", "imported_address": "address string", "imported_location": { "latitude": 37.77493, "longitude": 122.41942 }, "inferred_location": { "latitude": 37.77483, "longitude": 122.41940 } } } }
Note that the location object may be null if Foxtrot does not have an imported location for the customer.