Create/edit/delete token

This method is used for managing own tokens and user tokens to whom you have access but not for authorization (method token/login is used for that).

To create/edit/delete the token please use token/update command:

svc=token/update&params={"callMode":<text>,
			 "userId":<text>,
			 "h":<text>,
			 "app":<text>,
			 "at":<uint>,
			 "dur":<uint>,
			 "fl":<uint>,
			 "p":<text>,
			 "items":[<long>],
			 "deleteAll":<bool>|<text>}

Parameters

Name Description
callMode action: creation, editing, deletion (create, update, delete)
userId subuser id (optional, for managing other user tokens)
h token name - 72 symbols (while update, delete)
app application name
at token activation time, UNIX-time:
0 - now
dur token duration after activation, seconds:
max value = 8640000 (100 days) if 0 – duration is infinite
fl access flags
p custom parameters, value must be object or an array of objects
p:{} is minimal
items list of item ids with token granted access, optional
deleteAll actual for callMode:delete; values: 1 or true - delete all created tokens

:!: Token is deleted automatically through 100 days of inaction ( even with dur:0)!

Object example for p-param:

"p":"{\"paramA\":\"valueB\"}"

Array of objects example for p-param:

"p":"[{\"paramA\":\"valueB\"},{\"paramB\":\"valueD\"}]"

Access flags

Value Description
0x100 online tracking
0x200 view access to most data
0x400 modification of non-sensitive data
0x800 modification of sensitive data
0x1000 modification of critical data, including messages deletion
0x2000 communication
-1 unlimited operation as authorizated user
(allows to manage user tokens)

:!: More info you can get here.

Response

{
	"h":<text>,		/* unique token name, 72 symbols */
	"app":<text>,		/* application name */
	"at":<uint>,		/* token activation time, UNIX-time */
	"ct":<uint>,		/* token creation time, UNIX-time */
	"dur":<uint>,		/* token duration after activation, секунды */
	"fl":<uint>,		/* access flags */
	"items":[<long>],	/* list of item ids with token granted access */
	"p":<text>		/* custom parameters, value must be object or an array of objects */
}
Follow us on Facebook Gurtam Wialon Twitter Gurtam Wialon info@gurtam.com   |   Copyright © 2002-2024 Gurtam