Skip to main content

API endpoints

The body worn content destination API is modeled on the OpenStack Swift API. Only a small subset of Swift is used. The system controller (SCU) is the client; your content destination is the server.

For the full specification and example server, see github.com/AxisCommunications/body-worn-content-destination-api.

Endpoint summary​

All endpoints except the auth endpoint require a valid auth token. The auth endpoint requires both a username and key.

MethodPathPurposeSuccessErrors
GET/auth/v1.0Retrieve an auth token200 OK401 Unauthorized
GET/v1/{account}/System/{object}Retrieve an object and metadata200 OK400, 401, 404, 500
PUT/v1/{account}/{container}Create a container201 Created, 202 Accepted400, 401, 403, 404, 500, 503
POST/v1/{account}/{container}Create or update container metadata204 No Content400, 401, 403, 404, 500
PUT/v1/{account}/{container}/{object}Create an object201 Created400, 401, 402, 403, 404, 500, 503, 507
POST/v1/{account}/{container}/{object}Create or update object metadata202 Accepted400, 401, 402, 403, 404, 500

Error response codes​

CodeMeaning
400 Bad RequestThe content destination cannot store the recording (permanently). The recording gets status "not transferred" in BWM and becomes available for download. Use when: timestamp out of bounds, clip has no duration, user ID or device ID doesn't exist.
401 UnauthorizedUser credentials are invalid or auth token is missing.
402 Payment RequiredNo more licenses available when attempting to create a BWC or user.
403 ForbiddenUser permissions are insufficient for the resource.
404 Not FoundThe specific resource is not available.
500 Internal Server ErrorAny other server error.
503 Service UnavailableThe content destination is busy but wants the system controller to retry soon.
507 Insufficient StorageThe content destination is out of disk space or disk quota.

API subgroups​

The API is divided into these functional areas:

SubgroupPurpose
Connection APISet up the connection to the content destination
Capability APIPublish supported capabilities
Access token APIUpload URI and credentials (Keystone-style auth)
Device and user APIManage devices and users
File upload APITransfer recordings from body worn system (BWS) to CD

Authentication​

The Access token API uses Swift Keystone-style authentication:

  1. The SCU sends a GET /auth/v1.0 request with X-Auth-User and Auth-Key headers (from the connection file's BlobAPIUserName and BlobAPIKey).
  2. The content destination responds with X-Auth-Token and X-Storage-Url headers.
  3. All subsequent requests include the X-Auth-Token header.

Device and user management​

The SCU creates objects when users or cameras are registered in BWM:

  • When a user is registered: an object named with the UserID is created in the Users/ container. The user's display name is stored as metadata.
  • When a BWC is registered: an object named with the BWCSerialNumber is created in the Devices/ container. The device name is stored as metadata.

If recording metadata references a user or device that doesn't exist in the content destination, respond with 400 Bad Request.