Differences

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

Link to this comparison view

Both sides previous revision Previous revision
en:sidebar:remoteapi:apiref:core:login [18/01/2019 14:49]
mani [Response]
en:sidebar:remoteapi:apiref:core:login [15/01/2021 13:21]
chdi
Line 1: Line 1:
 {{indexmenu_n>​1}} {{indexmenu_n>​1}}
 ====== Login ====== ====== Login ======
-\\ 
-\\ 
-\\ 
-\\ 
 \\ \\
 <note warning>​This method is deprecated. (see. [[../​token/​login|token/​login]]). Was valid till 01 Oct 2015.</​note>​ <note warning>​This method is deprecated. (see. [[../​token/​login|token/​login]]). Was valid till 01 Oct 2015.</​note>​
  
-Before starting to work with Wialon, it is necessary to login. Use the command **core/​login** for this action: ​ 
  
-<code javascript>​ 
-svc=core/​login&​params={"​user":<​text>,​ 
-        "​password":<​text>,​ 
-        "​operateAs":<​text>​} 
-</​code>​ 
- 
-:!: After login session is created, you can execute some requests within it. If server haven'​t received any requests for 5 minutes the session will be killed. To prevent such behaviour you can send a request every 5 minutes, for example ​ [[../​requests/​avl_evts|requests/​avl_evts]]. 
- 
-:!: You can find an example of this request in the sample [[../​../​codesamples/​login|]]. 
- 
-:!: If you got {error:7} in response please try special symbols percent-encoding (via %) for ''​user'',​ ''​password''​ and ''​operateAs''​. You may use any percent-encoding service (like [[http://​meyerweb.com/​eric/​tools/​dencoder/​|this]]). 
-===== Parameters ===== 
-^ Name ^ Description ^ 
-| user | user name | 
-| password | password | 
-| operateAs | name of user from whose behalf you want to perform login (optional parameter)| 
- 
-===== Response ===== 
-<​code=javascript>​ 
-{ 
- "​eid":<​text>,​ /​* session ID */ 
- "​gis_sid":<​text>,​ /​* session ID for gis services */ 
- "​host":<​text>,​ /​* host */ 
- "​hw_gw_ip":<​text>,​ /​* hardware gateway ip */ 
- "​au":<​text>,​ /​* user name */ 
- "​pi":<​int>,​ /​* ping interval */ 
- "​tm":<​uint>,​ /​* current time (UTC) */ 
-        "​wsdk_version":<​text> ​          /* sdk version */ 
- "​user":​{ /​* user from whose behalf you want to perform login */ 
- "​nm":<​text>,​ /​* name  */ 
- "​cls":<​uint>,​ /​* ID of superclass "​user"​ */ 
- "​id":<​long>,​ /​* ID */ 
- "​prp":​{ /​* custom properties, for example: */ 
- "​dst":<​text>,​ /​* daylight savings time */ 
- "​language":<​text>,​ /​* language (two-lettered code) */ 
- "​msakey":<​text>,​ /​* access key to mobile site */ 
- "​pcal":<​text>,​ /​* Iranian calendar */ 
- "​tz":<​text>,​ /​* time zone */ 
- "​us_units":<​text>,​ /​* US metrics (miles and gallons) */ 
- ...  
- }, 
- "​crt":<​uint>,​ /​* creator ID */ 
- "​bact":<​uint>,​ /​* account ID */ 
- "​fl":<​uint>,​ /​* user flags */ 
- "​hm":<​text>,​ /​* host mask */ 
- "​uacl":<​uint>,​ /​* user access to himself */ 
- "​mu":​ <​uint>,​ /​* Measurement system */ 
- "​ct":​ <​uint>,​ /​* User creation date */ 
- "​ftp":​ {<​text>​},​ /​* FTP settings */ 
- "​ld":​ <​uint>,​ /​* Last login date */ 
- "​pfl":​ <​uint>,​ /​* Creators flag */ 
- "​ap":​ { /* Two-factor authentication settings */ 
-     "​type":<​uint>,​ /​* authentication type ( 0 - none, 1 - email, 2 - SMS ) */ 
-     "​phone":<​text>​ /​* Phone number */ 
- },    ​ 
- "​mapps":​ {<​text>​},​ /​* Mobile apps list */ 
- "​mappsmax":​ <​int>​ /​* Restrictions on mobile applications specified in the billing plan */ 
- }, 
- "​classes":​{ /​* superclasses available for current user (key - superclass name, value - superclass ID): */ 
- "​avl_hw":<​uint>,​ /​* hardware type */ 
- "​avl_resource":<​uint>,​ /​* resource */ 
- "​avl_retranslator":<​uint>,​ /​* retranslator */ 
- "​avl_unit":<​uint>,​ /​* unit */ 
- "​avl_unit_group":<​uint>,​ /​* unit group */ 
- "​user":<​uint>,​ /​* user */ 
- "​avl_route":<​uint>​ /​* route */ 
- } 
- "​features":​{ 
- "​unlim":<​bool>,​ /​* billing plan type: 0 - regular, 1 - special (for development/​testing) */ 
- "​svcs":​{ /​* hash-collection of allwed services, if service not mentioned here means it is forbidden */ 
- "<​service_name>":<​bool>,​ /​* key - service name, value: 0 - service available, but limit reached, 1 - service available and can be used */ 
- ... 
- } 
- } 
-} 
-</​code>​ 
-:!: **Clarification for <​service_name>​**:​ for additional info please refer to [[../​account/​get_account_data#​services_list | services list]]. 
- 
-User flags are described in the chapter [[../​user/​update_user_flags]]. 
- 
-More about FTP setting here - [[../​item/​update_ftp_property]]. 
- 
-===== Errors ===== 
-^ Code ^ Value ^ 
-| 6 | Storage server unavailable | 
- 
-[[../​errors/​errors|Other errors]] may also occur. 
Follow us on Facebook Gurtam Wialon Twitter Gurtam Wialon info@gurtam.com   |   Copyright © 2002-2024 Gurtam