Differences

This shows you the differences between two versions of the page.

Link to this comparison view

en:pro:remoteapi:codesamples:login [06/03/2013 15:39]
zuve
en:pro:remoteapi:codesamples:login [29/11/2013 13:31]
Line 1: Line 1:
-{{indexmenu_n>​1}} 
-====== Login/​logout ====== 
  
-To execute any command in Wialon Pro, you need authorize and get session ID.  
- 
-===== Login ===== 
- 
-The example of authorization is described below. Detailed description of response format you can find in chapter [[../​apiref/​core/​login|core/​login]]. 
-<​code>​ 
-<​your_wialon_pro_address>/​ajax.html?​svc=core/​login&​ 
- params={ 
- "​user":"​wialon",​ 
- "​password":""​ 
- } 
-</​code>​ 
- 
-Response: 
-<code javascript>​ 
-{ 
-    "​uid":​ 7, 
-    "​eid":​ 2, 
-    "​ssid":​ "​86e4cb77576c64fa96fcc2eae34a9079",​ 
-    "​pi":​ 2, 
-    "​tm":​ 1362556512, 
-    "​user":​ { 
-        "​nm":​ "​wialon",​ 
-        "​cls":​ 1, 
-        "​id":​ 7, 
-        "​gd":​ "​940804612cf7d75865a8e7f3d8457b28",​ 
-        "​prp":​ {}, 
-        "​pup":​ { 
-            "​language":​ "​en",​ 
-            "​tz":​ "​134228528",​ 
-            "​umap":​ "​WebGIS",​ 
-            "​ursstp":​ "​0x1ebf",​ 
-            ... 
-        }, 
-        "​crt":​ 0, 
-        "​bact":​ 27, 
-        "​fl":​ 4, 
-        "​usnf":​ {}, 
-        "​smsp":​ ""​ 
-    }, 
-    "​classes":​ { 
-        "​avl_hw":​ 5, 
-        "​avl_resource":​ 4, 
-        "​avl_retranslator":​ 6, 
-        "​avl_unit":​ 3, 
-        "​avl_unit_group":​ 7, 
-        "​user":​ 1 
-    } 
-} 
-</​code>​ 
-For further operations, we need session ID which is specified in the field **ssid**. In our case it is **86e4cb77576c64fa96fcc2eae34a9079**. ​ 
- 
-===== Logout ===== 
-To stop working with Wialon and logout from the system, deactivate the session making the following request: 
- 
-<​code>​ 
-<​your_wialon_pro_address>/​ajax.html?​svc=core/​logout&​params={}&​sid=86e4cb77576c64fa96fcc2eae34a9079 
-</​code>​ 
- 
-Response: 
-<code javascript>​ 
-{ 
- "​error":​0 
-} 
-</​code>​ 
- 
-Such result tells us that the exit was successful. 
- 
- 
-Parameters of this request as well as the returned value are described in the chapter [[../​apiref/​core/​logout]]. 
Follow us on Facebook Gurtam Wialon Twitter Gurtam Wialon info@gurtam.com   |   Copyright © 2002-2024 Gurtam