Coginiti users can use an HTTP API to interact with Coginiti through 3rd party applications.
Base URL
All API URLs referenced in this documentation have the following base URL unless otherwise specified:
{hostname}/api/v1
Authentication
The Coginiti HTTP API requires authentication with a personal access token created in the Coginiti UI. Please follow the instructions here on how to create a personal access token.
API requests that use a token must use the Authorization header. The header's value must specify the Bearer
type followed by a space and the access token: Bearer {Token}
. The following example request a script execution and shows how to use access token in an API request:
curl -X POST '{hostname}/api/v1/exec/script' \
--header "Authorization: Bearer eyJhbGcibiJIUzsxMiJ9.eyJqdGkiOiI5MzQ4OTA1MC03NGI2LTExZWUtOTM0MC1iN2I2ZjFmMTA1OTUiLCJpc3MiOiJBZ2luaXR5IFRlYW0iLCJzdWIiOiJhYjljNTAzZi1lNGJhLTExZWItOWVmZS0wZmE2YmU3NDFhN2IiLCJpYXQiOjE2OTg0MDM3OTksIm5iZiI6MTY5ODQwMzc5OSwidXNlcklkIjoiYWI5YzUwM2YtZTRiYS0xMWViLTllZmUtMGZhNmJlNzQxYTdiIn0.bJCWzk3imWhpc9VFRgnfhIBI5OzyQxozVha9CHrwdKmOtxXOQv3nk8nL8BVWCf1kizNzaa6_VhYr59rqUvjURA" \
--header 'Content-Type: application/json' \
--data-raw '{
"path": "rn/pivot",
"connection": {
"name": "My Connection"
}
}'
Errors
Coginiti API uses conventional HTTP response codes to indicate the success or failure of an API request. In general: Codes in the 2xx
range indicate success. Codes in the 4xx
range indicate an error that failed given the information provided. Codes in the 5xx
range indicate an internal error with the Coginiti server.
Code | Description |
---|---|
200 - OK | Everything worked as expected. |
400 - Bad Request | The request was unacceptable since it didn’t pass validation (for example, missing a required parameter). |
401 - Unauthorized | No valid API key was provided. |
403 - Forbidden | The API key doesn’t have permission to perform the request. |
404 - Not Found | The requested resource doesn’t exist. |
409 - Conflict | The request conflicts with another request (for example, when performing optimistic lock check) |
500, 502, 503, 504 - Server Errors |
Something went wrong on our side. |
General error format
Error messages will be sent back in the response body using the following format:
{ "message": "The request was unacceptable, since it didn’t pass validation", "detail": "Name field should not be blank", }
Where
Field | Description |
---|---|
message | A brief human-readable message |
detail | A lengthier explanation of the error. It is optional and not always specified. |