This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision | ||
en:sidebar:remoteapi:apiref:core:login [27/04/2018 07:37] stan [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¶ms={"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 */ | ||
- | }, | ||
- | "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]]. | ||
- | |||
- | ===== Errors ===== | ||
- | ^ Code ^ Value ^ | ||
- | | 6 | Storage server unavailable | | ||
- | |||
- | [[../errors/errors|Other errors]] may also occur. |
|