Networked Media Open Specifications

APIs

←Security and authorization · Index↑ · API requests→

API Specifications

The Configuration API is specified using:

Examples of JSON format output are provided in the examples folder.

API Validation

JSON schemas are included with the RAML API definitions. These schemas validate the communication with the API. It is RECOMMENDED that implementers of a Configuration API use these JSON schemas as part of a validation stage when receiving interactions from clients. Note that where schemas reference MS-05-02 datatypes defined in the NMOS Control Framework specification and NMOS Feature Sets Register, these datatypes are not validated by the JSON schemas.

Content Types

All APIs MUST provide a JSON representation signalled via ‘Content-Type: application/json’ headers. This SHOULD be the default content type in the absence of any requested alternative by clients. Other content types (such as HTML) are permitted if they are explicitly requested via Accept headers.

API Paths

All NMOS APIs MUST use a path in the following format. Other HTTP resources MAY be presented on the same port by the Node, provided all NMOS resources are available from the /x-nmos/ path as follows:

http(s)://<ip address or hostname>:<port>/x-nmos/<api type>/<api version>/

At each level of the API from the base resource onwards, the response SHOULD include a JSON format array of the child resources available from that point.

Nodes MAY extend the path for the Configuration API with a suffix. For example, a Node implementation might choose to extend the path so that Devices on the Node have separate Configuration API instances without having to use a different port for each Device’s API. Such a path MUST be formatted as follows:

http(s)://<ip address or hostname>:<port>/x-nmos/<api type>/<api version>/<api selector>/

The <api selector> identifier MUST conform to the following regex pattern:

^[a-zA-Z0-9\-_]+$

This permits the use of a UUID, such as an associated IS-04 Device id, in the usual format or succinct local identifiers such as slot2B. Human-readable information can be provided, for example, via the IS-04 Device label and description.

Versioning

All public APIs are versioned as follows:

Versioning Example

A v1.1 API response may include:

Common API Base Resource

[
  "v1.0/",
  "v2.0/",
  "v3.0/"
]

URLs: Approach to Trailing Slashes

For consistency and in order to adhere to how these APIs are specified in RAML, the ‘primary’ path for every resource has the trailing slash omitted.

In order to overcome shortcomings in some common libraries, the following requirements are imposed for the support of URL paths with or without trailing slashes.

GET and HEAD Requests

All Other Requests (PUT, POST, DELETE, OPTIONS etc)

Error Codes & Responses

The NMOS APIs use HTTP status codes to indicate success, failure and other cases to clients as per RFC 7231 and related standards. Where the RAML specification of an API specifies explicit response codes it is expected that a client will handle these cases in a particular way. As explicit handling of every possible HTTP response code is not expected, clients must instead implement more generic handling for ranges of response codes (1xx, 2xx, 3xx, 4xx and 5xx).

←Security and authorization · Index↑ · API requests→