1

(4 replies, posted in Custom SDK development)

Deal,

Thanks for the clarification, suppose I want to know which user deleted one specific unit from system.

How can I achieve this ? Our system has thousands of user and I can't iterate every user for historical period of timeframe and search whether he deleted any unit or not.

How to quickly find user who deleted a unit with out writing a custom logic app to do it.

Thanks
Karthik

Is there a way to export all customer Geo-fences along with the Geo-fence Group Mapping ?

While importing it has to create both Geo-fences and Geo-fence Groups along with the respective mapping info.

Thanks

Thanks Rual

I already tried Uri.EscapeDataString - Same issue persists

FormUrlEncodedContent - We initially used  FormUrlEncodedContent and it was working fine but it has no of character limitations, due to that most of my calls were failed earlier and we changed to StringContent and now caught with & issue

I mean we spent the whole day yesterday with all combinations of different encoding like UTF8, ASCII, FormUrlEncode etc and nothing is working with StringContent.

Is it a a limitation of Wialon API not properly handling & when using StringContent in C# ??? pretty concerning issue this is for us.

Will appreciate any help on this regard.

4

(4 replies, posted in Custom SDK development)

Thanks Deal, You are awesome smile

5

(4 replies, posted in Custom SDK development)

Thanks Deal

If I get a sid via LoginAs(token,"enduser"), all the api limitations ties to the tokenuser or the enduser on which I am loginas ?

I am searching the following doubts from wialon documentation and unable to find it

1. In a batch command - how many api commands I can batch MAX ?

2. In a batch command - what order the api's will execute ? one by one synchronous ? Or random order asynchronous ?

3. In a batch command - Is it possible to pass first API result value to 2nd api request - if it is synchronously called from top to bottom manner ?

Thanks in advance
Karthik

I am hitting the batch command using C# HttpClient class and keep on getting error code 4 but absolutely the below format is fine.

I am also encoding and sending the payload like below

var content = new StringContent(HttpUtility.UrlEncode(mainParam), Encoding.UTF8, "application/x-www-form-urlencoded");

mainParam is shown below, can you tell me how to fix this issue please ?

svc=core/batch&params={"params":[{"svc":"unit/update_device_type","params":{"itemId":16141282,"deviceTypeId":14806641,"uniqueId":"352094082333714","dataFlags":1}},{"svc":"unit/update_unique_id2","params":{"itemId":16141282,"uniqueId2":""}},{"svc":"unit/update_phone","params":{"itemId":16141282,"phoneNumber":""}},{"svc":"unit/update_phone","params":{"itemId":16141282,"phoneNumber":""}},{"svc":"unit/update_access_password","params":{"itemId":16141282,"accessPassword":""}},{"svc":"unit/update_mileage_counter","params":{"itemId":16141282,"newValue":0}},{"svc":"unit/update_eh_counter","params":{"itemId":16141282,"newValue":0}},{"svc":"unit/update_calc_flags","params":{"itemId":16141282,"newValue":1809}},{"svc":"unit/update_traffic_counter","params":{"itemId":16141282,"newValue":0,"regReset":0}},{"svc":"unit/update_image","params":{"itemId":16141282,"libId":0,"path":"/library/unit/default.png"}},{"svc":"item/update_custom_field","params":{"itemId":16141282,"callMode":"create","id":0,"n":"Chassis Number","v":""}},{"svc":"item/update_custom_field","params":{"itemId":16141282,"callMode":"create","id":0,"n":"Fuel Id","v":""}},{"svc":"item/update_custom_field","params":{"itemId":16141282,"callMode":"create","id":0,"n":"Install Date","v":"8/22/2017"}},{"svc":"item/update_custom_field","params":{"itemId":16141282,"callMode":"create","id":0,"n":"Install Technician Name","v":""}},{"svc":"item/update_custom_field","params":{"itemId":16141282,"callMode":"create","id":0,"n":"License Country","v":""}},{"svc":"item/update_custom_field","params":{"itemId":16141282,"callMode":"create","id":0,"n":"License Expiration Date","v":""}},{"svc":"item/update_custom_field","params":{"itemId":16141282,"callMode":"create","id":0,"n":"License State","v":"  "}},{"svc":"item/update_admin_field","params":{"itemId":16141282,"callMode":"create","id":0,"n":"Device Type","v":"LT500"}},{"svc":"item/update_profile_field","params":{"itemId":16141282,"n":"brand","v":"TOYOTA"}},{"svc":"item/update_profile_field","params":{"itemId":16141282,"n":"model","v":"COROLLA"}},{"svc":"item/update_profile_field","params":{"itemId":16141282,"n":"year","v":""}},{"svc":"unit/update_sensor","params":{"id":1,"n":"Driver Binding","t":"driver","d":"","m":"","p":"drvr_code_r","f":0,"c":"{\"act\":1,\"appear_in_popup\":true,\"ci\":{},\"cm\":0,\"mu\":0,\"pos\":17,\"show_time\":false,\"timeout\":0,\"uct\":0,\"unbound_code\":\"\",\"validate_driver_unbound\":0}","vt":0,"vs":0,"tbl":[],"itemId":16141282,"callMode":"create"}},{"svc":"unit/update_sensor","params":{"id":2,"n":"Operating Time","t":"custom","d":"","m":"hrs","p":"none","f":0,"c":"{\"act\":1,\"appear_in_popup\":false,\"ci\":{},\"cm\":0,\"mu\":0,\"pos\":5,\"show_time\":false,\"text_params\":0,\"timeout\":0,\"uct\":0}","vt":0,"vs":0,"tbl":[],"itemId":16141282,"callMode":"create"}},{"svc":"unit/update_sensor","params":{"id":3,"n":"Odometer","t":"mileage","d":"","m":"km","p":"io16_const/1000","f":0,"c":"{\"act\":1,\"appear_in_popup\":false,\"ci\":{},\"cm\":0,\"mu\":0,\"pos\":4,\"show_time\":false,\"timeout\":0,\"uct\":0}","vt":0,"vs":0,"tbl":[],"itemId":16141282,"callMode":"create"}},{"svc":"unit/update_sensor","params":{"id":4,"n":"Power","t":"voltage","d":"","m":"V","p":"pwr_ext","f":0,"c":"{\"act\":1,\"appear_in_popup\":true,\"ci\":{},\"cm\":0,\"mu\":1,\"pos\":1,\"show_time\":false,\"timeout\":0,\"uct\":0}","vt":0,"vs":0,"tbl":[],"itemId":16141282,"callMode":"create"}},{"svc":"unit/update_sensor","params":{"id":5,"n":"Moving Time","t":"custom","d":"","m":"hrs","p":"none","f":0,"c":"{\"act\":1,\"appear_in_popup\":false,\"ci\":{},\"cm\":0,\"mu\":0,\"pos\":6,\"show_time\":false,\"text_params\":0,\"timeout\":0,\"uct\":0}","vt":0,"vs":0,"tbl":[],"itemId":16141282,"callMode":"create"}},{"svc":"unit/update_sensor","params":{"id":6,"n":"Digital IP2","t":"digital","d":"","m":"","p":"io_3","f":0,"c":"{\"act\":1,\"appear_in_popup\":true,\"ci\":{\"0\":{\"c\":0,\"t\":\"Low\"},\"1\":{\"c\":0,\"t\":\"High\"}},\"cm\":1,\"mu\":1,\"pos\":11,\"show_time\":false,\"timeout\":0,\"uct\":0}","vt":0,"vs":0,"tbl":[],"itemId":16141282,"callMode":"create"}},{"svc":"unit/update_sensor","params":{"id":7,"n":"Digital IP1","t":"digital","d":"","m":"","p":"io_2","f":0,"c":"{\"act\":1,\"appear_in_popup\":true,\"ci\":{\"0\":{\"c\":0,\"t\":\"Low\"},\"1\":{\"c\":0,\"t\":\"High\"}},\"cm\":1,\"mu\":1,\"pos\":10,\"show_time\":false,\"timeout\":0,\"uct\":0}","vt":0,"vs":0,"tbl":[],"itemId":16141282,"callMode":"create"}},{"svc":"unit/update_sensor","params":{"id":8,"n":"Program Ver","t":"custom","d":"","m":"","p":"none","f":0,"c":"{\"act\":1,\"appear_in_popup\":false,\"ci\":{\"12800\":{\"c\":0,\"t\":\"50.0\"},\"12801\":{\"c\":0,\"t\":\"50.1\"},\"12803\":{\"c\":0,\"t\":\"50.3\"},\"12805\":{\"c\":0,\"t\":\"50.5\"},\"12806\":{\"c\":0,\"t\":\"50.6\"},\"12810\":{\"c\":0,\"t\":\"50.10\"},\"12812\":{\"c\":0,\"t\":\"50.12\"},\"12813\":{\"c\":0,\"t\":\"50.13\"},\"13056\":{\"c\":0,\"t\":\"51.0\"},\"13057\":{\"c\":0,\"t\":\"51.1\"},\"13059\":{\"c\":0,\"t\":\"51.3\"},\"13063\":{\"c\":0,\"t\":\"51.7\"},\"13064\":{\"c\":0,\"t\":\"51.8\"},\"13065\":{\"c\":0,\"t\":\"51.9\"},\"13067\":{\"c\":0,\"t\":\"51.11\"}},\"cm\":1,\"mu\":0,\"pos\":12,\"show_time\":false,\"text_params\":0,\"timeout\":0,\"uct\":0}","vt":0,"vs":0,"tbl":[],"itemId":16141282,"callMode":"create"}},{"svc":"unit/update_sensor","params":{"id":9,"n":"Speed Max","t":"custom","d":"","m":"km/h","p":"io_24","f":0,"c":"{\"act\":1,\"appear_in_popup\":false,\"ci\":{},\"cm\":0,\"mu\":0,\"pos\":9,\"show_time\":false,\"text_params\":0,\"timeout\":0,\"uct\":0}","vt":0,"vs":0,"tbl":[],"itemId":16141282,"callMode":"create"}},{"svc":"unit/update_sensor","params":{"id":10,"n":"Network ID & Channel","t":"custom","d":"","m":"","p":"io_205","f":0,"c":"{\"act\":1,\"appear_in_popup\":true,\"ci\":{},\"cm\":0,\"mu\":0,\"pos\":16,\"show_time\":false,\"text_params\":0,\"timeout\":0,\"uct\":0}","vt":0,"vs":0,"tbl":[],"itemId":16141282,"callMode":"create"}},{"svc":"unit/update_sensor","params":{"id":11,"n":"Location Area Code","t":"custom","d":"","m":"","p":"io_206","f":0,"c":"{\"act\":1,\"appear_in_popup\":true,\"ci\":{},\"cm\":0,\"mu\":0,\"pos\":15,\"show_time\":false,\"text_params\":0,\"timeout\":0,\"uct\":0}","vt":0,"vs":0,"tbl":[],"itemId":16141282,"callMode":"create"}},{"svc":"unit/update_sensor","params":{"id":12,"n":"Carrier ID","t":"custom","d":"","m":"","p":"io_241","f":0,"c":"{\"act\":1,\"appear_in_popup\":true,\"ci\":{},\"cm\":0,\"mu\":0,\"pos\":14,\"show_time\":false,\"text_params\":0,\"timeout\":0,\"uct\":0}","vt":0,"vs":0,"tbl":[],"itemId":16141282,"callMode":"create"}},{"svc":"unit/update_sensor","params":{"id":13,"n":"Internal Battery","t":"voltage","d":"","m":"V","p":"pwr_int","f":0,"c":"{\"act\":1,\"appear_in_popup\":true,\"ci\":{},\"cm\":0,\"mu\":1,\"pos\":8,\"show_time\":false,\"timeout\":0,\"uct\":0}","vt":0,"vs":0,"tbl":[],"itemId":16141282,"callMode":"create"}},{"svc":"unit/update_sensor","params":{"id":14,"n":"Ignition","t":"engine operation","d":"","m":"","p":"io_239","f":0,"c":"{\"act\":1,\"appear_in_popup\":true,\"ci\":{\"0\":{\"c\":0,\"t\":\"Off\"},\"1\":{\"c\":0,\"t\":\"On\"}},\"cm\":1,\"consumption\":2,\"mu\":1,\"pos\":2,\"show_time\":false,\"timeout\":0,\"uct\":0}","vt":0,"vs":0,"tbl":[],"itemId":16141282,"callMode":"create"}},{"svc":"unit/update_sensor","params":{"id":15,"n":"Device Type","t":"custom","d":"","m":"","p":"none","f":0,"c":"{\"act\":1,\"appear_in_popup\":false,\"ci\":{\"12800\":{\"c\":0,\"t\":\"LT-1100-GP_Script_50.0_NoIP_NoAPN\"},\"12801\":{\"c\":0,\"t\":\"LT-1100-GP_Script_50.1_FL_Kore\"},\"12803\":{\"c\":0,\"t\":\"LT-1100-GP_Script_50.3_DG_Digicel\"},\"12805\":{\"c\":0,\"t\":\"LT-1100-GP_Script_50.5_DG_DigicelTT\"},\"12806\":{\"c\":0,\"t\":\"LT-1100-GP_Script_50.6_FL_AerisGlobal\"},\"12810\":{\"c\":0,\"t\":\"LT-1100-GP_Script_50.10_DG_DigicelAnguilla\"},\"12812\":{\"c\":0,\"t\":\"LT-1100-GP_Script_50.12_DG_Atrams\"},\"12813\":{\"c\":0,\"t\":\"LT-1100-GP_Script_50.13_DG_Giscad\"},\"13056\":{\"c\":0,\"t\":\"LT-1100-UM_Script_51.0_NoIP_NoAPN\"},\"13057\":{\"c\":0,\"t\":\"LT-1100-UM_Script_51.1_FL_Kore\"},\"13059\":{\"c\":0,\"t\":\"LT-1100-UM_Script_51.3_DG_Digicel\"},\"13063\":{\"c\":0,\"t\":\"LT-1100-UM_Script_51.7_FL_Altaworx\"},\"13064\":{\"c\":0,\"t\":\"LT-1100-UM_Script_51.8_DG_DigicelBVI\"},\"13065\":{\"c\":0,\"t\":\"LT-1100-UM_Script_51.9_DG_DigicelCayman\"},\"13067\":{\"c\":0,\"t\":\"LT-1100-UM_Script_51.11_FL_AerisDualMode\"}},\"cm\":1,\"mu\":0,\"pos\":13,\"show_time\":false,\"text_params\":1,\"timeout\":0,\"uct\":0}","vt":0,"vs":0,"tbl":[],"itemId":16141282,"callMode":"create"}},{"svc":"unit/update_sensor","params":{"id":16,"n":"Event","t":"custom","d":"","m":"","p":"event_code","f":0,"c":"{\"act\":1,\"appear_in_popup\":false,\"ci\":{\"1\":{\"c\":0,\"t\":\"Moving\"},\"10\":{\"c\":0,\"t\":\"On Backup Battery\"},\"11\":{\"c\":0,\"t\":\"Low Power Begin\"},\"12\":{\"c\":0,\"t\":\"Low Power End\"},\"13\":{\"c\":0,\"t\":\"Power On\"},\"14\":{\"c\":0,\"t\":\"Input2 On\"},\"15\":{\"c\":0,\"t\":\"Input2 Off\"},\"16\":{\"c\":0,\"t\":\"Idling\"},\"17\":{\"c\":0,\"t\":\"On Demand\"},\"18\":{\"c\":0,\"t\":\"N\\/A\"},\"2\":{\"c\":0,\"t\":\"Parked\"},\"3\":{\"c\":0,\"t\":\"Ignition On\"},\"4\":{\"c\":0,\"t\":\"Ignition Off\"},\"5\":{\"c\":0,\"t\":\"Start\"},\"6\":{\"c\":0,\"t\":\"Stop\"},\"7\":{\"c\":0,\"t\":\"Input1 On\"},\"8\":{\"c\":0,\"t\":\"Input1 Off\"},\"9\":{\"c\":0,\"t\":\"Emergency\"}},\"cm\":1,\"mu\":0,\"pos\":3,\"show_time\":false,\"text_params\":1,\"timeout\":0,\"uct\":0}","vt":0,"vs":0,"tbl":[],"itemId":16141282,"callMode":"create"}},{"svc":"unit/update_sensor","params":{"id":17,"n":"Cell RSSI","t":"custom","d":"","m":"db","p":"rssi","f":0,"c":"{\"act\":1,\"appear_in_popup\":false,\"ci\":{},\"cm\":0,\"mu\":0,\"pos\":18,\"show_time\":false,\"text_params\":0,\"timeout\":0,\"uct\":0}","vt":0,"vs":0,"tbl":[],"itemId":16141282,"callMode":"create"}},{"svc":"unit/update_sensor","params":{"id":18,"n":"GPS Signal","t":"custom","d":"","m":"","p":"sats","f":0,"c":"{\"act\":1,\"appear_in_popup\":true,\"ci\":{\"10\":{\"c\":0,\"t\":\"Excellent\"},\"2\":{\"c\":0,\"t\":\"No Signal\"},\"4\":{\"c\":0,\"t\":\"Very Poor\"},\"6\":{\"c\":0,\"t\":\"Poor\"},\"7\":{\"c\":0,\"t\":\"Average\"},\"8\":{\"c\":0,\"t\":\"Good\"},\"9\":{\"c\":0,\"t\":\"Very Good\"}},\"cm\":1,\"mu\":0,\"pos\":20,\"show_time\":false,\"text_params\":0,\"timeout\":0,\"uct\":0}","vt":0,"vs":0,"tbl":[],"itemId":16141282,"callMode":"create"}},{"svc":"unit/update_sensor","params":{"id":19,"n":"Cell Signal","t":"custom","d":"","m":"","p":"io_21","f":0,"c":"{\"act\":1,\"appear_in_popup\":true,\"ci\":{\"0\":{\"c\":0,\"t\":\"No Signal\"},\"1\":{\"c\":0,\"t\":\"Poor\"},\"2\":{\"c\":0,\"t\":\"Average\"},\"3\":{\"c\":0,\"t\":\"Good\"},\"4\":{\"c\":0,\"t\":\"Very Good\"},\"5\":{\"c\":0,\"t\":\"Excellent\"}},\"cm\":1,\"mu\":0,\"pos\":19,\"show_time\":false,\"text_params\":0,\"timeout\":0,\"uct\":0}","vt":0,"vs":0,"tbl":[],"itemId":16141282,"callMode":"create"}},{"svc":"unit/update_sensor","params":{"id":20,"n":"Idle Time","t":"custom","d":"","m":"hrs","p":"none","f":0,"c":"{\"act\":1,\"appear_in_popup\":false,\"ci\":{},\"cm\":0,\"mu\":0,\"pos\":7,\"show_time\":false,\"text_params\":0,\"timeout\":0,\"uct\":0}","vt":0,"vs":0,"tbl":[],"itemId":16141282,"callMode":"create"}},{"svc":"unit/update_sensor","params":{"id":21,"n":"SOS","t":"alarm trigger","d":"","m":"","p":"io_3","f":0,"c":"{\"act\":1,\"appear_in_popup\":true,\"ci\":{},\"cm\":0,\"mu\":0,\"pos\":21,\"show_time\":false,\"timeout\":0,\"uct\":0,\"unbound_code\":\"\",\"validate_driver_unbound\":0}","vt":1,"vs":0,"tbl":[],"itemId":16141282,"callMode":"create"}},{"svc":"item/update_custom_property","params":{"itemId":16141282,"name":"img_rot","value":"0"}},{"svc":"item/update_custom_property","params":{"itemId":16141282,"name":"label_color","value":"16711680"}},{"svc":"item/update_custom_property","params":{"itemId":16141282,"name":"monitoring_sensor_id","value":"0"}},{"svc":"item/update_custom_property","params":{"itemId":16141282,"name":"motion_state_sensor_id","value":"0"}},{"svc":"item/update_custom_property","params":{"itemId":16141282,"name":"solid_colors","value":"255"}},{"svc":"item/update_custom_property","params":{"itemId":16141282,"name":"track_solid","value":"255"}},{"svc":"item/update_custom_property","params":{"itemId":16141282,"name":"use_sensor_color","value":"0"}},{"svc":"unit/update_trip_detector","params":{"type":1,"gpsCorrection":1,"minSat":3,"minMovingSpeed":1,"minStayTime":300,"maxMessagesDistance":100000,"minTripTime":10,"minTripDistance":200,"itemId":16141282}},{"svc":"unit/update_fuel_calc_types","params":{"itemId":16141282,"calcTypes":0}},{"svc":"unit/update_fuel_level_params","params":{"flags":0,"ignoreStayTimeout":10,"minFillingVolume":20,"minTheftTimeout":0,"minTheftVolume":10,"filterQuality":0,"fillingsJoinInterval":300,"theftsJoinInterval":300,"extraFillingTimeout":0,"itemId":16141282}},{"svc":"unit/update_fuel_math_params","params":{"idling":2,"urban":10,"suburban":7,"itemId":16141282}},{"svc":"unit/update_fuel_rates_params","params":{"consSummer":10,"consWinter":12,"winterMonthFrom":11,"winterDayFrom":1,"winterMonthTo":1,"winterDayTo":30,"itemId":16141282}},{"svc":"unit/update_fuel_impulse_params","params":{"maxImpulses":0,"skipZero":0,"itemId":16141282}},{"svc":"unit/update_command_definition","params":{"id":0,"n":"Starter Disable","c":"custom_msg","l":"vrt","p":"setdigout1 0","a":16777216,"f":0,"itemId":16141282,"callMode":"create"}},{"svc":"unit/update_command_definition","params":{"id":0,"n":"Starter Enable","c":"custom_msg","l":"vrt","p":"setdigout1 1","a":16777216,"f":0,"itemId":16141282,"callMode":"create"}},{"svc":"unit/update_report_settings","params":{"itemId":16141282,"params":{"speedLimit":0,"maxMessagesInterval":0,"dailyEngineHoursRate":0,"urbanMaxSpeed":60,"mileageCoefficient":1,"fuelRateCoefficient":0,"speedingTolerance":5,"speedingMinDuration":1,"speedingMode":1}}},{"svc":"unit/update_activity_settings","params":{"type":1,"itemId":16141282}},{"svc":"unit/update_messages_filter","params":{"enabled":0,"skipInvalid":0,"minSats":0,"maxHdop":2,"maxSpeed":0,"lbsCorrection":0,"itemId":16141282}},{"svc":"unit/update_drive_rank_settings","params":{"itemId":16141282,"driveRank":{"global":{"accel_mode":"0"}}}}],"flags":"0"}&sid=04c20f654e27911fdad3dabf043bec96

8

(4 replies, posted in Custom SDK development)

Hi,

is there any API which will give the complete user log from wiolon hosting ?
I need produce data like what are all the pages/features users used most and how long they spent on each page what are all the actions they are performing upon login etc Basically I should be able to produce every page an user landed as well as every clicks he made on the system.

Thanks
Karthik

Thanks for the detailed explanation deal

Hi Support,

I want to update the TimeZone and DST settings of a user and what is the correct way to achieve it ?
I am seeing a batch command was used to update it via CMS which was shown below, do I need to stick to the same batch as well ?
DST update shown below was not required I guess - Am I correct or I am missing anything here ?
Please share me proper way to update TZ and DST settings for an user - Thanks

Current API for updating TZ and DST :

{"params":
[
{"svc":"item/update_custom_property","params":{"itemId":14033536,"name":"tz","value":-134170192}},
{"svc":"item/update_custom_property","params":{"itemId":14033536,"name":"dst","value":-1}},
{"svc":"render/set_locale","params":{"tzOffset":-134170192,"language":"en","flags":257,"formatDate":"%b-%E-%Y %H:%M"}},
{"svc":"user/update_locale","params":{"userId":14033536,"locale":{"fd":"%b-%E-%Y_%I:%M %p","wd":1}}}
],
"flags":0}

Hi Support,

API render/set_locale will set the locale settings

Similar to this API, is there any API to get the current renderer locale settings ? I want to fetch the current language, datetime format etc

Also can you clarify whether these settings are stored in user or account(resource) item ?

Thanks

Hi Gurtam,

I am wondering is there any way I can show hide certain Apps for certain users possessing certain ACL's ?
Basically we have Apps only for Admin level users with in an account and don't want to show the App icon to non admin users for the same account.
Also it is difficult to achieve with separate billing plan because billing plan works with account not with users

Can you help how to achieve this please ?

Thanks

Thanks Deal,

will try it out and confirm you.

Thanks
Karthik

Deal,

I am using remote API client tool called PostMan to test the wialon API's, and in postman if I use the payload as part of http body I am getting error code 4 and if I send it via http params the same API was successful ( I attached both the options screen shot here ) - But other API's all are working fine with http body and only the update_custom_property API is failing.

Let me know what is the correct way to consume the wialon remote API - Do we need to send the payloads via http parameters or can we pass via body ?

Thanks in advance
KarthikG

Hi Gurtam Support,

I am using update_custom_property remote API to create access templates for an user but every time when I hit the API I am getting back error code 4 which is Invalid Input.

I wrapped all the parameter values with double quotes properly ( sample req show below ) , can you please let me know how to achieve this ?

svc:item/update_custom_property
sid:0144d3156d2395604e3eecfcc1ac608b

params:
{
"itemId":14033536,
"name":"access_templates",
"value":
"{
\"avl_unit\":
[
{\"id\":0,\"name\":\"No access\",\"acl\":0,\"color\":\"rgb(232, 201, 162)\"},
{\"acl\":-1,\"name\":\"Full access\",\"color\":\"rgb(232, 164, 162)\",\"id\":1},
{\"acl\":567795534839,\"name\":\"Admin\",\"id\":2,\"color\":\"rgb(242, 190, 235)\"},{\"acl\":567795532791,\"name\":\"Supervisor\",\"id\":3,\"color\":\"rgb(192, 184, 249)\"},
{\"acl\":550024266275,\"name\":\"Read Only\",\"id\":4,\"color\":\"rgb(190, 242, 207)\"},
{\"acl\":880333094883,\"name\":\"GK\",\"color\":\"rgb(184, 215, 249)\",\"id\":5}
],
\"avl_unit_group\":
[
{\"id\":0,\"name\":\"No access\",\"color\":\"rgb(255, 217, 191)\",\"acl\":0},
{\"acl\":-1,\"name\":\"Full access\",\"color\":\"rgb(232, 164, 162)\",\"id\":1},
{\"acl\":567795535863,\"name\":\"Admin\",\"id\":2,\"color\":\"rgb(242, 190, 235)\"},{\"acl\":567795533815,\"name\":\"Supervisor\",\"id\":3,\"color\":\"rgb(192, 184, 249)\"},
{\"acl\":550024266275,\"name\":\"Read Only\",\"id\":4,\"color\":\"rgb(190, 242, 207)\"}
],
\"avl_resource\":
[
{\"id\":0,\"name\":\"No access\",\"color\":\"rgb(255, 217, 191)\",\"acl\":0},
{\"acl\":-1,\"name\":\"Full access\",\"color\":\"rgb(232, 164, 162)\",\"id\":1},
{\"acl\":52806609292279,\"name\":\"Admin\",\"color\":\"rgb(241, 198, 252)\",\"id\":2},{\"acl\":52806609290231,\"name\":\"Supervisor\",\"color\":\"rgb(162, 170, 219)\",\"id\":3},
{\"acl\":17602203107875,\"name\":\"Read Only\",\"color\":\"rgb(198, 252, 200)\",\"id\":4}
],
\"avl_route\":
[
{\"id\":0,\"name\":\"No access\",\"color\":\"rgb(255, 217, 191)\",\"acl\":0},
{\"id\":1,\"name\":\"Full access\",\"color\":\"rgb(211, 191, 229)\",\"acl\":-1},
{\"id\":2,\"name\":\"Read only\",\"color\":\"rgb(191, 212, 242)\",\"acl\":16931}
],
\"user\":
[
{\"id\":0,\"name\":\"No access\",\"color\":\"rgb(255, 217, 191)\",\"acl\":0},
{\"acl\":-1,\"name\":\"Full access\",\"color\":\"rgb(232, 164, 162)\",\"id\":1},
{\"acl\":6310903,\"name\":\"Admin\",\"id\":2,\"color\":\"rgb(242, 190, 235)\"},
{\"acl\":2114551,\"name\":\"Supervisor\",\"id\":3,\"color\":\"rgb(192, 184, 249)\"},
{\"acl\":16931,\"name\":\"Read Only\",\"id\":4,\"color\":\"rgb(190, 242, 207)\"}
]
}"
}

Deal,

We figured out it isnot the issue of the API and it is the way we consumed the API, we didn't enclosed the keys with double quotation that's why it broke and after fixing it with double quotes it is working fine now

Issue Root Cause :
    var param = string.Concat("{authHash: \"", request.AuthHash, "\", operateAs:\"", request.OperateAs, "\", checkService:\"\"}");

Issue Fix :
    var param = string.Concat("{\"authHash\": \"", request.AuthHash, "\", \"operateAs\":\"", request.OperateAs, "\", \"checkService\":\"\"}");


Thanks
Karthik

Deal,

I am also experiencing the same, some times it is working next time it is not working. I also did one more test by hosting the App in different web server so that the IP will be different but initially it worked but after some time it si not consistent as well.

We are using core/use_auth_hash API which is totally inconsistent, most of the time we get error code 4

Action : UseAuthHash
Method Parameters : {"request":{"AuthHash":"04a97c11aa3b75cc5bfd8471bf147be9","OperateAs":"sampleuser"}}
Error Code : 4

Error Description : Invalid input [core/use_auth_hash]

Please let me know how to handle this.

Thanks in advance
Karthik

18

(2 replies, posted in Custom SDK development)

private ushort GetCRC16(byte[] data)
        {
            ushort[] crc16_table = new ushort[]
            {
                0x0000,0xC0C1,0xC181,0x0140,0xC301,0x03C0,0x0280,0xC241,
                0xC601,0x06C0,0x0780,0xC741,0x0500,0xC5C1,0xC481,0x0440,
                0xCC01,0x0CC0,0x0D80,0xCD41,0x0F00,0xCFC1,0xCE81,0x0E40,
                0x0A00,0xCAC1,0xCB81,0x0B40,0xC901,0x09C0,0x0880,0xC841,
                0xD801,0x18C0,0x1980,0xD941,0x1B00,0xDBC1,0xDA81,0x1A40,
                0x1E00,0xDEC1,0xDF81,0x1F40,0xDD01,0x1DC0,0x1C80,0xDC41,
                0x1400,0xD4C1,0xD581,0x1540,0xD701,0x17C0,0x1680,0xD641,
                0xD201,0x12C0,0x1380,0xD341,0x1100,0xD1C1,0xD081,0x1040,
                0xF001,0x30C0,0x3180,0xF141,0x3300,0xF3C1,0xF281,0x3240,
                0x3600,0xF6C1,0xF781,0x3740,0xF501,0x35C0,0x3480,0xF441,
                0x3C00,0xFCC1,0xFD81,0x3D40,0xFF01,0x3FC0,0x3E80,0xFE41,
                0xFA01,0x3AC0,0x3B80,0xFB41,0x3900,0xF9C1,0xF881,0x3840,
                0x2800,0xE8C1,0xE981,0x2940,0xEB01,0x2BC0,0x2A80,0xEA41,
                0xEE01,0x2EC0,0x2F80,0xEF41,0x2D00,0xEDC1,0xEC81,0x2C40,
                0xE401,0x24C0,0x2580,0xE541,0x2700,0xE7C1,0xE681,0x2640,
                0x2200,0xE2C1,0xE381,0x2340,0xE101,0x21C0,0x2080,0xE041,
                0xA001,0x60C0,0x6180,0xA141,0x6300,0xA3C1,0xA281,0x6240,
                0x6600,0xA6C1,0xA781,0x6740,0xA501,0x65C0,0x6480,0xA441,
                0x6C00,0xACC1,0xAD81,0x6D40,0xAF01,0x6FC0,0x6E80,0xAE41,
                0xAA01,0x6AC0,0x6B80,0xAB41,0x6900,0xA9C1,0xA881,0x6840,
                0x7800,0xB8C1,0xB981,0x7940,0xBB01,0x7BC0,0x7A80,0xBA41,
                0xBE01,0x7EC0,0x7F80,0xBF41,0x7D00,0xBDC1,0xBC81,0x7C40,
                0xB401,0x74C0,0x7580,0xB541,0x7700,0xB7C1,0xB681,0x7640,
                0x7200,0xB2C1,0xB381,0x7340,0xB101,0x71C0,0x7080,0xB041,
                0x5000,0x90C1,0x9181,0x5140,0x9301,0x53C0,0x5280,0x9241,
                0x9601,0x56C0,0x5780,0x9741,0x5500,0x95C1,0x9481,0x5440,
                0x9C01,0x5CC0,0x5D80,0x9D41,0x5F00,0x9FC1,0x9E81,0x5E40,
                0x5A00,0x9AC1,0x9B81,0x5B40,0x9901,0x59C0,0x5880,0x9841,
                0x8801,0x48C0,0x4980,0x8941,0x4B00,0x8BC1,0x8A81,0x4A40,
                0x4E00,0x8EC1,0x8F81,0x4F40,0x8D01,0x4DC0,0x4C80,0x8C41,
                0x4400,0x84C1,0x8581,0x4540,0x8701,0x47C0,0x4680,0x8641,
                0x8201,0x42C0,0x4380,0x8341,0x4100,0x81C1,0x8081,0x4040
            };

            if (data == null || data.Length == 0 ) return 0;
            ushort crc = 0;

            foreach(byte x in data)
                crc = (ushort)((crc >> 8) ^ crc16_table[(byte)(crc ^ x)]);

            return crc;
        }

Thanks Deal

Hi Gurtam,

I am creating a custom App and from the CMS App Configurator page, I am not seeing a way to add my custom icon for my custom App created - can you tell me how to achieve this ?

Thanks in Advance
Karthik

Thanks Deal, Is there any logic of Client side SID and Server Side SID ? Or all the SIDs are same from system  ?

If I click an App from Wialon I am passing along a SID, can I use that SID to call a remote wialon API ?

SessionID ( SID) - What is the expiration logic and duration behind it ?


For example using my login token I am getting the active SID and I am using the SID for my other service calls, when will my SID will expire or it won't expire at all if I use it periodically ?

Is there any expiration time for SID and if it is yes then is it sliding expiration ?

Thanks in advance
Karthik

Hi Gurtam,

I am using Wialon IPS as device type and using virtual as command channel, currently if I use virtual as command channel I can queue up to 10 commands while the unit is not reporting.

Once a unit send a packet or reporting to wialon all the pending 10 commands are send to the unit one after another in the same order.

My question is, is there any remote API available in a way such that if I pass the Unit information can I get back the list of commands which is pending to be sent to the unit ?

Also is there any API which will give me all the details like source IP PORT and target IP Port for a specific command ?

Also while sending out commands from wialon which channel will be chosen to reach to the unit UDP OR TCP OR SMS etc ?

Also is there any way we can get the command status - whether the command is successfully send to the unit or not ? Is there any ack back from unit once the command is getting delivered to the unit ?

Also while sending out command to the unit does it have any unit context along with the commmand, because I am doing packet relay via wialon ips and I need to know whether the incoming command intended for which unit ? Other wise I can t relay the command back to the actual unit in the field.

Eagerly waiting for your quicker  reply - Thanks in Advance

Thanks Deal - Your answer confirms my assumption. Let me rethink my strategy to achieve this.

Hi Gurtam,

I knew that in order to do the authentication from my mobile app from Wialon - I need to embed custom login page of wialon and do the http post and then get the authentication token etc which is not going to work out for my problem.

My intention is with out republishing the App and with out changing the look and feel of the login page of the App, I need to do the authentication.
By modifying my existing authentication service to include the extra Wialon SDK authentication remote API call I can easily achieve this but after Wialon implemented OAuth there is no direct way to achieve this it seems.

The only way I can achieve this is changing my existing authentication service to accommodate both my existing authentication logic as well as new wialon authentication logic ( Wialon login authentication should be via remote API calls and definitely not via iFrame embedding the Login HTML page of wialon etc )

Can you tell me how to achieve this ? This is very urgent and I completely scanned through all your documentation and forum topics and virtually running out of any viable solution right now.

Any quicker help will be greatly appreciated - I only need to know the possibility of authenticating via remote API in Wialon SDK - Yes Or No answer will be perfect for me to move forward.

Thanks in Advance