Getting started with REST API

This section covers specifics of the Direct Take REST API

Enable REST API Control

To enable REST API based control of Direct Take, you should run it with the administrator privileges, and go to Preferences:

Once the prefix is set, Direct Take is available for remote control.

General Notes

The type of request content is JSON: application/json

When you create or update resources, you don't need to put all the fields in JSON. All the unspecified fields keep the existing values for PUT, or set with the default values for POST.

All valid responses have the code 200 (OK). If something is wrong, the API returns the code 400 (Bad Request).

Authorization

You should use the REST API Token with all the requests as the "Authorization" header. The token is provided with a license for Direct Take. You can copy the token from the Preferences menu.

Example: "Bearer perm:2cc39f38-d120-46fa-9d90-359375b4eb26"

REST API URL in Direct Take

Direct Take's REST API is available by the following URL:

http://{server_address}:{port_number}/api/

/api/ is the context path for the REST API of the service.

Typical method

GET http://localhost:9000/api/sources/{index}

Returns you a configuration of a source with the specified index. If the index is not set, returns you all the sources in a single response.

Query Parameters

Headers

{
  "VideoDevice": {
    "Type": 0,
    "Name": "Logitech BRIO"
  },
  "Name": "Source 1",
  "AudioMeters": [
    0.0,
    0.0
  ],
  "VideoLines": [],
  "VideoLine": null,
  "VideoFormats": [
    "YUY2 640x480@30.00p 4:3",
    "YUY2 800x600@30.00p 4:3",
    "YUY2 1280x720@30.00p 16:9",
    "HD1080-30p YUY2 1920x1080@30.00p 16:9"
  ],
  "VideoFormat": null,
  "AudioDevice": null,
  "AudioFormats": [],
  "AudioFormat": null,
  "StreamBuffer": 5,
  "StreamURL": null,
  "LTCTimecode": null,
  "AudioGain": 0.0
}

Last updated