create or update content
POST
/content
This creates new content, or updates existing content.
-
To create new content, the cardId should not be provided
-
To update existing content, its cardId should be provided
An example of the properties that can be set for card content can be found here.
Example Request Body:
{
"cardId": "",
"title": "Test file validation",
"deleted": false,
"createdAt": "",
"updatedAt": "",
"content": {
"activity": "yoto_Player",
"chapters": [
{
"title": "Centrifuge",
"key": "4eda8628-acd8-4298-bec6-17cc33...",
"tracks": [
{
"title": "Centrifuge.mp3",
"trackUrl": "uo-7xRmZo8UynxgT_brGPrvXHCT5L_...",
"key": "4eda8628-acd8-4298-bec6-17cc33...",
"format": "mpeg",
"uid": "",
"type": "audio",
"overlayLabel": "",
"duration": 170,
"fileSize": 5473506,
"channels": "stereo"
}
],
"_status": {
"status": "uploaded",
"file": {},
"percentage": 100,
"error": null
}
}
],
"restricted": true,
"config": {
"onlineOnly": false
},
"version": 1
},
"metadata": {}
}
Example Response 1:
{
"card": {
"_id": "",
"title": "",
"content": {
"chapters": [],
"playbackType": "",
"config": {
"resumeTimeout": 0
}
},
"metadata": {},
"cardId": "",
"userId": "",
"createdAt": "",
"updatedAt": ""
}
}
Example Response 2:
{
"card": {
"cardId": "",
"title": "",
"content": {
"chapters": [],
"playbackType": "",
"config": {
"resumeTimeout": 0
}
},
"metadata": {
"description": ""
},
"updatedAt": ""
}
}
Authorizations
bearerAuth
TypeHTTP (bearer)
Request Body
application/json
JSON
{
"cardId": "31yYU",
"content": {
"chapters": [
{
"availableFrom": "2024-12-16",
"title": "One"
}
]
},
"metadata": {
"description": "My new Podcast"
},
"title": "Testing Podcast"
}
Responses
200 OK (Create a card) / 200 OK (Update a card)
application/json
JSON
{
"card": {
"_id": "676016ea43bedbaa54a70549",
"cardId": "31yYU",
"content": {
"chapters": [
],
"config": {
"resumeTimeout": 2592000
},
"playbackType": "linear"
},
"createdAt": "2024-12-16T12:02:50.164Z",
"metadata": {
},
"title": "Testing Podcast",
"updatedAt": "2024-12-16T12:02:50.164Z",
"userId": "2kRM9HdDaanNVdLqnjn1d5xFH46Ffmkh@clients"
}
}