1

How to Set Measurement Unit of an Unit

(25/01/2017 17:42:06 отредактировано prabhu.janakiraman)

Тема: How to Set Measurement Unit of an Unit

Hi,

I am using wialon Remote API. I created one Account using the API to use the “Metric” measurement system. I added few units under that account through the API. Noticed those units are set to use “U.S” measurement system rather than Metric measurement system.

Do we need to explicitly set the measurement system for each unit while adding ?

If that is the case, we found below API method to set the measurement unit.

Trying to change the measurement Unit of one Unit from “US” to “Metric”. Itemid is the id of the unit.
svc:item/update_measure_units
params:{"itemId":XXXX,"type":0,"flags":"1"} 

while trying to use the above request, I am getting error code 7 which is for “Access Denied”. I am using Sid from a top level user who has all the access to Create Unit.

Any help would be appreciated.

Thanks
J Prabhu
2

How to Set Measurement Unit of an Unit

Re: How to Set Measurement Unit of an Unit

prabhu.janakiraman, do You use token to login? If so what access rights it have?

Head of Wialon Local Department
Gurtam
3

How to Set Measurement Unit of an Unit

Re: How to Set Measurement Unit of an Unit

Hi Deal,

Yes, we are using token based login.The corresponding user is having full access.

Thanks
J Prabhu
4

How to Set Measurement Unit of an Unit

Re: How to Set Measurement Unit of an Unit

What is access_type of token? User can have full access but if token is created with limited access_type - this request will not work.

Head of Wialon Local Department
Gurtam
5

How to Set Measurement Unit of an Unit

(26/01/2017 17:45:11 отредактировано prabhu.janakiraman)

Re: How to Set Measurement Unit of an Unit

Hi,

we are using below link and once prompted to login we are logging in using the credentials.

https://hosting.wialon.com/login.html?c … token.html

here access_type is set to -1.

we pick the token from the URL and use it further.

Thanks
J Prabhu
6

How to Set Measurement Unit of an Unit

Re: How to Set Measurement Unit of an Unit

prabhu.janakiraman, do You pass correct itemId?

Head of Wialon Local Department
Gurtam
7

How to Set Measurement Unit of an Unit

Re: How to Set Measurement Unit of an Unit

Hi Deal,

Yes we are passing correct itemid. we tried using the sid for the root level user and its working.

can you please tell which access level is required for any other user/token (which is having the option to create Unit), to be able to set the measurement unit as well.

Thanks
J Prabhu
8

How to Set Measurement Unit of an Unit

Re: How to Set Measurement Unit of an Unit

prabhu.janakiraman, there is limitation for items' metrics conversion - only top-users can do it.

Head of Wialon Local Department
Gurtam