Login
Definitions
Login
| FIELD | TYPE | DESCRIPTION |
|---|---|---|
sn | number | serial number[1] experimental |
platform | string?[3] | platform name |
user | User?[3] | user object[2] |
status | LoginStatus | login status |
adapter | string | adapter name experimental |
features | string[]? | list of platform features experimental |
TIP
[1] login.sn is only used to identify the Login object and is unrelated to platform logic (meaning no platform-related API calls require this sn). It is also not persisted (meaning the sn for the same login may differ across connections, and different logins may share the same sn). Please especially distinguish it from login.user.id.
TIP
[2] login.user is not necessarily a real platform user; it can also be a bot or application identity assigned by the platform.
TIP
[3] When login.status is not ONLINE, platform and user may be null. However, in all non-login events, login is guaranteed to be in the ONLINE state, so platform and user will always have truthy values. From an SDK development perspective, it is a good practice to provide different types for login and non-login events.
LoginStatus
| TYPE | VALUE | DESCRIPTION |
|---|---|---|
OFFLINE | 0 | offline |
ONLINE | 1 | online |
CONNECT | 2 | connecting |
DISCONNECT | 3 | disconnecting |
RECONNECT | 4 | reconnecting |
API
Get Login
POST /login.getGet the current login. Returns a Login object.
Events
login-added
Triggered when a login is created. Required resource: login.
login-removed
Triggered when a login is deleted. Required resource: login.
login-updated
Triggered when login information is updated. Required resource: login.