API Integration for Fleet Owner¶
This tutorial will guide you through process of integrating with Dook delivery services.
Contents:
Loggin In¶
To make any operations using Dook RESTfull APIs, you need to be logged in. To log into Dook, you need to specify your user credentials in the POST request:
-
POST
URL/api/Auths/login
¶
Parameters
Parameter | Type | Value |
---|---|---|
{email} | string |
Your e-mail used at registration step |
{password} | string |
Your password used at registration step |
JSON Request Example¶
1 2 3 4 | {
"email":"email@example.com ",
"password":"password_example"
}
|
JSON Response Example¶
1 2 3 4 5 6 7 8 9 | {
"id": string,
"ttl": number,
"created": datastring,
"userId": string,
"language": string,
"role": string,
"companyId": string
}
|
Where
- {id} - your authorization token
- {ttl} - time-to-live
- {created} - date and time the session was created
- {userId} - user’s 24-digit hash
Creating Teams¶
To create a team and unite operators, drivers, or dispatchers into a team, use the following request:
-
POST
URL/Companies/<companyId>/teams?access_token=<your_access_token>
¶
NOTE: to create a team, you must be authorized. For info on getting your authorization token, refer to Loggin In.
Parameters
Parameter | Type | Value |
---|---|---|
{name} | string |
Name of the team |
{autoAssign} | boolean |
Specify true/false to enable or disable automatic assignin of orders for the team. |
{cityId} | string |
Specify id of the city in which the team resides. |
NOTE: to get the list of countries and cities, refer to Getting City and Country IDs.
JSON Request Example¶
1 2 3 4 5 | {
"name": "string",
"autoAssign": false,
"cityId": "string"
}
|
JSON Response Example¶
1 2 3 4 5 6 7 8 9 | {
"name": string,
"autoAssign": boolean,
"id": string,
"companyId": string,
"cityId": string,
"createdAt": datastring,
"updatedAt": datastring
}
|
Querying Team IDs¶
To get team IDs, use the following method:
-
POST
URL/api/Companies/<company_id>/teams
¶
NOTE: to get teams, you must be authorized. For info on getting your authorization token, refer to Loggin In.
Parameters
Parameter | Type | Value |
---|---|---|
{id} | string |
ID of the team |
JSON Response Example¶
1 2 3 4 5 6 7 8 9 | {
"name": "string 123",
"autoAssign": false,
"id": "5942b49642267d0f00bef7aa",
"companyId": "590397f11779a4dc53ef9258",
"cityId": "5905ca988b076b0f0084bd10",
"createdAt": "2017-06-15T16:23:50.627Z",
"updatedAt": "2017-06-15T16:23:50.628Z"
}
|
Removing Teams¶
To remove a team, use the following request:
-
DELETE
URL/api/Teams/<team_id>?access_token=<your_access_token>
¶
NOTE: to remove a team, you must be authorized. For info on getting your authorization token, refer to Loggin In.
JSON Response Example¶
1 2 3 | {
"count": N // N is the number of teams that have been removed
}
|
Creating Pickup Point for Team¶
To create a pickup point for your teams, use the following method:
-
POST
URL/api/PickUpPoints?access_token=<your_access_token>
¶
NOTE: to create an operator, you must be authorized. For info on getting your authorization token, refer to Loggin In.
Parameters
Parameter | Type | Value |
---|---|---|
{address} | string |
Address of the pickup point |
{gpsLocation} | object |
Delivery GPS coordinates
|
{title} | string |
Name of the pickup point |
{contactName} | string |
Name of the pickup point’s contact person |
{phone} | string |
Contact phone of the pickup point |
{teamId} | string |
Id of the team |
NOTE: to get team IDs, you must query the teams, for details refer to Querying Team IDs.
JSON Request Example¶
1 2 3 4 5 6 7 8 9 10 11 | {
"address": "string",
"gpsLocation": {
"lat": 0,
"lng": 0
},
"title": "string",
"contactName": "string",
"phone": "string",
"teamId": "string"
}
|
JSON Response Example¶
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 | {
"address": string,
"gpsLocation": {
"lat": 0,
"lng": 0
},
"title": string,
"contactName": string,
"phone": string,
"id": string,
"createdAt": string,
"updatedAt": string,
"companyId": string,
"teamId": string
}
|
Removing Pickup Points¶
To delete a pickup point,
-
DELETE
URL/api/PickUpPoints/<pickUpPointId>?access_token=<your_access_token>
¶
NOTE: to delete a pickup point, you must be authorized. For info on getting your authorization token, refer to Loggin In.
Parameters
Parameter | Type | Value |
---|---|---|
{id} | string |
ID of the pickup point |
JSON Request Example¶
1 2 3 | {
"id": "string"
}
|
JSON Response Example¶
1 2 3 | {
"count": number
}
|
Querying Team Members¶
This API enables you to get members of a particular team.
Getting All Team Members¶
To get all team members, use the following method:
-
POST
URL/api/Teams/<team_id>?access_token=<your_access_token>&filter={"include":[{"relation":"drivers"},{"relation":"operators"},{"relation":"dispatchers"},{"relation":"dispatchersPlatforms"}]}
¶
NOTE: to get team members, you must be authorized. For info on getting your authorization token, refer to Loggin In.
JSON Response Example¶
1 2 3 4 5 | {
...
LIST_OF_MEMBERS
...
}
|
Getting Operators of a Team¶
To get all operators of a team, use the following method:
-
POST
URL/api/Teams/<team_id>?access_token=<your_access_token>&filter={"include":[{"relation":"operators"}]}
¶
NOTE: to get team members, you must be authorized. For info on getting your authorization token, refer to Loggin In.
JSON Response Example¶
1 2 3 4 5 | {
...
LIST_OF_MEMBERS
...
}
|
Getting Drivers of a Team¶
To get all drivers of a team, use the following method:
-
POST
URL/api/Teams/<team_id>?access_token=<your_access_token>&filter={"include":[{"relation":"drivers"}]}
¶
NOTE: to get team members, you must be authorized. For info on getting your authorization token, refer to Loggin In.
JSON Response Example¶
1 2 3 4 5 | {
...
LIST_OF_MEMBERS
...
}
|
Getting Dispatchers of a Team¶
To get all dispatchers of a team, use the following method:
-
POST
URL/api/Teams/<team_id>?access_token=<your_access_token>&filter={"include":[{"relation":"dispatchers"}]}
¶
NOTE: to get team members, you must be authorized. For info on getting your authorization token, refer to Loggin In.
JSON Response Example¶
1 2 3 4 5 | {
...
LIST_OF_MEMBERS
...
}
|
Getting Dispatcher Platforms of a Team¶
To get all dispatcher platforms of a team, use the following method:
-
POST
URL/api/Teams/<team_id>?access_token=<your_access_token>&filter={"include":[{"relation":"dispatchersPlatforms"}]}
¶
NOTE: to get team members, you must be authorized. For info on getting your authorization token, refer to Loggin In.
JSON Response Example¶
1 2 3 4 5 | {
...
LIST_OF_MEMBERS
...
}
|
Creating Operators¶
To create an operator and immediatelly add them to a team, use the following API:
-
POST
URL/api/Teams/<teamId>/operators?access_token=<your_access_token>
¶
NOTE: to create an operator, you must be authorized. For info on getting your authorization token, refer to Loggin In.
Parameters
Parameter | Type | Value |
---|---|---|
{firstName} | string |
Operator’s first name |
{lastName} | string |
Operator’s last name |
{phone} | string |
Operator’s phone number |
{language} | string |
‘en’ or ‘ar’ for website language |
{email} | string |
Operator’s e-mail |
{password} | string |
Operator’s password |
{countryId} | string |
ID of the operator’s country |
{companyId} | string |
ID of the operator’s company |
{cityId} | string |
Id of the Operator’s city |
NOTE: to create an operator, you need to specify company ID. For info on getting your company ID, refer to Loggin In. To get the list of countries and cities, refer to Getting City and Country IDs.
JSON Request Example¶
1 2 3 4 5 6 7 8 9 10 11 12 | {
"firstName": "string",
"lastName": "string",
"name": "string",
"phone": "string",
"language": "string",
"email": "string",
"password":"string",
"countryId": "string",
"cityId": "string",
"companyId": "string"
}
|
Creating Drivers¶
To create a driver and immediatelly add them to a team, use the following API
-
POST
URL/api/Teams/<teamId>/drivers?access_token=<your_access_token>
¶
NOTE: to create a driver, you must be authorized. For info on getting your authorization token, refer to Loggin In.
Parameters
Parameter | Type | Value |
---|---|---|
{firstName} | string |
First name of the driver |
{lastName} | string |
Last name of the driver |
{phone} | string |
Driver’s phone number |
{vehicleType} | number |
1 for motorbike 2 for sedan 3 for suv 4 for pickup 5 for van |
{vehicleAttribute} | string |
“hot food” or “fridge”. |
{driverCommissionPercent} | number |
Driver’s commission for delivered orders 0.1 stands for 10% |
{email} | string |
Driver’s e-mail |
{password} | string |
Driver’s password |
{countryId} | string |
Driver’s country ID |
{cityId} | string |
Driver’s city ID |
{companyId} | string |
Driver’s company ID |
NOTE: to create a driver, you need to specify company ID. For info on getting your company ID, refer to Loggin In. To get the list of countries and cities, refer to Getting City and Country IDs.
JSON Request Example¶
1 2 3 4 5 6 7 8 9 10 11 12 13 14 | {
"firstName": "string",
"lastName": "string",
"name": "string",
"phone": "string",
"vehicleType": 2,
"vehicleAttribute": "string",
"driverCommissionPercent": 0,
"email": "string",
"password":"string",
"countryId": "string",
"cityId": "string",
"companyId": "string"
}
|
JSON Response Example¶
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 | {
"firstName": string,
"lastName": string,
"name": string,
"phone": string,
"valid": boolean,
"driverStatus": string,
"vehicleType": number,
"vehicleAttribute": string,
"driverCommissionPercent": number,
"avatar": string,
"userId": string,
"username": string,
"credentials": object,
"email": string,
"id": string,
"createdAt": datastring,
"updatedAt": datastring,
"companyId": string
}
|
Creating Dispatchers¶
To create a dispatchers and immediatelly add them to a team, use the following API
-
POST
URL/api/Teams/<teamId>/dispatchers?access_token=<your_access_token>
¶
NOTE: to create a dispatcher, you must be authorized. For info on getting your authorization token, refer to Loggin In.
Parameters
Parameter | Type | Value |
---|---|---|
{firstName} | string |
Dispatcher’s first name |
{lastName} | string |
Dispatcher’s last name |
{phone} | string |
Dispatcher’s phone |
{mobile} | string |
Dispatcher’s mobile phone |
{shopName} | string |
Dispatcher’s shop name |
{language} | string |
‘en’ or ‘ar’ for web interface |
{cbUrl} | string |
URL of the server to which dispatcher will be receiveing webhooks |
{cbHeaders} | object |
Headers for the webhooks |
{email} | string |
Dispatcher’s e-mail |
{password} | string |
Dispatcher’s password |
{countryId} | string |
ID of the Dispatcher’s country |
{cityId} | string |
ID of the Dispatcher’s city |
{companyId} | string |
ID of the Dispatcher’s company |
NOTE: to create a dispatcher, you need to specify company ID. For info on getting your company ID, refer to Loggin In. To get the list of countries and cities, refer to Getting City and Country IDs.
JSON Request Example¶
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 | {
"firstName": "string",
"lastName": "string",
"phone": "string",
"mobile": "string",
"shopName": "string",
"language": "ar",
"cbUrl": "string",
"cbHeaders": {},
"email": "string",
"password":"string",
"countryId": "string",
"cityId": "string",
"companyId": "string"
}
|
JSON Response Example¶
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 | {
"createdBy": string,
"currency": string,
"firstName": string,
"lastName": string,
"name": string,
"phone": string,
"mobile": string,
"valid": boolean,
"shopName": string,
"deliveryCommission": number,
"additionalPickupPointCost": number,
"expressDeliveryCommission": number,
"language": string,
"pickUpTimeWindow": number,
"cbUrl": string,
"cbHeaders": object,
"active": false,
"isAccepted": false,
"email": string,
"id": string,
"createdAt": datastring,
"updatedAt": datastring,
"countryId": string,
"cityId": string,
"companyId": string
}
|
Creating Dispatcher Platforms¶
To create a dispatcher platform and immediatelly add them to a team, use the following API
-
POST
URL/api/Teams/<teamId>/dispatcherPlatforms?access_token=<your_access_token>
¶
NOTE: to create a dispatcher, you must be authorized. For info on getting your authorization token and Company ID, refer to Loggin In.
Parameters
Parameter | Type | Value |
---|---|---|
{name} | string |
Platform Contact’s first name |
{phone} | string |
Platform Contact’s phone |
{deliveryCommission} | number |
Delivery commission for the platform’s orders |
{additionalPickupPointCost} | number |
Cost of additional pickup point for platform’s orders |
{expressDeliveryCommission} | number |
Cost of express delivery for the platform |
{cbUrl} | string |
(optional) URL of the server to which platform will be receiveing webhooks |
{cbHeaders} | object |
Headers for the webhooks |
{email} | string |
Dispatcher Platform’s e-mail |
{password} | string |
Dispatcher Platform’s password |
{countryId} | string |
ID of the Dispatcher Platform’s country |
{cityId} | string |
ID of the Dispatcher Platform’s city |
{companyId} | string |
ID of the Dispatcher Platform’s company |
{distanceBasedModifiers} | object |
Dispatcher Platform’s distance-based price modifiers:
|
JSON Request Example¶
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 | {
"name": "string",
"phone": "string",
"deliveryCommission": 0,
"additionalPickupPointCost": 0,
"expressDeliveryCommission": 0,
"country": "string",
"city": "string",
"cbUrl": "string",
"cbHeaders": {},
"distanceBasedModifiers": {
"pickupCost": 0,
"distanceCost": 0,
"timeCost": 0
},
"email": "string",
"companyId": "string"
}
|
JSON Response Example¶
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 | {
"name": "string",
"phone": "string",
"createdBy": {},
"deliveryCommission": 0,
"additionalPickupPointCost": 0,
"expressDeliveryCommission": 0,
"currency": "SAR",
"country": "string",
"city": "string",
"cbUrl": "string",
"cbHeaders": {},
"distanceBasedModifiers": {
"pickupCost": 0,
"distanceCost": 0,
"timeCost": 0
},
"avatar": "string",
"userId": "string",
"username": "string",
"credentials": {},
"email": "string",
"id": "string",
"createdAt": "2017-11-06T16:10:06.256Z",
"updatedAt": "2017-11-06T16:10:06.256Z",
"companyId": "string"
}
|
Querying Drivers¶
This APIs enable you to query drivers of your company or team.
Querying All Company Drivers¶
To query all drivers of a company:
-
GET
URL/api/Companies/<companyId>/drivers?access_token=<your_access_token>
¶
NOTE: to query drivers, you must be authorized. For info on getting your authorization token and Company ID, refer to Loggin In.
JSON Response Example¶
1 2 3 4 5 6 7 8 9 10 | [
{
...
1ST_DRIVER_PARAMETERS
},
{
...
NTH_DRIVER_PARAMETERS
}
]
|
Querying Drivers of a Team¶
To query all drivers of a team:
-
GET
URL/api/Teams/<teamId>/drivers?access_token=<your_access_token>
¶
NOTE: to query team’s drivers, you must be authorized. For info on getting your authorization token, refer to Loggin In.
JSON Response Example¶
1 2 3 4 5 6 7 8 9 10 | [
{
...
1ST_DRIVER_PARAMETERS
},
{
...
NTH_DRIVER_PARAMETERS
}
]
|
Querying Dispatchers¶
This APIs enable you to query dispatchers of your company or team.
Querying All Company Dispatchers¶
To query all dispatchers of a company:
-
GET
URL/api/Companies/<companyId>/dispatchers?access_token=<your_access_token>
¶
NOTE: to query dispatchers, you must be authorized. For info on getting your authorization token and Company ID, refer to Loggin In.
JSON Response Example¶
1 2 3 4 5 6 7 8 9 10 | [
{
...
1ST_DISPATCHER_PARAMETERS
},
{
...
NTH_DISPATCHER_PARAMETERS
}
]
|
Querying Dispatchers of a Team¶
To query all dispatchers of a team:
-
GET
URL/api/Teams/<teamId>/dispatchers?access_token=<your_access_token>
¶
NOTE: to query team’s dispatchers, you must be authorized. For info on getting your authorization token, refer to Loggin In.
JSON Response Example¶
1 2 3 4 5 6 7 8 9 10 | [
{
...
1ST_DISPATCHER_PARAMETERS
},
{
...
NTH_DISPATCHER_PARAMETERS
}
]
|
Querying Operators¶
This APIs enable you to query operators of your company or team.
Querying All Company Operators¶
To query all operators of a company:
-
GET
URL/api/Companies/<companyId>/operators?access_token=<your_access_token>
¶
NOTE: to query operators, you must be authorized. For info on getting your authorization token and Company ID, refer to Loggin In.
JSON Response Example¶
1 2 3 4 5 6 7 8 9 10 | [
{
...
1ST_OPERATOR_PARAMETERS
},
{
...
NTH_OPERATOR_PARAMETERS
}
]
|
Querying Operators of a Team¶
To query all operators of a team:
-
GET
URL/api/Teams/<teamId>/operators?access_token=<your_access_token>
¶
NOTE: to query team’s operators, you must be authorized. For info on getting your authorization token, refer to Loggin In.
JSON Response Example¶
1 2 3 4 5 6 7 8 9 10 | [
{
...
1ST_OPERATOR_PARAMETERS
},
{
...
NTH_OPERATOR_PARAMETERS
}
]
|
Querying Dispatcher Platforms¶
This APIs enable you to query dispatcher platforms of your company or team.
Querying All Company Dispatcher Platforms¶
To query all dispatcher platforms of a company:
-
GET
URL/api/Companies/<companyId>/dispatcherPlatforms?access_token=<your_access_token>
¶
NOTE: to query dispatcher platforms, you must be authorized. For info on getting your authorization token and Company ID, refer to Loggin In.
JSON Response Example¶
1 2 3 4 5 6 7 8 9 10 | [
{
...
1ST_DISPATCHER_PLATFORM_PARAMETERS
},
{
...
NTH_DISPATCHER_PLATFORM_PARAMETERS
}
]
|
Querying Dispatcher Platforms of a Team¶
To query all dispatcher platforms of a team:
-
GET
URL/api/Teams/<teamId>/dispatcherPlatforms?access_token=<your_access_token>
¶
NOTE: to query team’s dispatcher platforms, you must be authorized. For info on getting your authorization token, refer to Loggin In.
JSON Response Example¶
1 2 3 4 5 6 7 8 9 10 | [
{
...
1ST_DISPATCHER_PLATFORM_PARAMETERS
},
{
...
NTH_DISPATCHER_PALTFORM_PARAMETERS
}
]
|
Adding Drivers to Team¶
This API enables you to add drivers to a team.
-
PUT
URL/api/Teams/<team_id>/drivers/rel/<driver_id>?access_token=<your_access_token>
¶
NOTE: to add team members, you must be authorized. For info on getting your authorization token, refer to Loggin In.
JSON Response Example¶
1 2 3 4 5 | {
"id": "string",
"teamId": "string",
"driverId": "string"
}
|
Adding Dispatchers to Team¶
This API enables you to add dispatchers to a team.
-
PUT
URL/api/Teams/<team_id>/dispatchers/rel/<driver_id>?access_token=<your_access_token>
¶
NOTE: to add team members, you must be authorized. For info on getting your authorization token, refer to Loggin In.
JSON Response Example¶
1 2 3 4 5 | {
"id": "string",
"teamId": "string",
"driverId": "string"
}
|
Adding Operators to Team¶
This API enables you to add operators to a team.
-
PUT
URL/api/Teams/<team_id>/operators/rel/<driver_id>?access_token=<your_access_token>
¶
NOTE: to add team members, you must be authorized. For info on getting your authorization token, refer to Loggin In.
JSON Response Example¶
1 2 3 4 5 | {
"id": "string",
"teamId": "string",
"driverId": "string"
}
|
Adding Dispatcher Platforms to Team¶
This API enables you to add dispatcher platform to a team.
-
PUT
URL/api/Teams/<team_id>/dispatcherPlatforms/rel/<driver_id>?access_token=<your_access_token>
¶
NOTE: to add team members, you must be authorized. For info on getting your authorization token, refer to Loggin In.
JSON Response Example¶
1 2 3 4 5 | {
"id": "string",
"teamId": "string",
"driverId": "string"
}
|
Removing Drivers from Team¶
This API enables you to remove drivers from a team.
-
DELETE
URL/api/Teams/<team_id>/drivers/rel/<driver_id>?access_token=<your_access_token>
¶
NOTE: to remove team members, you must be authorized. For info on getting your authorization token, refer to Loggin In.
JSON Response Example¶
1 2 3 | {
"count": 1
}
|
Removing Dispatchers from Team¶
This API enables you to remove dispatchers from a team.
-
DELETE
URL/api/Teams/<team_id>/dispatchers/rel/<driver_id>?access_token=<your_access_token>
¶
NOTE: to remove team members, you must be authorized. For info on getting your authorization token, refer to Loggin In.
JSON Response Example¶
1 2 3 | {
"count": 1
}
|
Removing Operators from Team¶
This API enables you to remove operators from a team.
-
DELETE
URL/api/Teams/<team_id>/operators/rel/<driver_id>?access_token=<your_access_token>
¶
NOTE: to remove team members, you must be authorized. For info on getting your authorization token, refer to Loggin In.
JSON Response Example¶
1 2 3 | {
"count": 1
}
|
Removing Dispatcher Platforms from Team¶
This API enables you to remove dispatcher platforms from a team.
-
DELETE
URL/api/Teams/<team_id>/dispatcherPlatforms/rel/<driver_id>?access_token=<your_access_token>
¶
NOTE: to remove team members, you must be authorized. For info on getting your authorization token, refer to Loggin In.
JSON Response Example¶
1 2 3 | {
"count": 1
}
|
Editing Operators¶
To edit an operator, use the following method:
-
PUT
URL/api/Operators/<operator_id>?access_token=<your_access_token>
¶
NOTE: to edit an operator, you must be authorized. For info on getting your authorization token, refer to Loggin In.
Parameters
Parameter | Type | Value |
---|---|---|
{firstName} | string |
Operator’s first name |
{lastName} | string |
Operator’s last name |
{phone} | string |
Operator’s phone number |
{language} | string |
‘en’ or ‘ar’ for website language |
{email} | string |
Operator’s e-mail |
{password} | string |
Operator’s password |
{countryId} | string |
ID of the operator’s country |
{cityId} | string |
Id of the Operator’s city |
NOTE: to create an operator, you need to specify company ID. For info on getting your company ID, refer to Loggin In. To get the list of countries and cities, refer to Getting City and Country IDs.
JSON Request Example¶
1 2 3 4 5 6 7 8 9 10 11 | {
"firstName": "string",
"lastName": "string",
"name": "string",
"phone": "string",
"language": "string",
"email": "string",
"password":"string",
"countryId": "string",
"cityId": "string"
}
|
JSON Response Example¶
1 2 3 4 5 6 7 8 9 10 11 | {
"firstName": "string",
"lastName": "string",
"name": "string",
"phone": "string",
"language": "string",
"email": "string",
"password":"string",
"countryId": "string",
"cityId": "string"
}
|
Editing Drivers¶
To edit an driver, use the following method:
-
PUT
URL/api/Drivers/<operator_id>?access_token=<your_access_token>
¶
NOTE: to edit an driver, you must be authorized. For info on getting your authorization token, refer to Loggin In.
Parameters
Parameter | Type | Value |
---|---|---|
{firstName} | string |
Driver’s first name |
{lastName} | string |
Driver’s last name |
{phone} | string |
Driver’s phone number |
{language} | string |
‘en’ or ‘ar’ for website language |
{email} | string |
Driver’s e-mail |
{password} | string |
Driver’s password |
{countryId} | string |
ID of the driver’s country |
{cityId} | string |
Id of the driver’s city |
NOTE: to create an driver, you need to specify company ID. For info on getting your company ID, refer to Loggin In. To get the list of countries and cities, refer to Getting City and Country IDs.
JSON Request Example¶
1 2 3 4 5 6 7 8 9 10 11 | {
"firstName": "string",
"lastName": "string",
"name": "string",
"phone": "string",
"language": "string",
"email": "string",
"password":"string",
"countryId": "string",
"cityId": "string"
}
|
JSON Response Example¶
1 2 3 4 5 6 7 8 9 10 11 | {
"firstName": "string",
"lastName": "string",
"name": "string",
"phone": "string",
"language": "string",
"email": "string",
"password":"string",
"countryId": "string",
"cityId": "string"
}
|
Editing Dispatchers¶
To edit an dispatcher, use the following method:
-
PUT
URL/api/Dispatchers/<operator_id>?access_token=<your_access_token>
¶
NOTE: to edit an dispatcher, you must be authorized. For info on getting your authorization token, refer to Loggin In.
Parameters
Parameter | Type | Value |
---|---|---|
{firstName} | string |
Dispatcher’s first name |
{lastName} | string |
Dispatcher’s last name |
{phone} | string |
Dispatcher’s phone number |
{language} | string |
‘en’ or ‘ar’ for website language |
{email} | string |
Dispatcher’s e-mail |
{password} | string |
Dispatcher’s password |
{countryId} | string |
ID of the dispatcher’s country |
{cityId} | string |
Id of the dispatcher’s city |
NOTE: to create an dispatcher, you need to specify company ID. For info on getting your company ID, refer to Loggin In. To get the list of countries and cities, refer to Getting City and Country IDs.
JSON Request Example¶
1 2 3 4 5 6 7 8 9 10 11 | {
"firstName": "string",
"lastName": "string",
"name": "string",
"phone": "string",
"language": "string",
"email": "string",
"password":"string",
"countryId": "string",
"cityId": "string"
}
|
JSON Response Example¶
1 2 3 4 5 6 7 8 9 10 11 | {
"firstName": "string",
"lastName": "string",
"name": "string",
"phone": "string",
"language": "string",
"email": "string",
"password":"string",
"countryId": "string",
"cityId": "string"
}
|
Editing Dispatcher Platforms¶
To edit an dispatcher platform, use the following method:
-
PUT
URL/api/DispatcherPlatforms/<operator_id>?access_token=<your_access_token>
¶
NOTE: to edit an dispatcher platform, you must be authorized. For info on getting your authorization token, refer to Loggin In.
Parameters
Parameter | Type | Value |
---|---|---|
{firstName} | string |
Dispatcher platforms’s first name |
{lastName} | string |
Dispatcher platforms’s last name |
{phone} | string |
Dispatcher platforms’s phone number |
{language} | string |
‘en’ or ‘ar’ for website language |
{email} | string |
Dispatcher platforms’s e-mail |
{password} | string |
Dispatcher platforms’s password |
{countryId} | string |
ID of the dispatcher platforms’s country |
{cityId} | string |
Id of the dispatcher platforms’s city |
NOTE: to create an dispatcher platform, you need to specify company ID. For info on getting your company ID, refer to Loggin In. To get the list of countries and cities, refer to Getting City and Country IDs.
JSON Request Example¶
1 2 3 4 5 6 7 8 9 10 11 | {
"firstName": "string",
"lastName": "string",
"name": "string",
"phone": "string",
"language": "string",
"email": "string",
"password":"string",
"countryId": "string",
"cityId": "string"
}
|
JSON Response Example¶
1 2 3 4 5 6 7 8 9 10 11 | {
"firstName": "string",
"lastName": "string",
"name": "string",
"phone": "string",
"language": "string",
"email": "string",
"password":"string",
"countryId": "string",
"cityId": "string"
}
|
Removing Operators¶
To remove an operator, use the following method:
-
DELETE
URL/api/Operators/<operator_id>?access_token=<your_access_token>
¶
NOTE: to remove an operator, you must be authorized. For info on getting your authorization token, refer to Loggin In.
JSON Response Example¶
1 2 3 | {
"count": 1
}
|
Removing Drivers¶
To remove a driver, use the following method:
-
DELETE
URL/api/Drivers/<driver_id>?access_token=<your_access_token>
¶
NOTE: to remove a driver, you must be authorized. For info on getting your authorization token, refer to Loggin In.
JSON Response Example¶
1 2 3 | {
"count": 1
}
|
Removing Dispatchers¶
To remove a dispatcher, use the following method:
-
DELETE
URL/api/Dispatchers/<driver_id>?access_token=<your_access_token>
¶
NOTE: to remove a dispatcher, you must be authorized. For info on getting your authorization token, refer to Loggin In.
JSON Response Example¶
1 2 3 | {
"count": 1
}
|
Removing Dispatcher Platforms¶
To remove a dispatcher platform, use the following method:
-
DELETE
URL/api/DispatcherPlatforms/<driver_id>?access_token=<your_access_token>
¶
NOTE: to remove a dispatcher platform, you must be authorized. For info on getting your authorization token, refer to Loggin In.
JSON Response Example¶
1 2 3 | {
"count": 1
}
|
Creating Orders as FleetOwner¶
To create an order as Fleet Owner, use the following method:
-
POST
URL/api/FleetOwners/createOrder?access_token=<your_access_token>
¶
Order Details¶
Parameters
Parameter Order | Type | Value |
---|---|---|
{deliveryTime} | number |
(Optional) Delivery time in the following format: epochTime*1000 . |
{expectedPickUpTime} | object |
Time, when you want to order to be picked up time in form of an object:
|
{deliveryTime} | string |
(Optional) Delivery time in the following format: epochTime*1000 . |
{cashOnDelivery} | boolean |
(Optional) Set true if the recipient should pass cash to the driver.
NOTE: if order is express, you cannot send it to another city. |
{cashOnDeliveryAmount} | number |
|
{vehicleAttribute} | string |
(Optional) “hot food” or “fridge”. |
{vehicleType} | number |
(Optional) Type of the vehicle:
|
Item Details¶
Parameters
Parameter | Type | Value |
---|---|---|
{packingList} | string |
Specify an existing packing list name, or a new one |
{comment} | string |
(Optional) Add a comment. |
{pickupPointId} | string |
(Option 1) Id of an existing pick-up point |
{pickupPointId} | object |
(Option 2) Create new pickup point. Send object with the following info:
|
Recipient Details¶
Parameters
Parameter | Type | Value |
---|---|---|
{firstName} | string |
Receiver’s first name |
{mobile} | string |
Receiver’s phone number |
{deliveryPoint} | string |
Delivery address |
{gpsLocation} | object |
Delivery GPS coordinates
|
JSON Request Example¶
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 | {
"order": {
"deliveryTime": 1469112780000,
"expectedPickUpTime": {
"startTime": 1469088000000,
"endTime": 1469098800000
},
"cashOnDelivery": true,
"cashOnDeliveryAmount": 100
},
"items": [{
"packingList": "my_items",
"pickupPointId": "",
"gpsLocation": {
"lat": 0,
"lng": 0
},
"address":"someaddress",
"title":"sometitle",
"contactName":"Pablo",
"phone":"12345678"
}
}],
"recipient":{
"firstName": "Name",
"lastName": "Surname",
"mobile": "23456789",
"deliveryPoint": "9096 Al Amir Abdullah Ibn Jalawi Ibn Turki, Al Murabba, Riyadh 12631 2369, Saudi Arabia",
"gpsLocation": {
"lat": 2.651258939524155,
"lng": 46.705876886844635
}
}
}
|
JSON Response Example¶
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 | {
"result": {
"order": {
"deliveryTime": number,
"cashOnDeliveryAmount": number,
"orderStatus": sting,
"expectedPickUpTime": {
"startTime": number,
"endTime": number
},
"cashOnDelivery": true,
"deliveryCommission": number,
"createdBy": sting,
"express": boolean,
"oldCosts": array,
"vehicleType": number,
"isOutOfCity": boolean,
"id": sting,
"createdAt": datasting,
"updatedAt": datasting,
"recipientId": sting,
"dispatcherId": sting,
"createdByPlatformId": sting,
"orderCreatedTime": number
},
"items": [
{
"packingList": sting,
"itemStatus":sting,
"metadata": sting,
"id": sting,
"pickupPointId": sting,
"orderId": sting,
"createdAt": datasting,
"updatedAt": datasting
}
],
"recipient": {
"firstName": sting,
"lastName": sting,
"mobile": sting,
"deliveryPoint": sting,
"gpsLocation": {
"lat": number,
"lng": number
},
"id": sting,
"createdAt": datasting,
"updatedAt": datasting
}
}
}
|
Viewing Orders¶
This section provides information on viewing your created orders.
Viewing All Orders¶
To view all orders created in your company, use the following method:
-
GET
URL/api/Companies/<company_id>/orders
¶
You need to specify your id to find your orders.
Parameters
Parameter | Type | Value |
---|---|---|
{companyId} | string |
Your ID |
JSON Request Example¶
{
"dispatcherId":"57908cb0ca705a12009d62ea"
}
JSON Response Example¶
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 | [
{
"deliveryPoint": "Olaya St, As Sulimaniyah, Riyadh 12241, Saudi Arabia",
"orderStatus": "new",
"expectedPickUpTime": {
"startTime": 1469088000000,
"endTime": 1469098800000
},
"cashOnDelivery": true,
"cashOnDeliveryAmount": 100,
"deliveryComission": 45,
"id": "583add255449220f00ea99a8",
"createdAt": "2016-11-27T13:18:29.074Z",
"updatedAt": "2016-11-27T13:18:29.074Z",
"recipientId": "583add255449220f00ea99a7",
"dispatcherId": "583ada505449220f00ea99a5",
"orderCreatedTime": 1469091069499,
"vehicleType": 1
},
{
"deliveryPoint": "Olaya St, As Sulimaniyah, Riyadh 12241, Saudi Arabia",
"orderStatus": "new",
"expectedPickUpTime": {
"startTime": 1469088000000,
"endTime": 1469098800000
},
"cashOnDelivery": true,
"cashOnDeliveryAmount": 100,
"deliveryComission": 45,
"id": "583ae0015449220f00ea99ab",
"createdAt": "2016-11-27T13:30:41.860Z",
"updatedAt": "2016-11-27T13:30:41.860Z",
"recipientId": "583ae0015449220f00ea99aa",
"dispatcherId": "583ada505449220f00ea99a5",
"orderCreatedTime": 1469091069499,
"vehicleType": 1
}
]
|
Viewing a Specific Order¶
To view a specific order, use
-
GET
URL/api/Companies/<company_id>/orders/<order_id>
¶
You need to specify order id to find a particular order.
Parameters
Parameter | Type | Value |
---|---|---|
{id} | string |
Your user hash |
{fk} | string |
Foreign key - your order hash |
JSON Response Example¶
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 | {
"deliveryPoint": "Olaya St, As Sulimaniyah, Riyadh 12241, Saudi Arabia",
"orderStatus": "new",
"expectedPickUpTime": {
"startTime": 1469088000000,
"endTime": 1469098800000
},
"cashOnDelivery": true,
"cashOnDeliveryAmount": 100,
"deliveryComission": 45,
"id": "583add255449220f00ea99a8",
"createdAt": "2016-11-27T13:18:29.074Z",
"updatedAt": "2016-11-27T13:18:29.074Z",
"recipientId": "583add255449220f00ea99a7",
"dispatcherId": "583ada505449220f00ea99a5",
"orderCreatedTime": 1469091069499,
"vehicleType": 1
}
|
Cancelling Orders¶
To cancel an order, use the following method:
-
POST
URL/api/Orders/status/canceled?access_token=<your_access_token>
¶
NOTE: to cancel an order, you must be authorized. For info on getting your authorization token, refer to Loggin In.
Parameters
Parameter | Type | Value |
---|---|---|
{orderId} | string |
Id of the order that you want to cancel |
{dispatcherId} | string |
Id of the user who created the order |
Example¶
JSON Request Example¶
1 2 3 4 | {
orderId: '',
dispatcherId: ''
}
|
JSON Response Example¶
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 | {
"status": {
"order": {
"deliveryTime": number,
"deliveryPoint": string,
"orderStatus": string,
"expectedPickUpTime": {
"startTime": number,
"endTime": number
},
"cashOnDelivery": boolean,
"deliveryCommission": number,
"createdBy": {
"id": string,
"role": string,
"name": string,
"phone": string,
"companyName": string
},
"express": boolean,
"oldCosts": array,
"vehicleType": number,
"isOutOfCity": false,
"processedAt": number,
"id": string,
"createdAt": datestring,
"updatedAt": datestring,
"recipientId": string,
"fleetOwnerId": string,
"companyId": string,
"orderCreatedTime": number
}
}
}
|
Assigninig Orders on Driver¶
To assign order on a driver, use the following method:
-
POST
URL/api/FleetOwners/assignOrderToDriver?access_token=<your_access_token>
¶
NOTE: to assign an order on a driver, you must be authorized. For info on getting your authorization token, refer to Loggin In.
Parameters
Parameter | Type | Value |
---|---|---|
{ordersId} | array |
[] of orders that you want to assign |
{driverId} | string |
ID of the driver |
JSON Request Example¶
1 2 3 4 | {
ordersId: '',
driverId: ''
}
|
JSON Response Example¶
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 | {
"status": [
{
"deliveryTime": number,
"deliveryPoint": string,
"orderStatus": string,
"expectedPickUpTime": {
"startTime": number,
"endTime": number
},
"cashOnDelivery": boolean,
"deliveryCommission": number,
"createdBy": {
"id": string,
"role": string,
"name": string,
"phone": string,
"companyName": string
},
"express": boolean,
"oldCosts": array,
"vehicleType": number,
"isOutOfCity": boolean,
"id": string,
"createdAt": datestring,
"updatedAt": datestring,
"recipientId": string,
"driverId": string,
"fleetOwnerId": string,
"companyId": string,
"orderCreatedTime": number,
"driverReward": number,
"companyProceeds": number,
"assignedBy": {
"id": string,
"role": string,
"name": string,
"phone": string
}
}
]
}
|
Unassigning Orders¶
To unassign an order from a driver, use the following method:
-
POST
URL/api/Orders/makeNew?access_token=<your_access_token>
¶
NOTE: to unassign an order from a driver, you must be authorized. For info on getting your authorization token, refer to Loggin In.
Parameters
Parameter | Type | Value |
---|---|---|
{orderId} | string |
ID of the order |
JSON Request Example¶
1 2 3 | {
orderId: ''
}
|
JSON Response Example¶
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 | {
"status": {
"deliveryTime": number,
"deliveryPoint": string,
"orderStatus": string,
"expectedPickUpTime": {
"startTime": number,
"endTime": number
},
"cashOnDelivery": boolean,
"deliveryCommission": number,
"createdBy": {
"id": string,
"role": string,
"name": string,
"phone": string,
"companyName": string
},
"express": boolean,
"oldCosts": array,
"vehicleType": number,
"isOutOfCity": boolean,
"id": string,
"createdAt": datestring,
"updatedAt": datestring,
"recipientId": string,
"fleetOwnerId": string,
"companyId": string,
"orderCreatedTime": number,
"driverReward": number,
"companyProceeds": number,
"oldDriverId": string
}
}
|
Enabling Callbacks¶
This section describes how you can enable Dook to send status updates for your orders.
Dook servers send callbacks in form of JSON with the following structure:
1 2 3 4 5 6 7 8 | {
"payload":{
"action":"your_order_status",
"id":"your_order_id",
"dispatcherId":"your_dispatcher_id",
"updatedAt":"date_and_time"
}
}
|
To enable callbacks, you need to setup URL and headers.
-
PUT
URL/api/FleetOwners/<fleetOwnerId>?access_token=<your_access_token>
¶
NOTE: to edit callback parameters, you must be authorized. For info on getting your authorization token and fleetOwner ID, refer to Loggin In.
Parameters
Parameter | Type | Value |
---|---|---|
{fleetOwnerId} | string |
Your fleetOwner ID, which you can get in response to yout login reguest. For more infor on logging in, refer to Loggin In. |
{cbUrl} | string |
URL of the server that will be receiving callbacks. |
{cbHeaders} | object |
Object with key-value pairs of required headers. See example below. |
Order Status Values
Parameter | Type | Value |
---|---|---|
“new” | string |
After order is created it has the “new” status. |
“assigned” | string |
Order is assigned to driver, but driver hasn’t accepted it. |
“waitingForPickup” | string |
Driver accepted the order and will start collecting items soon. |
“partlyPickedUp” | string |
Driver has collected part of the items, but not all items of an order. |
“pickedUp” | string |
Driver has collected all items of an order. |
“onWayToDelivery” | string |
Driver started moving to delivery point. |
“waitingForReturn” | string |
Driver is returning the order to the pickup point. |
“returned” | string |
Driver has returned the order. |
“delivered” | string |
Driver has delivered the order. |
“cancelled” | string |
Order was cancelled by dispatcher. |
JSON Request Example¶
1 2 3 4 5 6 7 8 | {
"cbUrl": "http://some.url",
"cbHeaders": {
"User-Agent": "header_1",
"X-Api-Token": "some_hash",
"Content-Type": "application/json"
}
}
|
JSON Response Example¶
1 2 3 4 5 6 7 8 9 10 | {
"id": "fleetOwnerId",
"name": "Name",
"cbUrl": "http://some.url",
"cbHeaders": {
"User-Agent": "header_1",
"X-Api-Token": "some_hash",
"Content-Type": "application/json"
}
}
|
Getting City and Country IDs¶
In several RESful APIs you might need to specify city and country IDs.
Getting List of Countries¶
Before getting the list of cities, you need to get id of a country:
-
GET
URL/Countries/
¶
JSON Response Example¶
1 2 3 4 5 6 7 8 9 10 11 12 | [
{
"name": {
"en": "Saudi Arabia",
"ar": "المملكة العربية السعودية"
},
"currency": "SAR",
"iso": "3456789",
"id": "5905ca4f8b076b0f0084bd0f",
"createdAt": "2017-06-16T15:55:07.969Z"
}
]
|
Getting List of Cities of a Country¶
To get the list of cities,
-
GET
URL/Countries/<country_id>/cities
¶
JSON Response Example¶
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 | [
{
"name": {
"en": "Riyadh",
"ar": "مدينة الرياض"
},
"gpsLocation": {
"lat": 0,
"lng": 0
},
"iso": "34567890-",
"id": "5905ca988b076b0f0084bd10",
"countryId": "5905ca4f8b076b0f0084bd0f",
"createdAt": "2017-06-16T15:57:20.331Z"
},
{
"name": {
"en": "Jeddah",
"ar": "جدة"
},
"gpsLocation": {
"lat": 0,
"lng": 0
},
"id": "590616b86ef4a907509d384b",
"countryId": "5905ca4f8b076b0f0084bd0f",
"createdAt": "2017-06-16T15:57:20.331Z"
}
]
|
Get FleetOwner Bills¶
To get your billing history and bill statuses, use the following method:
-
GET
URL/api/FleetOwners/getBills?access_token=<your_access_token>
¶
NOTE: to get billing, you must be authorized. For info on getting your authorization token, refer to Loggin In.
JSON Response Example¶
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 | {
"startTime": datestring,
"endTime": datestring,
"cost": number,
"status": string,
"sunday": {
"delivered": {
"orders": array,
"count": number,
"sum": number
},
"returned": {
"orders": array,
"count": number,
"sum": number
},
"canceled": {
"orders": array,
"count": number,
"sum": number
}
},
"monday": {},/*All days have same structure*/
"tuesday": {},/*All days have same structure*/
"wednesday": {},/*All days have same structure*/
"thursday": {},/*All days have same structure*/
"friday": {},/*All days have same structure*/
"saturday": {},/*All days have same structure*/
"id": string,
"fleetOwnerId": string,
"returned": number,
"additionals": number,
"delivered": number,
"canceled": number
}
|
Using Driver Rating System¶
In Dook, you can create a multiple-start rating system for your drivers. Follow the guidelines below to establish and use your rating system.
Creating Rating Stars¶
You can create as many stars as you want. We recommend you having 5-star system. For each star you create, you need to specify its value.
To create a rating star, do the following:
-
POST
URL/api/FleetOwners/<your_fleetOwnerId>/stars?access_token=<your_access_token>
¶
NOTE: to assign an order on a driver, you must be authorized. For info on getting your authorization token, refer to Loggin In.
Parameters
Parameter | Type | Value |
---|---|---|
{count} | string |
Star level (1 star, 2 starts, and so on). |
JSON Request Example¶
1 2 3 | {
"count": 5
}
|
JSON Response Example¶
1 2 3 4 5 6 7 | {
"count": 5,
"id": "hash",
"ownerId": "<your_fleetOwnerId>",
"createdAt": "timestamp",
"updatedAt": "timestamp"
}
|
Where “id” is the created star ID.
Creating Messages for Stars¶
Each star can have one or more messages that you can show to customer in your application. Each message will be saved in the driver’s rating profile. To create a message, do the following:
-
POST
URL/api/Messages?access_token=<your_access_token>
¶
This will create a message, not bound to your star.
JSON Request Example¶
1 2 3 | {
"text":"excellent delivery"
}
|
JSON Response Example¶
1 2 3 4 5 6 | {
"text": "excellent delivery",
"id": "hash",
"createdAt": "timestamp",
"updatedAt": "timestamp"
}
|
Where “id” is the created message ID.
Binding Message to a Star¶
Now you need to bind a message to a star. You can bind the same message to as many stars as you want. To bind a message to a star, do the following:
-
PUT
URL/api/Messages/<messageId>/stars/rel/<starId>?access_token=<your_access_token>
¶
JSON Response Example¶
1 2 3 4 5 | {
"id": "relation_id",
"messageId": "messageId",
"starId": "starId"
}
|
Rate a Driver¶
When you finish creating the rating system, you can rate your drivers. To rate a driver, do the following:
-
POST
URL/api/Drivers/addNewReview?access_token=<your_access_token>
¶
Parameters
Parameter | Type | Value |
---|---|---|
{driverId} | string |
ID of the driver, whom you want to rate. |
{starId} | string |
ID of the star that you want to assign to driver. |
[messageId] | array |
Array of message IDs, that user selected to assign to driver. |
JSON Response Example¶
1 2 3 4 5 6 7 8 9 10 | {
"stars": 5,
"id": "string",
"driverId": "driverId",
"starId": "starId",
"messageId": ["messageId"]
"createdAt": "timestamp",
"updatedAt": "timestamp",
"message": "message text"
}
|
Check Driver Average Rating¶
You can check driver average rating. To check driver average rating, do the following:
-
GET
URL/api/Drivers/<driverId>?access_token=<your_access_token>
¶
Check the “rating” field in the response.
Check Driver Reviews¶
You can view all driver reviews. To check all driver reviews, do the following:
-
GET
URL/api/Drivers/<driverId>/ratings?access_token=<your_access_token>
¶
JSON Response Example¶
1 2 3 4 5 6 7 8 9 10 11 12 | [
{
"stars": 5,
"id": "reviewId",
"driverId": "driverId",
"starId": "starId",
"messageId": "messageId",
"createdAt": "timeStamp",
"updatedAt": "timeStamp",
"message": "message text"
}
]
|
Driver’s GPS Location¶
Dook provides an API for tracking driver’s GPS coordinated. You can either request latest position or subscribe to driver position change via HTTP streamUpdates.
Getting Driver’s Current GPS Position¶
To get driver’s GPS location:
-
GET
URL/api/Drivers/<driverId>/driverGpsLocations?access_token=<your_access_token>
¶
NOTE: to get dirver GPS location, you must be authorized. For info on getting your authorization token, refer to Loggin In.
JSON Response Example¶
1 2 3 4 5 6 7 8 9 10 11 12 13 | {
"gpsLocation": {
"lat": 24.83783869718715,
"lng": 46.81069021087905
},
"address": " Al Sahel Valley Ar Rimal 13254 Riyadh Riyadh Province",
"id": "57b2eab30f11320f0026e08d",
"driverId": "579dd296ca705a12009d630d",
"createdAt": "2016-08-16T10:28:03.264Z",
"updatedAt": "2016-12-01T19:00:55.630Z",
"lat": 24.83783869718715,
"lng": 46.81069021087905
}
|
Subscribing to Driver GPS Location Changes¶
You can subscribe to drivers’ GPS locations’ change via HTTP GET streamUpdate request:
For one driver:
-
GET
URL/api/DriverGpsLocations/streamUpdates?driversIds=<driver_id>&access_token=<your_access_token>
¶
For several drivers:
-
GET
URL/api/DriverGpsLocations/streamUpdates?driversIds=["<driver_id>","<driver_id>", ...]&access_token=<your_access_token>
¶