Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Added sub-codes for 404 responses
Excerpt

Update a media file to in 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 updatedMedia file content and description properties are updateable. The fileName and folderPath are used to uniquely identify the media file.

Media to be updated not found.

Endpoint ID:

9101

Method:

Status
colourGreen
titlePUT

URL:

/content/media

Request body:

JSON data with information about the media to be updated.

Required fields:
 

fileName

A The media file name or title of the media item..

 contentTypeThe content mime-type, i.e. "image/gif" or "text/plain". The contentType should be same as existing file.
Optional fields:
 folderPathA The 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".

Code Block
titleExample: Update a single pixel image
 {
   "contentfileName": "R0lGODlhAQABAIAAAP///wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==clear_1x1.gif",
   "descriptionfolderPath" : "This is a media description.", assets/generic_images/small",
   "contentTypecontent": "image/gifR0lGODlhAQABAIAAAP///wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==",
   "fileNamedescription" : "clear 1x1.gifThis is a media description.",
   "folderPathcontentType": "Assets/Generic Images/Small"   
image/gif"
}

Response body:

A JSON object containing the url of the updated content.
Code Block
titleExample
{
  "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
Note

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

None

Status codes:

200204

Media updated successfully.

 404

 400.1Content type not recognized
 400.2Media files may not be larger than 2MB
 400.3Content type mismatch
 404.4Media file not found
 404.5Folder not found