Authentication
To access Attest study data from an external tool, you need an API key. Learn how to generate one, use it in your requests, and rotate it if it's lost or compromised.
To access Attest results data from an external tool, you need an API key. This allows us to identify you and make sure that only you have access.
How to get an API key
- Log in to your Attest account
- Navigate to Profile & Settings from the side nav.
- Scroll to the API key section
- Click Create API key
- Once the key is generated, click Copy and store it somewhere secure. This is the only time it will be displayed in full. Once you leave or refresh the page, it will no longer be visible. There is no way to retrieve it again afterwards.
Using your API key
Pass your API key in the X-API-Key header on every request:
X-API-Key: your_api_key
For example, with curl:
curl -H "X-API-Key: <API_KEY>" \
https://api.askattest.com/insights/api/v1/studies/{studyId}/structureOr in Python:
import requests
headers = {"X-API-Key": "<API_KEY>"}
response = requests.get(
"https://api.askattest.com/insights/api/v1/studies/{studyId}/structure",
headers=headers
)Rotating your key
If your key is lost or compromised, you can generate a new one at any time by returning to the API Key section in Profile & Settings and clicking Create API key again.
Generating a new key immediately invalidates the old one. Any integration using the old key will stop working as soon as the new key is created. Make sure to update all of your integrations with the new key promptly.