Notifications

Notifications provide alerts based off of specific events. Examples include when titles change play state, when titles data is updated, or when a system event happens.

getSubscriptions

get

Get a list of all active subscriptions with their sender names, inputs, titles, and events.

Query parameters
requestIdstringOptional

optional id to track this command, will be returned in the response

senderstringOptional

The name of the subscription you are querying. Leave blank to retrieve all subscriptions.

Responses
200
successful operation
application/json
get
GET /api/command/getSubscriptions HTTP/1.1
Host: 127.0.0.1:9022
Accept: */*
{
  "result": {
    "command": "getSubscriptions",
    "reply": "getSubscriptions",
    "sender": "",
    "senders": [
      {
        "events": "play,control,data,play-data",
        "id": "",
        "input": "",
        "is_default": "1",
        "name": ""
      }
    ],
    "success": true
  }
}

subscribe

get

Configure a notification subscription to get information when titles change play state, when their data is updated, or when a system event happens. You can subscribe to notifications that originate from a specific "sender" and can specify an input and title id, both or neither. Internally, Captivate registers a different subscription for each "sender" and each "sender" can specify one or more inputs, title ids, and events, each separated by commas to filter which notifications that sender will send. If a sender by the provided name doesn't exist, it will be created. If a sender by the name already exists, the events, inputs, and title ids will be appended to the existing ones. NOTE: In the JavaScript/WebSocket API, all connected clients get all notifications from all subscriptions, so you will need to do your own filtering by sender, input, and/or title id on each received notification.

Because this endpoint doesn't use any variables, it can also be accessed using a GET request.

Query parameters
requestIdstringOptional

optional id to track this command, will be returned in the response

idstringOptional

Comma-separated list of title ids. Use empty string or "all" for all titles.

inputstringOptional

Comma-separated list of input names. Use empty string or "all" for all inputs.

senderstringOptional

The name of the subscription you are creating/modifying.

eventsstringOptional

Comma-separated list of event types. Currently, 'play' for play state, 'data' for variable updates, and 'event.*' for other events like chat message updates. For specific events, you can specify them individually too, like 'event.onchatmessageevent'

Example: play,data
Responses
200
successful operation
application/json
Responseobject
get
GET /api/command/subscribe HTTP/1.1
Host: 127.0.0.1:9022
Accept: */*
{}

unSubscribe

get

Remove a title, input, or event from a notification subscription identified by "sender." When a sender has no events, it will be removed from the Captivate subscription list.

Query parameters
requestIdstringOptional

optional id to track this command, will be returned in the response

idstringOptional

Comma-separated list of title ids. Use empty string or "all" for all titles.

Example: all
inputstringOptional

Comma-separated list of input names. Use empty string or "all" for all inputs.

senderstringOptional

The name of the subscription you are modifying.

eventsstringOptional

Comma-separated list of event types. Currently, 'play' for play state and 'data' for variable updates

Example: play,data
Responses
200
successful operation
application/json
get
GET /api/command/unSubscribe HTTP/1.1
Host: 127.0.0.1:9022
Accept: */*
{
  "result": {
    "command": "unSubscribe",
    "error": "cannot do an unsubscribe with the default notification sender",
    "id": "all",
    "reply": "unSubscribe",
    "success": true
  }
}

Last updated