Creating access keys for the Asta Vision API
You use the API Keys page to create and delete API access keys, which enable users to access the Asta Vision API and to construct requests with the access rights of a specific Asta Vision user. The API access keys are displayed in a list, with the list displaying the user that has been specified for each key and the expiry date of each key. You can filter and sort the API access keys in the list and change the width of columns in the list.
To access the API Keys page from the Asta Vision Home page, click Admin then click API Keys.
You need to supply an API access key as a header when constructing requests in an external application that accesses data using the Asta Vision API. For each API access key, you specify a user - so you should create one API access key for each Asta Vision user that will access the API. The specified user's Asta Vision access rights apply to all API calls that are made using the key, and any new programme versions that are created by an API call are recorded as having been created by that user.
For example:
- If you supply an API access key that specifies an Asta Vision user with full access rights over all data - an administrator user - as a header in an API request that GETs information on Asta Vision projects, information on all projects will be returned.
- If you supply an API access key that specifies an Asta Vision user with full access rights over some, but not all, projects as a header in an API request that GETs information on Asta Vision projects, only information on the projects to which the user has access will be returned.
- If you supply an API access key that specifies an Asta Vision user with read-only access rights over projects as a header in an API request that POSTs information to Asta Vision projects, the request will fail, as the user has insufficient access rights to POST.
To create an API access key:
- On the API Keys page, click Create Key. The Create API Key dialog appears.
- Select the user whose Asta Vision access rights should apply when this key is supplied as a header in an API request in the Assigned User field.
- Specify the length of time for which the API access key should remain active in the Duration field. For example, if you want the key to be usable for three months, select '3 months' in this field. The start date and time of an API access key is the date and time at which it is created.
- Click Create. The New API Key dialog appears, displaying the new API access key.
- Click Copy to Clipboard to copy the new API access key to the Windows Clipboard, from where you can subsequently paste it into another application.
This is the only chance you will have of copying the new API access key: once you close this dialog, you cannot access the key again, so ensure that you take, and retain, a copy of it.
If you fail to take a copy of an API access key, or if you lose the copy you have taken, you will need to create a new API access key. - Click Close. You return to the API Keys page, where the new API access key appears in the list.
Once you have created an API access key, you can supply it as a header when constructing requests in an external application that accesses data using the Asta Vision API. Every request must include an API access key supplied as a header.
Example of a request header containing an API access key:
Authorization: Bearer <token>
Where <token> is replaced by an API access key.
If you delete an API access key, it becomes invalid and is no longer usable.
To delete an API access key:
- On the API Keys page, right-click the API key that you want to delete and select Delete. A popup appears, asking you to confirm whether you want to delete the API key.
- Click OK to delete the API key and return to the API Keys page.