Common Issues
Headers, ajax upload, playlist vs playlists, embed escaping, and other API gotchas.
Things that usually look like an API bug and are not. For the upload, playlist, embed, and live flows themselves, start from the linked guide.
Headers
Every Dacast API call needs:
X-Api-Key- your keyX-Format: default
JSON request bodies also need Content-Type: application/json.
If the body is error getting vod list / error getting channel list / error getting playlist list (or similar), the X-Format header is missing.
A 401 is almost always a missing or wrong API key.
Call developer.dacast.com from your server
developer.dacast.com from your serverDo not send X-Api-Key from a browser page. That exposes the key, and the API does not allow cross-origin calls.
Ajax uploads are the exception after you already have a signature: get the signature on the server, then POST the file from the browser to https://{bucket} (S3). Do not POST the file to developer.dacast.com.
Ajax upload to storage fails
The signed form is not “POST every field from the JSON, including bucket, to https://upload.dacast.com”.
- Host is
https://{bucket}from the signature. Do not hardcode the host. - Do not send
bucketas a form field. - Send every other signature field, including
x-amz-algorithm. filemust be last.- Success is typically 201.
Same rules for VOD Upload and Splash Screen/Thumbnail.
I uploaded a VOD and I have no id
Ajax POST /v2/vod returns S3 form fields, not a VOD record. The last segment of key is not the VOD id.
List videos after the file lands (indexing can lag up to 60s) and take the new row. Details: VOD Upload.
The same lag shows up after playlist content updates and some creates: the write can return 200 while a following GET still looks empty. Retry the GET.
playlist vs playlists
playlist vs playlists| What | Path |
|---|---|
| Create, list, lookup, update, content, delete | /v2/playlists (plural) |
| Embed, splash, thumbnail | /v2/playlist/{id}/… (singular) |
/v2/playlists/{id}/splash and …/thumbnail return 500. /v2/playlists/{id}/embed/… can return 200 with a contentId / iframe path the player does not use.
Playlist content did not change
PUT /v2/playlists/{id}/content:
contentis a JSON string, not a raw array.- The list is a full replace. To add one item, send the existing items plus the new one.
- The VOD must be online.
- The PUT body may still have
content.list: null. Confirm withGET /v2/playlists/{id}.
See Playlists.
Embed code looks escaped
code looks escapedGET …/embed/javascript and …/embed/iframe return JSON { "code": "…" } with < / > as \u003c / \u003e. Parse the JSON and insert code as HTML. Do not unescape() the raw string.
Use playlist (singular) in the path. Embed codes.
Live: wrong host, or old rendition_count samples
rendition_count samplesRead encoder settings from config on create/lookup. Do not hardcode the RTMP/SRT/WHIP host; it depends on region.
Create uses channel_type (transmux, sd-transcode / hd-transcode / fhd-transcode, hls), not rendition_count. Create Live Streams Channels.
A successful channel create returns 201. Playlist create returns 200. Deletes return 204.
400 and 500
400 - the JSON body usually has message and detail (for example upload_type is required). Fix the request from detail.
500 - retry once. If it repeats, open a ticket.
Tickets for issues you cannot resolveEmail [email protected] and include:
- The account owner email (the login address)
- Full request URL, headers, and body (you can redact the API key)
- Response status, headers, and body
- What you expected, and what happened
- A short note on what you are trying to do
Updated about 16 hours ago
