Create
This API creates a media file object to be stored in the CVP Media Servers.
If no serverlist is specified, the media file object is created on all the media servers.
If the operation fails on some servers but not on all servers, the file is created on the server where the operation is successful. The user needs to do a PUT operation on the failed servers to ensure that the file is deployed on all.
If the media file object already exists, the create operation will fail with a “400 Bad Request” error. The user should use a PUT operation instead to update the existing object.
For this API, a 200 OK response will be returned on the successful creation of the media file object in the management database, but the media files will be copied to the media servers. Use the READ (GET) API to poll for the copying status on the individual servers.
To obtain only the summary details, the summary=true flag is used in the GET API.
When the create operation is still in progress, the status of the object is shown as creating.
If the operation is completed on all servers, the status of the object will be shown as created and errorflag as false.
If the requested operation cannot be completed due to some error, the status of the object is shown as created but the errorflag is shown as true. The details of the errors can be obtained using the GET API without the summary parameter to provide a server-wise status description.
URL | https://<ipaddress>:8111/cvp-config /mediafile | ||||||
HTTP Method | POST | ||||||
API Type | Synchronous | ||||||
Input Format |
multipart/form-data | ||||||
Output Format | JSON/XML | ||||||
Parameters | The parameters should be passed as multipart/form-data contents, with the text parameters in a JSON/XML part followed by the binary data as a separate part. Name: path Description: Text parameter containing the relative path in the media location. Required: Yes. Values: Relative path names. For example: en-us/app as used by the application. Validations: Should not contain any (.) or should not be an absolute path. Notes: Passed in XML/JSON body. Name: filename Description: Text parameter containing the media file name. Required: Yes. Values: String values with less than 100 characters. Validations: Should not contain special characters like "~", >, <. Notes: Passed in XML/JSON body. Name: servers Description: List of server reference URLs. Required: No. Values: Contains multiple <server> elements. Notes: Optional parameter containing the server ref list, passed in XML/JSON body. Name: server Description: Reference of individual Unified CVP media server. Required: No. Values: As depicted in CVP Servers section. Notes: Optional parameter containing the server ref, passed in XML/JSON body. Name: file Description: This file will be uploaded. Required: Yes. Values: Multipart form posts as handled by the FORM POST method. Validations: Size of individual file should not exceed MAX_FILE_SIZE (3MB). Notes: Need to be appended by either browser after FORM POST is run or by equivalent code, if done programmatically. | ||||||
Example Request Payload |
This server list body is passed as the first part of multipart/form-data. The WAV file that contains the media content is attached as the second part.
|
Sample Java Code | |
Sample Response Header |
Category | HTTP Status | Error Code | Error Description | Error data | Error Detail |
---|---|---|---|---|---|
Authentication | 401 | authorization.unathorized | Unauthorized request | NA | NA |
Authentication | 401 | authentication.notAuthorized | User is not authorized to access the requested resource | NA | NA |
Authentication | 401 | authentication.noAccess | User is not allowed to access the resource. Check the user roles | NA | NA |
Input Output Formatting | 400 | processing.jsonSyntaxError | JSON syntax error while processing the request attachement | NA | NA |
Input Output Formatting | 400 | processing.xmlSyntaxError | XML Syntax error while processing the request attachement | NA | NA |
CREATE Media file Validation | 400 | invalid.noOfAttachments | Incorrect number of attachments received | NA | NA |
CREATE Media file Validation | 400 | invalid.format | URL cannot be decoded using UTF-8 | NA | NA |
CREATE Media file Validation | 400 | invalid.inputUploadConfig | Input xml/json is empty | NA | NA |
CREATE Media file Validation | 400 | invalid.inputMediaFile | Input media file missing | NA | NA |
CREATE Media file Validation | 400 | invalid.requestAttachment | Malformed JSON in request attachment | NA | NA |
CREATE Media file Validation | 400 | invalid.attachment | Request attachment IO Error | NA | NA |
CREATE Media file Validation | 400 | invalidInput.invalidCharacter | Invalid characters in the input field | Field Name which has invalid characters | InvalidValueErrorDetail |
CREATE Media file Validation | 400 | invalidInput.invalidFieldLength | Invalid length of input field | Field Name which has invalid length | StringLengthErrorDetail |
CREATE Media file Validation | 400 | invalidInput.invalidMediaServerRef | Invalid Media Server Ref URL | serverRef | InvalidValueErrorDetail |
CREATE Media file Validation | 400 | invalidInput.invalidMediaFileExtension | Invalid Media File Extension | fileName | InvalidValueErrorDetail |
CREATE Media file Validation | 400 | invalidInput.requiredInputfieldMissing | Required Input Field is missing | Missing Required Input field | RequiredFieldErrorDetail |
CREATE Media file Validation | 400 | invalidInput.incompatibleServerVersion | Listed Media Server version is incompatible | serverRef | InvalidValueErrorDetail |
CREATE Media file Validation | 400 | invalidInput.serverInformationNotAvailable | Listed server information not available | serverRef | InvalidValueErrorDetail |
CREATE Media file Validation | 400 | invalidInput.invalidDirDepth | The Directory dept in the path field is greater than the maximum allowed | path | StringLengthErrorDetail |
CREATE Media file Validation | 400 | invalidInput.duplicateServerRef | There is a duplicate entry in the Server list sent in the request | serverList | InvalidValueErrorDetail |
CREATE Media file Validation | 400 | invalid.inputMediaFile | File Size out of valid range | NA | FileSizeErrorDetail |
For more information on common error codes, see Unified CVP API Error Codes