Fleet - API


Endpoint URL

Staging

https://us-central1-fleet-staging-2333a.cloudfunctions.net

Production

Endpoint will be provided after System Integration Testing (SIT)


Login and Get Session Token

Description:

To get the session token

Description:

To get the session token

Endpoint:

/login

Method:

POST

Request Headers

Content-Type:

application/json

Content-Type:

application/json

Request Body

Field

Data Type

Required

Description

Field

Data Type

Required

Description

email

string

Yes

Fleet email credential

password

string

Yes

Fleet password

Sample Request Body

{ "email": "dev.fleet@gmail.com", "password": "P@ssw0rd" }

Sample Response

{ "success": true, "results": { "apiKey": "fb77c9653bf5e736d191b46bbfed7c2bd", "clientId": "SANDBOX_DEV", "sessionToken": "b45e2fb77c9653bf5e736d19e1fd18ebbffd0f6d3dd25af118e5eb38851bf4d" } }

 

Response for Invalid Credential

{ "success": false, "results": "Invalid login credential." }

 

Field

Description

Field

Description

apiKey

Generated hash on client-side to be used on succeeding API request

clientId

Reference Client ID

sessionToken

Generated hash on every API login to be used on succeeding API requests.
Expires after 20 minutes.

Error Responses

Status

Message

401 Unauthorized

401 Unauthorized

 

 

Get List of Areas

Description:

To get the list of areas

Description:

To get the list of areas

Endpoint:

/getListOfAreas

Method:

GET

Request Headers

Auth-Token:

<Auth Token acquired from LOGIN API>

Auth-Token:

<Auth Token acquired from LOGIN API>

URL Query Parameters

apiKey:

<API key acquired from LOGIN API>

apiKey:

<API key acquired from LOGIN API>


Sample Response

Field

Description

Field

Description

id

Generated hash id for your the area

code

area code

name

human readable name of the area

stores

array of store ids within this area

Error Responses

Status

Message

403 Forbidden

403 Forbidden

 

Get List of Stores

Description:

To get the list of stores

Description:

To get the list of stores

Endpoint:

/getListOfStores

Method:

GET

Request Headers

Auth-Token:

<Auth Token acquired from LOGIN API>

Auth-Token:

<Auth Token acquired from LOGIN API>

URL Query Parameters

apiKey:

<API key acquired from LOGIN API>

apiKey:

<API key acquired from LOGIN API>

areaCode:

<Area Code acquired from GET Area API>


Sample Response

Sample Response

Field

Description

Field

Description

id

Generated hash id for your the for the store

address

Address of the store/hub

advanceStart

boolean, whether or not the hub allow riders to start advance jobs

default

boolean, whether or not the hub is the default hub in the area

latitude

latitude coordinate of the hub

longitude

longitude coordinate of the hub

name

name of the hub

province

province where the hub is located

Get List of Jobs

Description:

To get jobs with the following statuses based on the store.
Statuses:
OPEN
ASSIGNED
ONGOING
HOLD (Skipped)
ACCEPTED
TRANSFERRED (Transferred to 3PL)
FOR_RTS
IN_TRANSIT_FOR_RETURN
FAILED_RETURN
PENDING_JOB_TRANSFER
TRANSFERRED_TO_ANOTHER_HUB
FOR_TRANSFER
RE_OPEN
FOR RETURN
DONE
CANCELLED

Description:

To get jobs with the following statuses based on the store.
Statuses:
OPEN
ASSIGNED
ONGOING
HOLD (Skipped)
ACCEPTED
TRANSFERRED (Transferred to 3PL)
FOR_RTS
IN_TRANSIT_FOR_RETURN
FAILED_RETURN
PENDING_JOB_TRANSFER
TRANSFERRED_TO_ANOTHER_HUB
FOR_TRANSFER
RE_OPEN
FOR RETURN
DONE
CANCELLED

Endpoint:

/getJobList

Method:

GET

Request Headers

Auth-Token:

<Auth Token acquired from LOGIN API>

Auth-Token:

<Auth Token acquired from LOGIN API>

URL Query Parameters

apiKey:

<API key acquired from LOGIN API>

apiKey:

<API key acquired from LOGIN API>

storeId:

<Store id acquired from STORE API where to get the list of jobs>

status:

<PENDING, DONE, or CANCELLED>

page:

<Page number>

startDate:

<Start Date>

endDate:

<End Date>

onlyOverDue:

<True or False>


Sample Response

Job Data

Field

Description

Field

Description

id

Generated hash unique

address

Destination address

assignedRiderKey

unique key for the rider assigned This is empty or undefined if job has no assigned rider.

assignedRiderName

name of the assigned rider. This is empty or undefined if job has no assigned rider.

city

city of the destination address

contactNumber

contact number of receiver

createdAt

Unix timestamp of the creation date

customerName

Name of the receiver

email

email of the receiver

expectedDeliveryDateTime

Unix timestamp for the expected delivery date

itemPrice

Declared item price

landMark

landmark

metaTags

string representation of the tags of this job including the labels and id of the tag

orderDetails

additional details of the job

orderId

reference number

phoneNumber

additional contact number of the receiver- usually a landline number

provice

province

remarks

Job remarks

status

status of the job

storeId

hash id of the store this job belongs to

storeName

Name of the store this job belongs to

tags

array of tag ids → get details of the tag via getListOfTags endpoint

timeAccepted

exact date and time the job is accepted by a driver (UNIX Timestamp)

timeAssigned

exact date and time the job is assigned to a driver (UNIX Timestamp)

timeImHere

exact date and time the driver arrived to the location (UNIX Timestamp)

timeStarted

exact date and time the driver started the job (UNIX Timestamp)

withinAccepted

duraction from timeAssigned to timeAccepted (ms)

withinAssigned

duration from createdAt to timeAssigned (ms)

withinInTransit

duration from timeImhereto timeStarted (ms)

withinReceived

duration from timeStarted to timeImHere (ms)

withinStarted

duration from timeAccepted to timeStarted (ms)

Get List of Available Riders

Description:

To get list of all available riders

Description:

To get list of all available riders

Endpoint:

/getAvailableRiders

Method:

GET

Request Headers

Auth-Token:

<Auth Token acquired from LOGIN API>

Auth-Token:

<Auth Token acquired from LOGIN API>

URL Query Parameters

apiKey:

<API key acquired from LOGIN API>

apiKey:

<API key acquired from LOGIN API>

storeId: (optional)

For single store: ["storeId"]
For multiple stores: ["storeId", "storeId",...]

inHub: (optional)

<true or false>

assignedThreshold: (optional)

<Number: Minimum 0>


Sample Response

Driver Data

Field

Description

Field

Description

areaKey

array of area ids this driver belongs to

disabled

Whether or not the driver is disabled

email

driver’s email

firstName

driver’s first name

lastName

driver’s last name

inHub

boolean, whether or not the driver is near the hub’s vicinity

lastTimeStamp

unix timestamp of driver’s last recorded action

latitude

driver’s latitude location

longitude

driver’s longitude location

mobileNumber

driver’s mobile number

status

ONLINE or OFFLINE

stores

collection/array of store ids this driver belongs to

Â