API¶
The RESTful API of Ella PSAP, under /api/v1, and the incident data shared with other agencies, under /IncidentData.
Authentication¶
Requests send a token in the Authorization header:
Authorization: Bearer <token>
The token is either:
- an access token, from log in, refresh the access token or initialize, valid for 15 minutes;
- an API token, which starts with
ellapsap_.
These paths take no token: GET /IncidentData/Versions, GET /api/v1/livez, GET /api/v1/readyz, GET /api/v1/status, GET /api/v1/metrics, GET /api/v1/openapi.yaml, POST /api/v1/init, POST /api/v1/auth/login, /refresh and /logout, and GET /api/v1/auth/oidc, /oidc/login and /oidc/callback.
Roles¶
The roles a user can have.
| Role | role_id |
Allows |
|---|---|---|
| Admin | 1 |
Everything. |
| Call Taker | 2 |
Handling incidents, with their calls, texts and AML reports, and managing their own password and availability. |
| Dispatch System | 3 |
Listing incidents and retrieving their EIDOs, with an API token only. |
Responses¶
Ella PSAP's API responses are JSON objects. A successful response carries a result:
{
"result": "Result content"
}
A failed response carries an error:
{
"error": "Error message"
}
OpenAPI Specification¶
An OpenAPI 3.1 specification describes the full API:
GET /api/v1/openapi.yaml
Status codes¶
HTTP status codes the API answers with.
- 200 - Success.
- 201 - Created.
- 204 - No content.
- 400 - Bad request.
- 401 - Unauthorized.
- 403 - Forbidden.
- 404 - Not found.
- 405 - Method not allowed.
- 409 - Conflict.
- 429 - Too many requests.
- 500 - Internal server error.
- 502 - Bad gateway.
- 503 - Not ready. See Check readiness.