attach
To attach a file to an order, use order/attach:
svc=order/attach¶ms={"itemId":<long>,
"id":<long>,
"eventHash":"<text>"}
&sid="<text>"
Parameters
Name | Description |
---|---|
itemId | Resource ID. |
id | Order ID within the resource. |
eventHash | Event name. It will be generated |
To attach a file to an order, send a POST request. See the example below.
Request URL:https://hst-api.wialon.com/wialon/ajax.html?svc=order/attach
Request Method:POST
Content-Type:multipart/form-data; boundary=----WebKitFormBoundarya38SwBwyXw5BFPQ1
------WebKitFormBoundarya38SwBwyXw5BFPQ1
Content-Disposition: form-data; name="params"
{"itemId":39801,"id":3,"eventHash":"jUploadForm1435580226231"}
------WebKitFormBoundarya38SwBwyXw5BFPQ1
Content-Disposition: form-data; name="eventHash"
jUploadForm1435580226231
------WebKitFormBoundarya38SwBwyXw5BFPQ1
Content-Disposition: form-data; name="file_upload"; filename="attachment.txt"
Content-Type: application/octet-stream
------WebKitFormBoundarya38SwBwyXw5BFPQ1--
Response
{
"error":0
}
Error codes
Error code | Description |
---|---|
7 | Couldn't get the item with the provided itemId. |
5 | An error occurred while writing the file. |
4 | No file was provided or one of the files was empty. |