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
Content-Type: application/json
cardobject
cardIdstring
contentobject
activitystring
chaptersarray
[items]
configobject
editSettingsobject
autoOverlayLabelsstring
editKeysboolean
transcodeAudioUploadsboolean
versionstring
createdAtstring
creatorEmailstring
deletedboolean
metadataobject
categorystring
coverobject
mediaobject
durationnumber
fileSizenumber
hasStreamsboolean
shareLimitnumber
shareLinkCreatedAtstring
slugstring
titlestring
updatedAtstring
userIdstring
{ "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)
Content-Type: application/json
errorobject
codestring
messagestring
{ "error": { "code": "bad-request", "message": "Invalid timezone provided." } }
404 Not Found
Content-Type: application/json
errorobject
codestring
messagestring
{ "error": { "code": "not-found", "message": "Card abc123 does not exist." } }
Parameters
Query Parameters
timezone
Timezone identifier
Type
string
signingType
The type of playable signed URLs returned. Use with `playable`.
Type
string
playable
Return playable signed URLs
Type
string
Path Parameters
contentId
Type
string
GET
/content/{contentId}
Server URL:https://api.yotoplay.com
Authorization
bearerAuth
Query Parameters
KEY | VALUE |
---|---|
Samples
curl "https://api.yotoplay.com/content/{contentId}" --header "Authorization: Bearer [YOUR_TOKEN]"
const options = { method: 'GET', headers: { 'Authorization': 'Bearer [YOUR_TOKEN]' } }; fetch('https://api.yotoplay.com/content/{contentId}', 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/{contentId}",
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/{contentId}" headers = { 'Authorization: Bearer [YOUR_TOKEN]' } response = requests.request("GET", url, headers=headers) print(response.text)