Skip to content

Tokens

Tokens are used to authenticate users and services.

User Token

token owner

HTTP
curl {{host}}/api/core/token/user \
-H "Authorization: Token {{token}}"
Response
JSON
{
  "success": true,
  "message": "Token List",
  "requestID": "",
  "executed_at": "2050-01-01T00:00:00.123456Z",
  "data": {
    "items": [
      {
        "username": "[email protected]",
        "userid": null,
        "loginprovider": null,
        "name": "test2",
        "value": null,
        "token_created_at": "2050-01-01T00:00:00",
        "token_used_at": "2050-01-01T00:00:00",
        "token_created_by": "[email protected]"
      },
      {
        "username": "[email protected]",
        "userid": null,
        "loginprovider": null,
        "name": "test1",
        "value": null,
        "token_created_at": "2050-01-01T00:00:00",
        "token_used_at": "2050-01-01T00:00:00",
        "token_created_by": "[email protected]"
      }
    ]
  }
}

Browse Tokens

sys_administrator

HTTP
curl {{host}}/api/core/token/browse \
-H "Authorization: Token {{token}}"
Response
JSON
{
  "success": true,
  "message": "Token List",
  "requestID": "",
  "executed_at": "2050-01-01T00:00:00.123456Z",
  "data": {
    "items": [
      {
        "username": "[email protected]",
        "userid": null,
        "loginprovider": null,
        "name": "support2",
        "value": null,
        "token_created_at": "2050-01-01T00:00:00",
        "token_used_at": "2050-01-01T00:00:00",
        "token_created_by": "[email protected]"
      },
      {
        "username": "[email protected]",
        "userid": null,
        "loginprovider": null,
        "name": "support",
        "value": null,
        "token_created_at": "2050-01-01T00:00:00",
        "token_used_at": "2050-01-01T00:00:00",
        "token_created_by": "[email protected]"
      }
    ]
  }
}

Create Tokens

sys_tokens

Create a token for a current user.

HTTP
curl -X POST {{host}}/api/core/token/create/logintoken \
-H "Authorization: Token {{token}}"
HTTP
1
2
3
GET      {{host}}/api/core/token/user/{{username}}                             //AUTH:sys_administrator
POST     {{host}}/api/core/token/create/{{token_name}}/{{username}}            //AUTH:sys_administrator
POST     {{host}}/api/core/token/delete/{{token_name}}/{{username}}            //AUTH:sys_adminsitrator or token owner