Skip to content

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 ready status. 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

  1. 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 Created with the group in draft status and version 1. Note its id:

    { "success": true, "data": { "id": 7, "name": "Hotel lineup", "status": "draft", "version": 1 } }
    
  2. 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 OK with the group and its memberships.

  3. 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 OK with status: "draft" and the channels in data.groups[0].channels, each with chno.

  4. 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 OK with "status": "published" and version raised by 1:

    { "success": true, "data": { "id": 7, "name": "Hotel lineup", "status": "published", "version": 2 } }
    
  5. 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:

    { "success": true, "data": { "sentCount": 3, "total": 3, "version": 3 } }
    

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.

Next steps