Generates and retrieves a new token for the device

Syntax
.tokenCreate(/id/, /data/)

Arguments

Field nameType Description
id
string
Reference ID of the device.
data
object
Options for the new token.
name
string
A name for the token.
expire_time
string
The time for when the token should expire. It will be randomly generated if not included. Accepts “never” as value. 
permission
string
Token permission should be 'write', 'read' or 'full'.
serie_number
string
[optional]
The serial number of the device. 
verification_code
string
[optional] 
Verification code to validate middleware requests.
middleware
string
[optional] 
Middleware or type of the device that will be added.

Returns {Promise<JSON>}