Good day!
Upcoming update will include the new API request
1.
Library unit types -
svc=file/type_library¶ms={"lang":"text"}
Parameter "lang" is optional. By default the langues from user session.
Response returns JSON with the full list of unit's types
2.
Add new field "vehicle_class" (param 'n') into request item/update_profile_field. (The old field "vehicle_type" which created early is used)
The value (param "v") takes names as the last level from Library unit types
Example
svc=item/update_profile_field¶ms={"itemId":4958071,"n":"vehicle_class","v":"empty_compressor"}
Response
[
2,
{
"id": 2,
"n": "vehicle_class",
"v": "empty_compressor"
}
]
If the not correct value 'v', the response returns the error with description
Example
{
"error": 4,
"reason": "Invalid vehicle_class value"
}
3.
Also it's possible to apply value for "vehicle_class" into request svc=core/search_items to search units/
For example, to get units with vehicle class 'van'
"propName":"profilefield"
"propValueMask":"van"
hst-api.wialon.com/wialon/ajax.html?svc=core/search_items¶ms={"spec":{"itemsType":"avl_unit","propName":"profilefield","propValueMask":"van","sortType":"sys_name","propType":"profilefield"},"force":1,"flags":8388609,"from":0,"to":200}}],"flags":0}&sid=02673bc10dcf516e0d6647acf35331ce
Diana Cheley
Wialon Hosting Expert
Gurtam