The Frequency API set gives access to the Frequency video services that provide current short form video content similar to a television channel watching experience. The APIs includes a set of Frequency services defined by REST Frequency API endpoints.
The access convention for the Frequency API is the standard REST operations mapping. The mapping is as follows:
- HTTP POST to create.
- HTTP GET to read.
- HTTP PUT to update.
- HTTP DELETE to delete.
The URI and Versioning
The Frequency SDK uses a URI with an embedded version number. This insures that the clients using the URI API do not break with future non-compatible upgrades and allows for smooth deprecations. The URI format is as follows:
api/[version]/[API service name]
There is no other service version mapping that is resolved within the services. It is a
hard mapping of the URI version number that determines the version of the service that
is accessed by the client.
HTTP Response Codes
Frequency uses the standard HTTP response codes to report error conditions. Frequency uses the following error response code to communicate error conditions back to the caller:
|400 Bad Request||The error condition where URI parameters or the request body elements are invalid.|
|401 Unauthorized||Returned when the X-Frequency-Auth token or X-Frequency_DeviceId is invalid. If this error response is seen, the next step is to do an auth refresh. If an auth refresh returns a 401 then a user login is required.|
|403 Forbidden||A 403 response code is only returned if a user is blocked from the Frequency services.|
|404 Not Found||The service URI was malformed and could not be routed to a Frequency service.|
The header attributes used to support the Frequency SDK are as follows:
|X-Frequency-Auth||The access token|
|X-Frequency-DeviceId||The device id|
The header attributes are expected to be set and used for every API. The HTTP error code 401 is returned if the header X-Frequency-Auth and either X-Frequency-Sdk-Key or X-Frequency-DeviceId are not set.
The authentication APIs that are used to get these attributes are the only exceptions and they are noted in the endpoint documentation.