PUT Audio
Overview
The following table contains information about the PUT method for managing the process of updating a specific audio.
| PUT Audio | |
|---|---|
| Method | PUT |
| URL or Endpoint | /api/v1/projectId/audios |
| Headers | Authorization |
| Parameters | projectId |
| Body | Check the request body below. |
The description of the URL parameters is as follows:
| URL Parameter Name | Mandatory | Type | Description |
|---|---|---|---|
projectId | Yes | string | Unique ID of the project. |
Request Body
{
"publicId": "{publicId}",
"title": "{title}",
"description": "{description}",
"source": "{source}",
"author": "{author}",
"publishStartDate": "2024-05-28T11:44:17.062Z",
"publishEndDate": "2024-05-28T11:44:17.063Z",
"link": "{link}",
"chapterState": true,
"adScheduleId": "{adScheduleId}",
"customParameters": [
{
"key": "{key}",
"value": "{value}"
}
],
"chapters": [
{
"title": "{chapterTitle}",
"time": 0
}
]
}
Information about the fields that appear when you type in the request body are displayed in the table below.
| Parameter Name | Mandatory | Type | Description |
|---|---|---|---|
| publicId | Yes | string | Unique identifier of the audio |
| title | No | string | Title of the audio |
| description | No | string | Description of the audio |
| source | No | string | Source of the audio |
| author | No | string | Author of the audio |
| publishStartDate | No | string | Start date of audio publishing |
| publishEndDate | No | string | End date of audio publishing |
| link | No | string | Link associated with the audio |
| chapterState | No | boolean | State of audio chapters |
| adScheduleId | No | string | The public ID of the ad schedule to associate with the audio. |
| customParameters | No | array of objects | Custom parameters for the audio |
| chapters | No | array of objects | Chapters associated with the audio |
customParameters Properties
| Parameter Name | Mandatory | Type | Description |
|---|---|---|---|
| key | No | string | Key for custom parameter |
| value | No | string | Value for custom parameter |
chapters Properties
| Parameter Name | Mandatory | Type | Description |
|---|---|---|---|
| title | No | string | Title of the chapter |
| time | No | number | Time in seconds when the chapter ends |
Response
{
"success": true,
"errors": [],
"messages": [],
"result": {
"publicId": "{audioId}",
"title": "{title}",
"description": "{description}",
"source": "{source}",
"author": "{author}",
"publishStatusName": "{publishStatusName}",
"thumbnail": "https://cdn.vpplayer.tech/{projectId}/audio-encode/{audioId}/thumbnails/retina.jpg",
"canEmbed": true,
"link": "{link}",
"chapterState": true,
"duration": 0,
"publishStartDate": "2024-05-28T11:44:17.062Z",
"publishEndDate": "2024-05-28T11:44:17.063Z",
"insertDate": "2024-05-28T11:05:43.4117897",
"adScheduleId": "{adScheduleId}",
"customParameters": [],
"chapters": [
{
"title": "{chapterTitle}",
"time": 0
}
]
},
"resultInfo": null,
"statusCode": 200
}
Information about the fields that appear when you receive the response are displayed in the table below.
Top-Level Properties
| Field Name | Type | Description |
|---|---|---|
| success | boolean | If the response is successful it will return true. Otherwise will return false |
| errors | array[string] | Indicates if there was an error |
| messages | array[string] | Returns the response message from back-end |
| result | object | Returns the response object |
| publicId | string | The unique Id of the audio |
| title | string | Title of the audio |
| description | string | Description of the audio |
| source | string | The source of the audio. |
| author | string | The author of the audio. |
| publishStatusName | string | Name of the publish status. |
| thumbnail | string | URL of the audio's thumbnail image |
| canEmbed | boolean | Indicates whether the audio can be embedded. |
| link | string | Url of the embed. |
| chapterState | boolean | Indicates whether chapters are enabled |
| duration | string | Duration of the audio in seconds |
| publishStartDate | string($date-time) | Date and time when the audio was published |
| publishEndDate | string($date-time) | Date and time when audio will not be available. |
| insertDate | string($date-time) | Date and time when the audio was inserted |
| adScheduleId | string | The public ID of the ad schedule associated with the audio. |
| customParameters | array[object] | An array of custom parameters. |
| chapters | array[object] | Returns an array of chapters. |
| resultInfo | string | Returns extra information about the result |
| statusCode | integer | Returns the HTTP Status Code |
If the action is successful, the service sends back an HTTP 200 or 201 response.
Errors
For information about the errors that are common to all actions, see Common Errors:
HTTP Status Code 400: Bad Request
HTTP Status Code 401: Unauthorized
HTTP Status Code 403: Forbidden
HTTP Status Code 404: Result Not Found
HTTP Status Code 500: Internal Server Error
HTTP Status Code 503: Backend Fetch Failed