Access Tokens

Access tokens provide a way to authenticate to the Tikit API for use in external services like PowerShell, Power BI, and Power Automate.

To access and manage the Access Token settings page:

  1. Open the Tikit web app at https://web.tikit.ai.
  2. Once in the Tikit web app, select the settings Gear in the header, then select Access Token.
1 Add a new access token. 1 of 6 2 Search for specific tokens. 2 of 6 3 Token name. Select to view token details like the app roles assigned to the token. 3 of 6 4 The username of the token creator. 4 of 6 5 The date the token will expire.
Expired tokens will no longer provide access. 5 of 6
6 Additional options like Deleting a token. 6 of 6
  1. Add Token Add a new access token.
  2. Search Search for specific tokens.
  3. Name Token name. Select to view token details like the app roles assigned to the token.
  4. Owner The username of the token creator.
  5. Expiration The date the token will expire. Expired tokens will no longer provide access.
  6. More Options Additional options like Deleting a token.

To add a new access token:

  1. In Settings > Access Tokens, select + New Token from the toolbar.
  1. Once in the Add New Access Token form, enter a token name, expiration date, and select which app role(s) the token should provide access to. See the following table for info on the form fields.
Field Required Description Example
Name Yes Display name for the token. This value may contain spaces. PowerShell Admin
Expiration Date Yes The date the token will expire.
The default expiration is set at 1 month from the current date.
01/23/2023
Application Roles Yes The Tikit app roles assigned to the token.
Note that an access token cannot have more permissions than the creator, so you may only see Agents as an option for role.
Administrators
  1. Select Save to generate the access token.
  2. The token value will be displayed at this point. Make sure to save the value, it will not be displayed again and if lost a new access token will need to be generated.

Congrats on creating a new token. The token can now be used to authenticate to the Tikit API as a bearer token.

Need to remove access granted by a token or clean up any expired tokens? Tokens can be permanently deleted from the Access Tokens page.

To delete an existing token:

  1. In Settings > Access Token, find the token to delete then select More options () > Delete.

The token will now be permanently deleted.

Now that you have an access token you can use it to access resources in Tikit from many third-party applications like PowerShell, Power BI dashboards, Power Automate flows, and many others that can connect to an odata endpoint or make REST calls. The client must send this token in the Authorization header when making requests:

				
					Authorization: Bearer <token>
				
			

To access the Tikit API with a curl request from a terminal application, replace {token} in the Authorization header with your access token. The example requests will return all tickets or a single one by ticket id.

				
					# Get all of the tickets
curl https://app.tikit.ai/api/ticket -H "Accept: application/json" -H "Authorization: Bearer {token}"

# Get one ticket by Id
curl https://app.tikit.ai/api/ticket/100 -H "Accept: application/json" -H "Authorization: Bearer {token}"
				
			

Here’s a small PowerShell script to retrieve all tickets or just 1 that uses an access token. The token is defined on line 1, added to the Authorization header on line 2, and finally used on lines 4 and 8 in the Invoke-RestMethod calls to /api/Ticket:

				
					$token = "Your-Token-Here"
$headers = @{Authorization = "Bearer $token"}
# Get all of the tickets
$tickets = @(Invoke-RestMethod -Uri "https://app.tikit.ai/api/ticket" -Headers $headers -Method Get | Select-Object -ExpandProperty value)

# Get one ticket by Id
$id = 100
$ticket = @(Invoke-RestMethod -Uri "https://app.tikit.ai/api/ticket/$id" -Headers $headers -Method Get)
				
			
Search
In this article