This is an old revision of the document!

Geofences: Image

To upload an image for a Geofence or set an image of other Geofence, use the command resource/upload_zone_image:


:!: To delete an image, use the command Geofences: create, edit, delete.
:!: To get an image, use Geofence image.


Name Description
itemId resource ID
id geofence ID
eventHash event name, which will be generated after uploading the image (optional parameter)

To upload an image, use a POST request with multiple contents (multipart/form-data), where one part contains parameters and the other contains the image.

For example:

Request URL:
Request Method: POST
Connection: keep-alive
Content-Length: 31753
Cache-Control: no-cache
Content-Type: multipart/form-data; boundary=----WebKitFormBoundaryX2W1y7AVnQkXQAM0
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

Content-Disposition: form-data; name="params"

Content-Disposition: form-data; name="eventHash"

Content-Disposition: form-data; name="zone_create_upload_image"; filename="zZeVUgLEJXE.jpg"
Content-Type: image/jpeg



{}	/* empty object if execution successful, if not - error code */

To be sure that the image has been uploaded, you can execute the command Events:

	"tm":<uint>,				/* current server time (UTC) */
			"i":<long>,			/* пeofence ID (-1 if unknown) */
			"d":{				/* data */
				"hash":<text>		/* upload is complete */
Follow us on Facebook Gurtam Wialon Twitter Gurtam Wialon   |   Copyright © 2002-2020 Gurtam