Table of Contents

Login






This method is deprecated. (see. token/login). Was valid till 01 Oct 2015.

Before starting to work with Wialon, it is necessary to login. Use the command core/login for this action:

svc=core/login&params={"user":<text>,
		       "password":<text>,
		       "operateAs":<text>}

:!: 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.

:!: You can find an example of this request in the sample Login/logout.

:!: 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 this).

Parameters

Name Description
user user name
password password
operateAs name of user from whose behalf you want to perform login (optional parameter)

Response

{
	"host":<text>,			/* host */
	"eid":<text>,			/* session ID */
	"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 */
			...
		}
	}
}

:!: Clarification for <service_name>: for additional info please refer to services list.

User flags are described in the chapter Set user settings flags.

Errors

Code Value
6 Storage server unavailable

Other errors may also occur.