Access tokens provide a way to authenticate to the Tikit API for use in external services like PowerShell, Power BI, and Power Automate.
In this article:
How to view Access Token settings
To access and manage the Access Token settings page:
Open the Tikit web app at https://web.tikit.ai.
Once in the Tikit web app, select the settings Gear in the header, then selectĀ Access Token.
Hover over the labels or check out the following key section for more details.
123456
Add TokenĀ Add a new access token.
Search Search for specific tokens.
Name Token name. Select to view token details like the app roles assigned to the token.
OwnerĀ The username of the token creator.
ExpirationĀ The date the token will expire. Expired tokens will no longer provide access.
More OptionsĀ Additional options like Deleting a token.
How to add an access token
To add a new access token:
In SettingsĀ > Access Tokens, select + New TokenĀ from the toolbar.
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
Select SaveĀ to generate the access token.
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.
How to delete an access 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:
In Settings > Access Token, find the token to delete then select More options (ā¦) > Delete.
The token will now be permanently deleted.
How to use an access token
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>
How to use an access token with curl
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}"
How to use an access token with PowerShell
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)
How to use an access token with Power BI
For details on connecting to Tikit using Power BI, check out How to Create a Ticketing Dashboard in Microsoft Teams using Power BI.