How to change content's thumbnail

How to change content's thumbnail

[tab:Actions]

Requirements

In order to be able to perform this operation on a content , the following conditions must be complied:

  • You must use a business user and therefore possess its credentials (username and password or token). Some applications have the right to edit content, in this case you can authenticate through its appId.
  • The user performing this operation on the content must be the owner or must have the right to write the content.

 

Changing thumbnail

A thumbnail is the representative image of a content, used as a preview of the content itself in content lists and widgets. During the transcoding process, right after publishing a content into platform, THRON extracts a thumbnail for the content itself, but it can be updated at any time. To update a new representative image of the content you have to use the service updateThumbnail, taking the new image from a platform content (image or video). If the content is a video, thumbnail can be taken directly from a frame of the video itself. After this operation, the image will be replaced and it will be automatically republished in all available channels. During the transcoding of the new image, the previous thumbnail might still appear for a limited period of time[/tab][tab:Code Samples] [dropdown:REST - UPDATING THUMBNAIL]

In order to change the thumbnail of a generic content you can use the updateThumbnail web service, and specify the origine of the file which has to be used as new thumbnail, choosing among repository, FTP, S3, web, raw data or video frame. Please remember that you can not change thumbnail of IMAGE content type.

In the body of the request, minimum information to be included are:

  • xcontentId: the ID of the content for which you are going to replace thumbnail (can not be an IMAGE content type).
  • source: the origin of the new thumbnail. Available options are:
    • repo: if the new thumbnail has been previously uploaded to repository. You will have to provide the repositoryFileId.
    • ftp: if the new thumbnail has been previously uploaded to FTP server. You will have to provide its fileName.
    • s3: if the new thumbnail has been previously uploaded to an S3 bucket. You will have to provide the following information:
      • bucket: the name of the S3 bucket used for uploading the source file.
      • filePath: the absolute path of the source file inside the S3 bucket.
      • newFileName: the desired file name to be assigned to the source file into THRON Platform without extension.
    • web: if you wish to import a new thumbnail directly from a web resource. You will have to provide the following information:
      • url: the public url of the resource.
      • newFileName: the desired file name to be assigned to the source file into THRON Platform without extension.
    • raw: if you wish to import a thumbnail from raw data. You will have to provide the following information:
      • buffer: the image itself, base64 encoded with UTF-8 charset. Maximum allowed size is 2MB.
      • mimeType: used to specify the mimeType of the buffer.
    • video: if you wish to select the new Thumbnail from a specific video frame. Available only if content type is a VIDEO. You will have to provide the following information:
      • timeFrame: the desired time frame in seconds.

The headers that should be used for the request, which must be in POST are:

  • Content-Type: application / json
  • X-TokenId: XXXXX (using the token obtained through the login)

The url of the service is formatted according to the structure:

 

//[clientId]-view.thron.com/api/xadmin/resources/content/updateThumbnail/[clientId]

 

Where [clientId] is the name of the service code as used for the body of the request.

You can test the functionality in the Developer Center here.

In the body of the request you can paste the following JSON, replacing the required values:

{
    "xcontentId": "",
    "param": {
        "source": {
            "repo": {
                "repositoryFileId": ""
            },
            "ftp": {
                "fileName": ""
            },
            "s3": {
                "bucket": "",
                "filePath": "",
                "newFileName": "",
                "removeSourceFile": false
            },
            "web": {
                "url": "",
                "newFileName": ""
            },
            "raw": {
                "buffer": [
                    ""
                ],
                "mimeType": ""
            }
        },
        "video": {
            "timeFrame": 0
        }
    },
    "silentMode": false
}

[/dropdown]

[/tab]

Was this article helpful?
0 out of 0 found this helpful

Have more questions?

SUBMIT A REQUEST

Hai altre domande?

INOLTRA UNA RICHIESTA

Comments