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

  • limitnumber

    The maximum number of tokens to return.

  • pagestring

    The target page.

  • sortstring

    The field to sort by.

    Can be one of: "userId"

  • userIdstring

    The ID of the user to limit results to.

Responses

200

The page result.

  • application/jsonobject
    Show application/json properties
    • dataarray of objects
      Required
      Show data properties
      • idstring
        Required

        The token ID.

      • userIdstring
        Required

        The ID of the owning user.

      • lastUsedstring

        The last time the token was used.

      • tenantIdstring
        Required

        The ID of the owning tenant.

      • deviceTypestring

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

      • descriptionstring

        The description of the token.

    • linksobject
      Required
      Show links properties
      • nextobject
        Show next properties
        • hrefstring
          Required

          The URL for the link.

      • prevobject
        Show prev properties
        • hrefstring
          Required

          The URL for the link.

      • selfobject
        Required
        Show self properties
        • hrefstring
          Required

          The URL for the link.

400

Invalid request parameter for querying tokens.

  • application/jsonobject

    A representation of the errors encountered from the HTTP request.

    Show application/json properties
    • errorsarray of objects

      List of errors and their properties.

      Show errors properties
      • codestring
        Required

        The error code.

      • metaobject

        Non-standard information about the error.

      • titlestring
        Required

        The error title.

      • detailstring

        The detailed error message.

      • statusstring

        The http status code.

401

Authentication failed.

  • application/jsonobject

    A representation of the errors encountered from the HTTP request.

    Show application/json properties
    • errorsarray of objects

      List of errors and their properties.

      Show errors properties
      • codestring
        Required

        The error code.

      • metaobject

        Non-standard information about the error.

      • titlestring
        Required

        The error title.

      • detailstring

        The detailed error message.

      • statusstring

        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

  • tokenIdstring
    Required

    The ID of the token to revoke.

Responses

204

Token deleted successfully.

401

Authentication failed.

  • application/jsonobject

    A representation of the errors encountered from the HTTP request.

    Show application/json properties
    • errorsarray of objects

      List of errors and their properties.

      Show errors properties
      • codestring
        Required

        The error code.

      • metaobject

        Non-standard information about the error.

      • titlestring
        Required

        The error title.

      • detailstring

        The detailed error message.

      • statusstring

        The http status code.

default

Unexpected error.

  • application/jsonobject

    A representation of the errors encountered from the HTTP request.

    Show application/json properties
    • errorsarray of objects

      List of errors and their properties.

      Show errors properties
      • codestring
        Required

        The error code.

      • metaobject

        Non-standard information about the error.

      • titlestring
        Required

        The error title.

      • detailstring

        The detailed error message.

      • statusstring

        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 <tokenId>
curl "https://{tenant}.{region}.qlikcloud.com/api/v1/oauth-tokens/{tokenId}" \
-X DELETE \
-H "Authorization: Bearer <access_token>"