Excerpt |
---|
Update a media file to in the dialogportal™ Media Archive. |
The Media Archive provides a public repository for media files. Currently the allowed file type are:
File type | contentType |
---|---|
Image | image/gif , image/jpeg etc. |
Video | application/octet-stream |
application/pdf | |
Javascript | text/javascript , application/x-javascript or text/plain with .js fileName |
Stylesheet | text/css or text/plain with .css fileName |
Font | application/x-font-ttf , application/x-font-woff , application/vnd.ms-fontobject |
Icon | image/x-icon , image/vnd.microsoft.icon |
HTC | text/x-component or text/plain with .htc fileName |
Media in the archive is contained in a folder structure, and file and folder names are unique within their respective folders.
When attempting to create a media file with a name that already exists in the folder, the autoName
field is used to determine the correct action. When autoName
is omitted or set to false
, a 303 response will be returned including a location
header containing the URL to the existing media file. When autoName
is true
, the file will be created with an auto-incremented "index" appended to the file name, "file_1.txt", "file_2.txt" etc.
To add new folders simply include them in your folderPath
. Folders that do not already exist will be createdMedia file content
and description
properties are updateable. The fileName
and folderPath
are used to uniquely identify the media file.
Endpoint ID: | 91009101 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
Method: |
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||
URL: | /content/media | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
Request body: | JSON data with information about the media to be createdupdated.
| Response body: | A JSON object containing the url to the newly created content.
The URL format is:
Note | fileName and folderPath have been sanitized, making them safe to use in a URL. | |||||||||||||||||||||||||||||||||||||||||||||||||||
Response body: | None | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
Status codes: | 201204 | Media created successfully. | 303 | A media file with this name already exists in the folder. The response includes alocation header containing the URL to the existing media file.updated successfully | |||||||||||||||||||||||||||||||||||||||||||||||||||
400.1 | Content type not recognized | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
400.2 | Media files may not be larger than 2MB | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
400.3 | Content type mismatch | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
404.4 | Media file not found | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
404.5 | Folder not found |