Drivers operate

To operate drivers, use command resource/driver_operate:

To authorization you can use pairs of:

	"phoneNumber":<text>, /* driver phone number */
	"password":<text>     /* driver password */

or

	"phoneNumber":<text>, /* unit phone number */
	"password":<text>     /* unit password */

:!: For "callMode":"say","read" you can use "sid".
:!: Character '+' in phone number should be replaced by code %2B. :!: Driver must be binded to unit.

Send message to driver

:!: You can send files with multipart/form-data

Without "sid"

svc=resource/driver_operate&params={"phoneNumber":<text>,
				    "password":<text>,
				    "callMode":"say",
				    "message":<text>,
				    "timeSend":<uint>,
				    "ej":<JSON> /* extend JSON */,
				    "appId":<text>, /* application Id for push notification */
				    "appType":<text> /* application type for push notification */
				    }

With "sid"

svc=resource/driver_operate&params={"resourceId":<uint>,
				    "driverId":<uint>,
				    "callMode":"say",
				    "message":<text>,
				    "timeSend":<uint>,
				    "ej":<JSON> /* extend JSON */,
				    "appId":<text>, /* application Id for push notification */
				    "appType":<text> /* application type for push notification */
				    }

Response

{
	"tm":<uint>   /* time of message */ 
} 

Read messages from driver

Without "sid"

svc=resource/driver_operate&params={"phoneNumber":<text>,
				    "password":<text>,
				    "callMode":"read",
				    "timeFrom":<uint>,
				    "timeTo":<uint>
				    }

With "sid"

svc=resource/driver_operate&params={"resourceId":<uint>,
				    "driverId":<uint>,
				    "callMode":"read",
				    "timeFrom":<uint>,
				    "timeTo":<uint>
				    }

Response

[
	{
		"t": <time>,
		"f": <uint>,
		"tp": <text>,
		"p": {
			"flags": <uint>,
			"text":<text>,
			"time_send":<uint>,
			"ej":"<JSON>",
			"files": {
				<text>: <uint> /* filename: file ID */ 
			}
		}
	},
	...
]

:!: Parameters description you can find here: Messages

Get order list

svc=resource/driver_operate&params={"phoneNumber":<text>,
				    "password":<text>,
				    "callMode":"orders_list",
				    }

Response

[
	{
		"id":<​uint>,
		"n":<​text>,
		"f":<​uint>,
		"tf":<​uint>,
		"tt":<​uint>,
		"trt":<​uint>,
		"uid":<​uint>,
		"r":<​uint>,
		"y":<​double>,
		"x":<​double>,
		"u":<long>,
		"s":<​uint>,
		"sf":<​uint>,
		"st":<​uint>,
		"cnm":<​uint>,
		"p": {
			"ut":<​uint>,
		...
		}
	},
	...
]

:!: Parameters description you can find here: Update order

Reject order

:!: You can send files with multipart/form-data

svc=resource/driver_operate={"phoneNumber":<text>,
			     "password":<text>,
			     "callMode":"order_reject",
			     "id":<uint>
			     }

Response

{
	error: 0, /* if success */
}

Confirm order

:!: You can send files with multipart/form-data

svc=resource/driver_operate={"phoneNumber":<text>,
			     "password":<text>,
			     "callMode":"order_confirm",
			     "id":<uint>
			     }

Response

{
	error: 0, /* if success */
}

Mark message from driver

svc=resource/driver_operate={"phoneNumber":<text>,
			     "password":<text>,
			     "callMode":"mark_message",
			     "message":<text>,
			     "time":<uint>,
			     "flags":<uint>
			     }

Response

{
	error: 0, /* if success */
}

Get photo from driver message

svc=resource/driver_operate={"phoneNumber":<text>,
			     "password":<text>,
			     "callMode":"get_message_file",
			     "fileId":<text>
			     }

:!: fileId you can get using callMode:read

Response

Returns an image.

Get list of order attachments

svc=resource/driver_operate={"phoneNumber":<text>,
			     "password":<text>,
			     "callMode":"order_attachments",
			     "id":<text>                     /* order ID */
			     }

Response

[
  {
   "n":<text>,   /* file name */
   "s":<uint>,   /* file size */
   "ct":<uint>,  /* file creation time */
   "mt":<uint>   /* file modification time */
  }
]

Get order attachment

svc=resource/driver_operate={"phoneNumber":<text>,
			     "password":<text>,
			     "callMode":"order_get_attachment",
			     "id":<text>,                        /* order ID */
			     "path":<text>                       /* attachment file name */
			     }

Response

Returns an attachment file.
Follow us on Facebook Gurtam Wialon Twitter Gurtam Wialon info@gurtam.com   |   Copyright © 2002-2024 Gurtam