get content
Returns a piece of content. A user can view a piece of content if:
They own the content
If they have an appropriate content viewer/editor role
If a user is not allowed to view the content, a 404 is returned.
Time zones
Providing a timezone
param will result in returning a piece of content with chapters where:
availableFrom
is set to a date up to and including today in the provided time zoneavailableFrom
is null or absent
Currently this only applies to podcast content; providing the timezone
param for non-podcast content will not affect the chapters returned.
Valid timezone identifiers can be found here. A 400 response will be returned if an invalid time zone is provided. If no timezone
param is provided, then chapters are returned based on the UTC timezone.
Responses
200 OK application/json
cardobject
contentobject
chaptersarray
configobject
editSettingsobject
metadataobject
coverobject
mediaobject
{ "card": { "cardId": "iMG7o", "content": { "activity": "yoto_Player", "chapters": [], "config": {}, "editSettings": { "autoOverlayLabels": "disabled", "editKeys": false, "transcodeAudioUploads": true }, "version": "1" }, "createdAt": "2021-05-07T14:08:26.435Z", "creatorEmail": "theresa.may.1@yotoplay.com", "deleted": false, "metadata": { "category": "none", "cover": {}, "media": { "duration": 1419, "fileSize": 0, "hasStreams": false } }, "shareLimit": 0, "shareLinkCreatedAt": "2022-03-03T00:00:00.000Z", "slug": "5VmJm1wxphhSh0by74XQbw", "title": "something blah", "updatedAt": "2023-06-22T10:16:53.717Z", "userId": "auth0|65afcb79a4f5ae5550e6e63a" }}
400 Bad Request (Invalid timezone) application/json
errorobject
{ "error": { "code": "bad-request", "message": "Invalid timezone provided." }}
404 Not Found application/json
errorobject
{ "error": { "code": "not-found", "message": "Card abc123 does not exist." }}
Query Parameters
Timezone identifier
Pacific/Auckland
The type of playable signed URLs returned. Use with `playable`.
s3
Return playable signed URLs
true
Path Parameters
/content/{cardId}
Authorization (bearerAuth)
Query Parameters
KEY | VALUE |
---|---|
curl "https://api.yotoplay.com/content/{cardId}"--header "Authorization: Bearer [YOUR_TOKEN]"
const options = { method: 'GET', headers: { 'Authorization': 'Bearer [YOUR_TOKEN]' }};
fetch('https://api.yotoplay.com/content/{cardId}', options) .then(response => response.json()) .then(response => console.log(response)) .catch(err => console.error(err));
<?php
$curl = curl_init();
curl_setopt_array($curl, [ CURLOPT_URL => "https://api.yotoplay.com/content/{cardId}", CURLOPT_RETURNTRANSFER => true, CURLOPT_ENCODING => "", CURLOPT_MAXREDIRS => 10, CURLOPT_TIMEOUT => 30, CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1, CURLOPT_CUSTOMREQUEST => "GET", CURLOPT_HTTPHEADER => [ "Authorization: Bearer [YOUR_TOKEN]" ],]);
$response = curl_exec($curl);$err = curl_error($curl);
curl_close($curl);
if ($err) { echo "cURL Error #:" . $err;} else { echo $response;}
import requests
url = "https://api.yotoplay.com/content/{cardId}"
headers = { "Authorization": "Bearer [YOUR_TOKEN]"}
response = requests.request("GET", url, headers=headers)
print(response.text)