Skip to content

Instantly share code, notes, and snippets.

@micahnz
micahnz / example.js
Created September 15, 2015 22:17
POST /api/rest/v1/orders/calculate - Calculate and sign an order with price, distance and duration for posting to order createoi
// post body example
{
"pickupAt": "2015-08-19T14:40:34.427Z",
"pickupAddress": {
"streetNumber": "street number",
"streetName": "street name",
"subDistrict": "sub district",
"district": "district",
"city": "city",
"state": "state",
@micahnz
micahnz / create-order.js
Created September 15, 2015 22:20
POST /api/rest/v1/customer/orders - Create new order, should be the response from the calculate call
// post body example
{
"pickupAt": "2015-08-19T14:40:34.427Z",
"pickupAddress": {
"streetNumber": "street number",
"streetName": "street name",
"subDistrict": "sub district",
"district": "district",
"city": "city",
"state": "state",
@micahnz
micahnz / available-assignments.js
Created September 15, 2015 22:22
GET /driver/assignments/available - Driver gets a list of available assignments to them
// response body example
{
"success": true,
"result": {
"total": 1,
"length": 1,
"items": [
{
"id": 5,
"createdAt": "2015-09-15T21:58:59.946Z",
@micahnz
micahnz / unassigned-orders.js
Created September 15, 2015 22:26
GET /api/rest/v1/customer/orders/unassigned - Customer gets a list of unassigned orders
// response body
{
"success": true,
"result": {
"total": 4,
"length": 4,
"items": [
{
"id": 5,
"createdAt": "2015-09-15T21:58:59.856Z",
@micahnz
micahnz / accept-assignment.js
Created September 15, 2015 22:28
POST /api/rest/v1/driver/assignments/1/accept - Driver accepts an assignment
// response body
{
"success": true
}
@micahnz
micahnz / orders-assigned.js
Created September 15, 2015 22:30
GET /api/rest/v1/customer/orders/assigned - Customer gets a list of orders that have had a driver assigned to one or more assignment
// response body example
{
"success": true,
"result": {
"total": 1,
"length": 1,
"items": [
{
"id": 5,
"createdAt": "2015-09-15T21:58:59.856Z",
@micahnz
micahnz / start-job.js
Created September 15, 2015 22:34
POST /api/rest/v1/driver/jobs/1/start - Driver arrives at location, picks up parcels and starts the job
// response body
{
"success": true
}
@micahnz
micahnz / active-orders.js
Created September 15, 2015 22:37
GET /api/rest/v1/customer/orders/active - Customer gets active orders. eg. orders that have had one or more jobs started
// response body
{
"success": true,
"result": {
"total": 1,
"length": 1,
"items": [
{
"id": 2,
"createdAt": "2015-09-15T21:35:24.061Z",
@micahnz
micahnz / complete-job.js
Created September 15, 2015 22:39
POST /api/rest/v1/driver/jobs/2/complete - Driver drops off parcels and completes a job
// response body
{
"success": true
}
@micahnz
micahnz / complete-orders.js
Created September 15, 2015 22:40
GET /api/rest/v1/customer/orders/complete - Customer gets a list of completed orders
{
"success": true,
"result": {
"total": 2,
"length": 2,
"items": [
{
"id": 1,
"createdAt": "2015-09-15T21:31:35.698Z",
"updatedAt": "2015-09-15T22:34:14.892Z",