Make Your First API Call

Create a live channel with Postman or curl: POST /v2/channel, X-Api-Key, X-Format, channel_type and region.

This walkthrough creates a live channel with POST /v2/channel. Use Postman (or curl) so you can see the request and the 201 response before you wire the same call into your app.

You need an API key first: Obtain API Keys.

📘

Host: https://developer.dacast.com. Headers: X-Api-Key and X-Format: default. JSON bodies need Content-Type: application/json. Create channel returns 201.

The same call, without Postman:

curl -X POST "https://developer.dacast.com/v2/channel" \
  -H "X-Api-Key: insertYourApiKeyHere" \
  -H "X-Format: default" \
  -H "Content-Type: application/json" \
  -d "{\"title\":\"My First Channel\",\"description\":\"I am a test\",\"channel_type\":\"transmux\",\"region\":\"north_america\"}"

Store id from the JSON body. Encoder settings are in config (publishing_point_primary + stream_name). Full detail: Create Live Streams Channels and Create Stream.


What you send

MethodPOST
Path/v2/channel
titleChannel name (required)
descriptionShort description
regionnorth_america, europe, or asia_pacific - closest to the encoder
channel_typetransmux (passthrough) is enough for a first call. Other values: sd-transcode / hd-transcode / fhd-transcode, or hls.

Do not send rendition_count. That field is not used on create.


Postman

Create a collection. On the collection Variables tab, define BASE_URL and API_KEY so you can reuse them on every request.

BASE_URL should be https://developer.dacast.com. API_KEY is the key from the UI.

Postman collection variables for BASE_URL and API_KEY

Set the API key to your key and hit Save, or the variables will not resolve.

Add a request under the collection:

Add a request in Postman

Set the method to POST and the URL to \{\{BASE_URL}}/v2/channel. On the Headers tab add:

  • X-Api-Key = \{\{API_KEY}}
  • X-Format = default
Postman headers X-Api-Key and X-Format

If the variables show as orange, they resolved. If they are red, go back to the collection variables, check the names, and Save.

On the Body tab choose raw and JSON, then paste:

{
  "title": "My First Channel",
  "description": "I am a test",
  "channel_type": "transmux",
  "region": "north_america"
}

The screenshot below is the Postman Body tab (old sample JSON). Use the object above, not rendition_count.

Postman Body tab, raw JSON

Send the request:

Postman Send

A successful call returns 201 and a channel object with id and config. If you get error getting channel list (or similar) on a later GET, you are missing X-Format: default. See Common Issues.


Next