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:
- 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.
Expired tokens will no longer provide access. 5 of 6 6 Additional options like Deleting a token. 6 of 6
- 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.
To add a new access token:
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 |
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:
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
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)
For details on connecting to Tikit using Power BI, check out How to Create a Ticketing Dashboard in Microsoft Teams using Power BI.