Publish a group
Use this guide to build a lineup of channels with channel numbers, publish it, and send it to playout devices. For the fields and rules, see the Playback API.
Before you begin¶
- Your role in the workspace has
workspace:channels:manage. - You have at least one channel in
readystatus. See Create a live channel. - You know the ID of a space whose devices should receive the group (from the Spatial API), and the devices are paired. See the Provisioning API.
Steps¶
-
Create the group:
curl -s -X POST "https://<API_HOST>/api/v1/playback/<WORKSPACE_ID>/channel-groups" \ -H "Authorization: Bearer <ACCESS_TOKEN>" \ -H "Content-Type: application/json" \ -d '{ "name": "Hotel lineup", "description": "Channels for guest rooms" }'You get
201 Createdwith the group indraftstatus andversion1. Note itsid: -
Set the lineup. This replaces the whole lineup: channels you leave out are removed. Every channel must be
ready, and each channel number (lcn) is used once:curl -s -X PUT "https://<API_HOST>/api/v1/playback/<WORKSPACE_ID>/channel-groups/<GROUP_ID>/channels" \ -H "Authorization: Bearer <ACCESS_TOKEN>" \ -H "Content-Type: application/json" \ -d '{ "channels": [ { "channelId": 42, "lcn": 1 }, { "channelId": 43, "lcn": 2 } ] }'You get
200 OKwith the group and its memberships. -
Preview what a device will receive. This works for a draft group:
curl -s "https://<API_HOST>/api/v1/playback/<WORKSPACE_ID>/channel-groups/<GROUP_ID>/payload" \ -H "Authorization: Bearer <ACCESS_TOKEN>"You get
200 OKwithstatus: "draft"and the channels indata.groups[0].channels, each withchno. -
Publish the group:
curl -s -X PUT "https://<API_HOST>/api/v1/playback/<WORKSPACE_ID>/channel-groups/<GROUP_ID>" \ -H "Authorization: Bearer <ACCESS_TOKEN>" \ -H "Content-Type: application/json" \ -d '{ "status": "published" }'You get
200 OKwith"status": "published"andversionraised by 1: -
Push the group to the devices in a space:
curl -s -X POST "https://<API_HOST>/api/v1/playback/<WORKSPACE_ID>/channel-groups/<GROUP_ID>/push" \ -H "Authorization: Bearer <ACCESS_TOKEN>" \ -H "Content-Type: application/json" \ -d '{ "spaceIds": ["<SPACE_ID>"] }'You get
200 OK:
Verify¶
sentCount equals total when every eligible device accepted the group. sentCount: 0 means nothing changed.
A device with the group shows its channels in lineup order. A device can also read the published groups itself with
GET /channel-groups, using its device token.
Troubleshooting¶
| Symptom | Cause | Fix |
|---|---|---|
400 channel … is not ready |
A channel in the lineup is draft |
PATCH /channels/{id}/status with {"status": "ready"}. |
409 a channel group needs at least one channel… |
The group is empty | Set the lineup first (step 2). |
409 … channel(s) in this group are missing or not ready |
A channel was deleted or set back to draft |
Fix the lineup or mark the channel ready. |
409 publish the channel group before pushing… |
The group is a draft | Publish it (step 4). |
total is 0 |
No eligible device in those spaces: devices must belong to your organization and be unassigned or in this workspace | Check the space IDs and the devices' assignment. |
503 |
The devices couldn't be reached | Retry later. |