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".
Driver must be binded to unit.
You can send files with multipart/form-data
svc=resource/driver_operate¶ms={"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 */ }
svc=resource/driver_operate¶ms={"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 */ }
{ "tm":<uint> /* time of message */ }
svc=resource/driver_operate¶ms={"phoneNumber":<text>, "password":<text>, "callMode":"read", "timeFrom":<uint>, "timeTo":<uint> }
svc=resource/driver_operate¶ms={"resourceId":<uint>, "driverId":<uint>, "callMode":"read", "timeFrom":<uint>, "timeTo":<uint> }
[ { "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
svc=resource/driver_operate¶ms={"phoneNumber":<text>, "password":<text>, "callMode":"orders_list", }
[ { "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
You can send files with multipart/form-data
svc=resource/driver_operate={"phoneNumber":<text>, "password":<text>, "callMode":"order_reject", "id":<uint> }
{ error: 0, /* if success */ }
You can send files with multipart/form-data
svc=resource/driver_operate={"phoneNumber":<text>, "password":<text>, "callMode":"order_confirm", "id":<uint> }
{ error: 0, /* if success */ }
svc=resource/driver_operate={"phoneNumber":<text>, "password":<text>, "callMode":"mark_message", "message":<text>, "time":<uint>, "flags":<uint> }
{ error: 0, /* if success */ }
svc=resource/driver_operate={"phoneNumber":<text>, "password":<text>, "callMode":"get_message_file", "fileId":<text> }
fileId you can get using callMode:read
Returns an image.
svc=resource/driver_operate={"phoneNumber":<text>, "password":<text>, "callMode":"order_attachments", "id":<text> /* order ID */ }
[ { "n":<text>, /* file name */ "s":<uint>, /* file size */ "ct":<uint>, /* file creation time */ "mt":<uint> /* file modification time */ } ]
svc=resource/driver_operate={"phoneNumber":<text>, "password":<text>, "callMode":"order_get_attachment", "id":<text>, /* order ID */ "path":<text> /* attachment file name */ }
Returns an attachment file.
|