Register a streamer and share it with workspaces
Use this guide to add a streamer you already run to your organization and make it available to one or more workspaces for their channels. For the fields and every route, see the Distribution API.
Before you begin¶
- You have an access token for a user with
org:distribution:manage(by default, the organization owner or admin). See Authentication. - You know your organization ID and the IDs of the workspaces that should use the streamer.
- The streamer is running, and PlayTelly can reach its control API port.
Steps¶
-
Register the streamer.
curl -X POST "https://<API_HOST>/api/v1/distribution/<ORG_ID>/streamers" \ -H "Authorization: Bearer <ACCESS_TOKEN>" \ -H "Content-Type: application/json" \ -d '{ "name": "streamer-bkk-01", "host": "streamer-bkk-01.example.com", "publicHost": "live-bkk-01.example.com", "httpPort": 18080, "apiPort": 18081, "role": "ingest" }'<ORG_ID>: your organization ID.hostandapiPort: where PlayTelly reaches the node's control API.publicHostandhttpPort: where viewers fetch playback.role:ingestif the node takes UDP or multicast feeds,cproxyif it only serves and caches.
You get
201 Created. Note theid. The streamer starts withstatus: unknownandaccessMode: selected: -
Check that PlayTelly can reach it.
curl -X POST "https://<API_HOST>/api/v1/distribution/<ORG_ID>/streamers/<STREAMER_ID>/ping" \ -H "Authorization: Bearer <ACCESS_TOKEN>"<STREAMER_ID>is theidfrom step 1. You get:If
statusisoffline, fixhost,apiPortor your firewall before you continue (see Troubleshooting). -
Grant workspaces access.
curl -X PUT "https://<API_HOST>/api/v1/distribution/<ORG_ID>/streamers/<STREAMER_ID>/access" \ -H "Authorization: Bearer <ACCESS_TOKEN>" \ -H "Content-Type: application/json" \ -d '{ "accessMode": "selected", "workspaceIds": ["<WORKSPACE_ID>"] }'List every workspace that should use the streamer; the list replaces the previous one. To open it to every workspace of the organization, send
"accessMode": "all_workspaces"instead. You get:
Verify¶
As a user of one of the workspaces (with workspace:channels:view), list the streamers that workspace may use:
curl "https://<API_HOST>/api/v1/playback/<WORKSPACE_ID>/streamers" \
-H "Authorization: Bearer <ACCESS_TOKEN>"
The new streamer is in the list:
{
"success": true,
"data": [
{ "id": 12, "name": "streamer-bkk-01", "publicHost": "live-bkk-01.example.com", "httpPort": 18080, "role": "ingest", "status": "online", "hasGpu": false }
]
}
The workspace can now choose it when it creates a channel.
Troubleshooting¶
| Symptom | Cause | Fix |
|---|---|---|
403 with "Forbidden - Insufficient permissions" |
<ORG_ID> isn't the organization in your token, or your role lacks org:distribution:manage. |
Use your own organization ID, or ask an organization owner or admin. |
400 "name, host, httpPort and apiPort are required" |
A required field is missing or 0. |
Send all four. |
500 on register |
A streamer with this name already exists in the organization. |
Pick another name, or update the existing streamer. |
Ping returns offline |
PlayTelly can't reach host:apiPort, or the node didn't answer 200. |
Check the address, the port and your firewall, then ping again. |
400 "workspaceIds: every workspace must belong to this organization" |
A workspace ID is wrong or belongs to another organization. | Check the IDs. |
| Streamer missing from the workspace's list | The workspace isn't in workspaceIds and the mode is selected. |
Repeat step 3 with the workspace included. |