An easy method to get tokens from a device. If a token name is not provided, it returns the first token of the device.

Syntax
.getTokenByName(/account/, /device_id/, /token_name/)

Arguments

Field name
Type
Description
account
tago/account
Instanced Tago account object.
device_id
string
Device ID.
token_name
string
Optional token name. Returns first token found if not provided.

Returns {Promise<JSON>}