Class: Session

Session

new Session(opts)

Wialon session representation
Parameters:
Name Type Description
opts object Constructor options
Source:

Methods

endpoint() → {string}

Helper method to get Wialon Remote API endpoint URL
Source:
Returns:
Wialon Remote API endpoint URL e.g. 'https://hst-api.wialon.com/wialon/ajax.html'
Type
string

options(opts)

Set options
Parameters:
Name Type Description
opts object Options
Source:

request(string, params) → {Promise}

Make an API request
Parameters:
Name Type Description
string svc API command (e.g. 'core/search_items')
params object API parameters for command execution
Source:
Returns:
Type
Promise

start(authz) → {Promise}

Initiate a session using 'token/login' API command. The session data is saved in module scope so it can be referenced from convenience classes.
Parameters:
Name Type Description
authz object Authorization parameters
Properties
Name Type Description
token string Access token
operateAs string User to use this session as
Source:
Returns:
Type
Promise