Working with the API
Pictorus has an API that allows you to work with your devices and projects programmatically. This is a powerful tool for helping you automate tasks, integrate with CI/CD pipelines, and manage resources for your team. The available API endpoints are documented at https://api.pictor.us/public/docs.
Authentication
To use the API, you will need to authenticate using an API key that is linked to a specific user and team.
Creating an API Key
You can create API keys by going to the Connections tab in the settings page. From here, you can create and manage your API keys. To create a new API key, click on the "Create API Key" button, give the new key a name, and click "Save". The new key will be listed in the API Keys section. Click the eye icon to display the key, copy it to your clipboard, and store it in a safe place.
Using the API Key
You can authenticate requests to the API in 3 ways:
- HTTP Header: Include the API key in the
X-API-Key
header of your request. - Query Parameter: Include the API key in the
api_key
query parameter of your request. - Cookie: Include the API key in the
X-API-Key
cookie of your request.
Example Request
To get a list of devices, you can use the following curl command, replacing <API_KEY> with the key you created in the previous step:
curl -L https://api.pictor.us/public/v1/devices -H "X-API-Key: <API_KEY>" -H 'Accept: application/json'