1

Copiar configuracion de unidad

Topic: Copiar configuracion de unidad

Deseo copiar la configuracion de una unidad a otras unidades por medio de la API, he visto que hay un metodo para exportar el archivo WLP exchange/export_json&params={"fileName":<text>, "json":{}}  y un metodo para importarlo  exchange/import_json&params={"eventHash":<text>}


Tengo dudas en cuanto como pasar el id de la unidad que deseo copiar y a la cual le quiero copiar la configuracion.


Alguna idea o ejemplo, uso la api con php


Saludos.

2

Copiar configuracion de unidad

Re: Copiar configuracion de unidad

I want to copy the configuration of a unit to other units by means of the API, I have seen that there is a method to export the WLP file exchange/export_json&params={"fileName":<text>, "json":{}}  and a method to import itexchange/import_json&params={"eventHash":<text>}

I have doubts as to how to pass the id of the unit that i want to copy the configuration.

I use the api with php

Anyone has used this method?

Thanks

3

Copiar configuracion de unidad

Re: Copiar configuracion de unidad

wcauichr, requests exchange/export_json and exchange/import_json can not export or import units' settings, they just implement file upload/download routine.
Method exchange/export_json is only for sending some json string (for example with unit setting) to server to get file with this json as result.
Method exchange/import_json is for reverse operation, it sends file with json to server to get json string from this file as result.
These requests can only be helpful for applications that doesn't have their own backend, which use just JS and Wialon API.
To create export file (wlp) (for example with unit's setting) you need to construct json string yourself by adding all essential parameters (name, unique id, hw type, etc) to json string according to format of wlp-file.
To create item from wlp-file you need to execute several requests which will set all parameters of item with values from wlp-file.
In your case you have php as backend and you don't need to use these two requests (exchange/export_json, exchange/import_json).
You can execute requests from php to create copy of item.
To get all item's parameters you can execute core/search_item request with max flags.
To find out all requests you need to execute to copy item just perform export of item to file in Wialon interface then import it and watch requests in developers console of browser (net tab).

Head of Wialon Local Department
Gurtam