Showcase Page

Showcase: Category and Content Images API

The following article will show how to update the showcase category and content cover images via the API endpoints.

Administrators can configure the category and content /report images via the API endpoints provided. This option offers an API alternative to the admin pages for uploading a showcase image. The usual inherentance is also still applied here.   

🔔Note: To apply via the admin pages, see the Report & Category Cover Images section in the article Showcase: Getting Started 

To view the available endpoints, head to the API and Integration Documentation section via the admin area and select 'V1 Documentation'.
 

🔔SeeAPI: Application Programming Interfaces article to familiarise yourself with API's in Content Catalyst. 

Before you start. 

All images updated via the API endpoints require base64 encoded file versions of the images.

The usual validation of JPG or PNG only is applied, along with the file size limit of 2MB.

 Update Category Cover Endpoints

The relevant endpoints for updating the Category covers are found in the V1 Documentation 'Categories' dropdown list.

GET /categories/{id}/showcase-image

Gets the showcase image for a category

PUT /categories/{id}/showcase-image

Updates the showcase image for a category

DELETE /categories/{id}/showcase-image

Deletes the showcase image for a category

Category ID's

The Category cover endpoints update is based on the category ID.
To identify the category ID easily, use the  following API Endpoint: 
GET/categories

In the response body of the Get Categories query, a list of IDs will be produced.

For example:

Content / Report Cover Endpoints

The relevant endpoints for updating the content/report covers are found via the V1 Documentation 'Products' dropdown list.

GET /Libraries/reports/products/{productCode}/showcase-image

Get the showcase image for a product/report 

PUT /Libraries/reports/products/{productCode}/showcase-image

Update the showcase image for a product/report 

DELETE /Libraries/reports/products/{productCode}/showcase-image

Delete the showcase image for a product/report 

Example: Get image details

Using the Get endpoint returns an image URL that allows users to download the file; it does not return the binary information of the image file itself. 

This endpoint uses either report ID or Category ID, depending on which endpoint is used. 

The following example shows how to get the showcase image for a category cover. 

Select the query:

GET /categories/{id}/showcase-image

Add the ID of the category in the ID parameter.

Select 'Execute' to run the endpoint.

If no image is available, the following statement will appear.

If an image is found, a link will be generated allowing this image to be downloaded.

Example: Add a new image cover to a category.

The following example shows how to add a new showcase category cover.

Select the query:

PUT /categories/{id}/showcase-image

Add the ID of the category in the ID parameter.

In the query 'body' section, replace the "string" value with the encoded base 64 payload of the image you want to add. Ensure to wrap the payload in quotation marks.

Select Execute to run the endpoint. 

If the response is successful, the category cover will be updated. 

Refresh the showcase page, and the image will be updated.

Example: Add a new image cover to a product/report.

The following example shows adding a new product/report cover image. 

Select the query:

PUT /Libraries/reports/products/{productCode}/showcase-image. 

Add the report ID in the ProductCode parameter. 

In the query 'body' section, replace the "string" value with the encoded base 64 payload of the image you want to add. Ensure to wrap the payload in quotation marks.

Select Execute to run the endpoint. 

Refresh the showcase page, and the image will be updated.

 

🔔Note: For more information on the Showcase page sections, see Showcase: Available Sections