To read POIs from a file, use the command exchange/import_pois_read:
svc=exchange/import_pois_read¶ms={"eventHash":<text>}
Current request can't be executed simultaneously with any request from this chapter and following requests:
Name | Description |
---|---|
eventHash | event name, which will be generated after reading POIs (optional parameter) |
To upload a file containing POIs, use a POST request with multiple contents (multipart/form-data).
For example:
Request URL: https://hst-api.wialon.com/wialon/ajax.html?svc=exchange/import_pois_read&sid=8157df114c0e601f0f31091c3c2ac53d Request Method: POST Host: hst-api.wialon.com Connection: keep-alive Content-Length: 259225 Cache-Control: no-cache Content-Type: multipart/form-data; boundary=----WebKitFormBoundaryQxgt5OMIt056unES Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8 Accept-Charset: windows-1251,utf-8;q=0.7,*;q=0.3 Accept-Encoding: gzip,deflate,sdch Accept-Language: ru,en-US;q=0.8,en;q=0.6 ------WebKitFormBoundaryQxgt5OMIt056unES Content-Disposition: form-data; name="params" {"eventHash":"jUploadForm1372769949359"} ------WebKitFormBoundaryQxgt5OMIt056unES Content-Disposition: form-data; name="eventHash" jUploadForm1372769949359 ------WebKitFormBoundaryQxgt5OMIt056unES Content-Disposition: form-data; name="import_file"; filename="poi.kml" Content-Type: application/vnd.google-earth.kml+xml ------WebKitFormBoundaryQxgt5OMIt056unES--
{} /* empty object if execution successful, if not - error code */
To be sure that POIs has been read, you can execute the command Events:
{ "tm":<uint>, /* current server time (UTC) */ "events":[ { "i":-1, "d":{ /* data */ "hash":<text>, /* upload is complete */ "pois":[<Object>] /* array of POIs read */ } } ] }