Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 10 Next »

Update a media file in the dialogportal™ Media Archive.

Media file content, contentType and description properties are updateable. The fileName and folderPath are used to uniquely identify the media file.

Endpoint ID:

9101

Method:

PUT

URL:

/content/media

Request body:

JSON data with information about the media to be updated.

Required fields:
 

fileName

The media file name.

Optional fields:
 folderPathThe folder path of the media file to be updated. This path is not the entire URL (which also contains the customer name, fileName etc.) but simply a "/"-delimited string of folder names. Exclude the folderPath to update a file in the root folder.
Optional updatable fields:
 content

The content, formatted as a base64 encoded text string.

 description

A description that will be displayed in dialogportal™

 contentType

The content mime-type, i.e. "image/gif" or "text/plain". The content type may only be changed to another content type with the same resulting media file type - that is, an Image media file with content type "image/gif" may be changed to "image/png", but not to "text/css".

Example: Update a single pixel image
 {
   "fileName": "clear_1x1.gif",
   "folderPath": "assets/generic_images/small",
   "content": "R0lGODlhAQABAIAAAP///wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==",
   "description" : "This is a media description.",
   "contentType": "image/gif"
}

Response body:

None

Status codes:

204

Media updated successfully.

 404Media file not found.
 400.1Content type not recognized
 400.2Media files may not be larger than 2MB
 400.3Altering 'contentType' may not result in a different media file type
  • No labels