attach

To attach a file to an order, use order/attach:

Copied!
svc=order/attach&params={"itemId":<long>,
			 "id":<long>,
			 "eventHash":"<text>"}
          &sid="<text>"

Parameters

NameDescription

itemId

Resource ID.

id

Order ID within the resource.

eventHash

Event name. It will be generated
after processing the data.

To attach a file to an order, send a POST request. See the example below.

Copied!
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

Copied!
{
	"error":0
}

Error codes

Error codeDescription
7Couldn't get the item with the provided itemId.
5An error occurred while writing the file. 
4No file was provided or one of the files was empty.
Download PDF file
Download Word document

See also