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 6 Next »

Update a media file to the dialogportal™ Media Archive.

 

A media in archive can be searched and updated based on fileName and folderPath fields.

Fields - content, contentType and description are optional fields that can be updated. If a field is omitted, then this field is not updated. If all three fields (content, contentType and description) are omitted, then nothings get updated.

Endpoint ID:

9101

Method:

PUT

URL:

/content/media

Request body:

JSON data with information about the media to be updated.

Required fields:
 

fileName

A file name or title of the media item.

 folderPathA 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.
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".

Example: Update a single pixel image
 {
   "content": "R0lGODlhAQABAIAAAP///wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==",
   "description" : "This is a media description.", 
   "contentType": "image/gif",
   "fileName": "clear 1x1.gif",
   "folderPath": "Assets/Generic Images/Small"   
}

Response body:


A JSON object containing the url of the updated content.

Example
{
  "url": "https://media.dialogportal.com/customer_name/assets/generic_images/small/clear_1x1.gif"
}

The URL format is:

Base URLhttps://media.dialogportal.com/
Customer name
customer_name/
Folder path
assets/generic_images/small/
File nameclear_1x1.gif

The fileName and folderPath have been sanitized, making them safe to use in a URL.

Status codes:

200

Media updated successfully.

 404Media to be updated not found.
 400.1Content type not recognized
 400.2Media files may not be larger than 2MB
  • No labels