OAuth tokens

List and revoke active OAuth tokens issued for your tenant.

List OAuth tokens

Retrieve list of OAuth tokens that the user has access to. Users assigned with a TenantAdmin role can list OAuth tokens generated for all users in the tenant.

Facts

Rate limit Tier 1 (1000 requests per minute)

Query Parameters

  • limit number

    The maximum number of tokens to return.

  • page string

    The target page.

  • sort string

    The field to sort by.

    Can be one of: "userId"

  • userId string

    The ID of the user to limit results to.

Responses

200

The page result.

  • application/json object
    Show application/json properties
    • data array of objects
      Required
      Show data properties
      • id string
        Required

        The token ID.

      • userId string
        Required

        The ID of the owning user.

      • lastUsed string

        The last time the token was used.

      • tenantId string
        Required

        The ID of the owning tenant.

      • deviceType string

        The type of the user device the authorization token is generated for (Tablet, Phone etc.).

      • description string

        The description of the token.

    • links object
      Required
      Show links properties
      • next object
        Show next properties
        • href string
          Required

          The URL for the link.

      • prev object
        Show prev properties
        • href string
          Required

          The URL for the link.

      • self object
        Required
        Show self properties
        • href string
          Required

          The URL for the link.

400

Invalid request parameter for querying tokens.

  • application/json object

    A representation of the errors encountered from the HTTP request.

    Show application/json properties
    • errors array of objects

      List of errors and their properties.

      Show errors properties
      • code string
        Required

        The error code.

      • meta object

        Non-standard information about the error.

      • title string
        Required

        The error title.

      • detail string

        The detailed error message.

      • status string

        The http status code.

401

Authentication failed.

  • application/json object

    A representation of the errors encountered from the HTTP request.

    Show application/json properties
    • errors array of objects

      List of errors and their properties.

      Show errors properties
      • code string
        Required

        The error code.

      • meta object

        Non-standard information about the error.

      • title string
        Required

        The error title.

      • detail string

        The detailed error message.

      • status string

        The http status code.

GET /api/v1/oauth-tokens
import { createQlikApi } from '@qlik/api'
const qlik = createQlikApi({
hostConfig: {
host: 'https://{tenant}.{region}.qlikcloud.com',
apiKey: '<access-token>',
},
})
await qlik.oauthTokens.getOauthTokens({})
qlik oauth-token ls
curl "https://{tenant}.{region}.qlikcloud.com/api/v1/oauth-tokens" \
-H "Authorization: Bearer <access_token>"

Example Response

{
"data": [
{
"id": "string",
"userId": "string",
"lastUsed": "2018-10-30T07:06:22Z",
"tenantId": "string",
"deviceType": "string",
"description": "string"
}
],
"links": {
"next": {
"href": "string"
},
"prev": {
"href": "string"
},
"self": {
"href": "string"
}
}
}

Revoke an OAuth token by ID

Revokes a specific OAuth token by ID. Requesting user must have TenantAdmin role assigned to delete tokens owned by other users.

Facts

Rate limit Tier 2 (100 requests per minute)

Path Parameters

  • tokenId string
    Required

    The ID of the token to revoke.

Responses

204

Token deleted successfully.

401

Authentication failed.

  • application/json object

    A representation of the errors encountered from the HTTP request.

    Show application/json properties
    • errors array of objects

      List of errors and their properties.

      Show errors properties
      • code string
        Required

        The error code.

      • meta object

        Non-standard information about the error.

      • title string
        Required

        The error title.

      • detail string

        The detailed error message.

      • status string

        The http status code.

default

Unexpected error.

  • application/json object

    A representation of the errors encountered from the HTTP request.

    Show application/json properties
    • errors array of objects

      List of errors and their properties.

      Show errors properties
      • code string
        Required

        The error code.

      • meta object

        Non-standard information about the error.

      • title string
        Required

        The error title.

      • detail string

        The detailed error message.

      • status string

        The http status code.

DELETE /api/v1/oauth-tokens/{tokenId}
import { createQlikApi } from '@qlik/api'
const qlik = createQlikApi({
hostConfig: {
host: 'https://{tenant}.{region}.qlikcloud.com',
apiKey: '<access-token>',
},
})
await qlik.oauthTokens.deleteOauthToken(
'TiQ8GPVr8qI714Lp5ChAAFFaU24MJy69',
)
qlik oauth-token rm 'TiQ8GPVr8qI714Lp5ChAAFFaU24MJy69'
curl "https://{tenant}.{region}.qlikcloud.com/api/v1/oauth-tokens/{tokenId}" \
-X DELETE \
-H "Authorization: Bearer <access_token>"