MediaValet

General information

The Mediavalet component provides actions that offer functionality in line with the Mediavalet API that implements hypermedia to provide access to asset information, creation of asset, generation of a CDN link, and more. API documentation can be found at https://docs.mediavalet.com.

Credentials

The following credentials are required to authenticate the Squiz Connect Mediavalet Component with your Mediavalet instance.

Title

The title of your Credential.

Client ID

The Client ID is obtained by creating and subscribing to Mediavalet Developer Portal and by following the instructions in the emails sent by MediaValet Support.

Client Secret

The Client Secret is obtained by creating and subscribing to Mediavalet Developer Portal and by following the instructions in the emails sent by MediaValet Support.

Authorisation Endpoint

The URL used by Connect to authenticate with Mediavalet. Unless otherwise specified, this should always be https://login.mediavalet.com/connect/authorize

Token Endpoint

The URL used by Connect to generate tokens for authentication with Mediavalet. Unless otherwise specified, this should always be https://login.mediavalet.com/connect/token

Subscription Key

The Subscription key/API key provided by Mediavalet Support to successfully make requests to the Mediavalet API

Split result if it’s an array

Some requests will return a response with an array of objects as its top-level object. If this checkbox is selected, the component will emit one message for each element of the array. If it is not selected, the component will emit the entire response as a single message.

Don’t throw error on failed calls

If this checkbox is selected, the component will emit any error response from Mediavalet as a message and allow the flow to continue. If it is not selected, an error response from Mediavalet will cause the component to throw an error and the flow run will fail. Example use case - when retrieving a course, if the course does not exist we may want our flow to continue anyway - selecting this checkbox will cause the component to emit a 404 response as a message so the flow can continue.

Pagination

For all actions that may return more than one result, Offset based pagination can be used as explained below.

The following are the parameters required to achieve Offset based pagination:

count

Or Number of responses is the specific limit that depicts the number of records to be returned by the API.

offset

Denotes the number of records that needs to be skipped.

Example 1. Example

The MediaValet library contains 1000 items, and the requirement is to retrieve the 75th, 76th …​.. 100th item, then this can be achieved by assigning:

count/number of responses = 25 and offset = 75

Due to a MediaValet API limitation, the maximum number of results that can be returned per page (in a single response) is 1000.

In the following scenario, the library totals 750 assets. The user wants to retrieve all the assets with a maximum of 25 records per page (or in a single response).

The pseudocode below illustrates this:

const count = 25; //responses per page
let offset = 0;
const totalNumberOfAssets = 750;
while (offset < totalNumberOfAssets) {
  <execute-action>
  offset += 25;
}

Generic actions

Retrieve an asset

This action will return the specified asset.

This action allows integrators to directly access the Retrieve asset request of the Mediavalet API.

For more information, read the relevant MediaValet page.

Input fields
  • assetId

  • includeSoftDeleted

Retrieve assets with search criteria

This action will return assets satisfying optional search criteria.

This action allows integrators to directly access the Retrieve Assets With Search Criteria request of the Mediavalet API.

For more information, read the relevant MediaValet page.

Input fields
  • includeSoftDeleted,

  • count (This should be less than or equal to 50.)

  • offset (This is a number of records to be skipped. It should be equal to at least 1 less than the total number of assets.)

  • search

  • sort

  • filters

  • containerFilter

  • searchFields

  • includeTotalCount

Request asset upload URL

This action will POST to the upload resource by creating a holding record and Shared Access Signature (SAS) URL to which the user uploads the file. The SAS URL allows temporary write access to BLOB storage.

This Action allows integrators to directly access the Request Upload URL request of the Mediavalet API.

For more information, read the relevant MediaValet page.

Input fields
  • fileName

    The fileName parameter should contain a file extension for the Medivalet library to render the thumbnail of the asset file.

Upload file

This action will upload the asset file to the blob storage in Azure using the SAS URL provided in the previous POST step.

This Action allows integrators to directly access the Upload File request of the Mediavalet API.

For more information, read the relevant MediaValet page.

The max file size is 10Mb.
Input fields
  • uploadUrl

  • fileUrl

Add asset details

This action will allow the user to optionally supply a description and title to the specified asset. By default, the system uses the filename (without file extension) as the asset title.

It is important to supply the original file size in this step as well as valid characters for the filename’s extension.

This action allows integrators to directly access the Add Title/Description/FileSize request of the Mediavalet API.

For more information, read the relevant MediaValet page.

Input fields
  • assetId

  • filename

  • title

  • description

  • fileSizeInBytes

Assign asset to the category

This action will allow the user to assign at least one category to the asset being uploaded.

This action allows integrators to directly access the Assign Asset to the Category request of the Mediavalet API.

For more information, read the relevant MediaValet page.

Input fields
  • assetId

  • category

Finalize upload

This action will finalize the upload by confirming that the assets were successfully uploaded. Completion of this step initiates the rendering of the thumbnail and otherwise processes the assets.

If the filename’s extension contains invalid characters or if no category ID is supplied in this format (["<category_id_1>, <category_id_2>,…​.<category_id_n>"]) an error is returned as the status of the request.

This action allows integrators to directly access the Finalize Upload request of the Mediavalet API.

For more information, read the relevant MediaValet page.

Input fields
  • assetId

This action allows integrators to directly access the Create A Direct Link request of the Mediavalet API.

For more information, read the relevant MediaValet page.

This action will generate a direct link for various asset types such as images, video, audio, or documents.

The Type of Size property for the following asset types can have various values:

Image
  • XLarge

  • Widescreen

  • Fullscreen

  • Large

  • Medium

  • Small

  • Thumbnail

  • Original

  • Custom

Video
  • Widescreen360p

  • Widescreen480p

  • Widescreen720p

  • Widescreen1080p

  • Original

  • Custom

The width and height must be included for the custom size type property. Also, the Type of Size property is not available for audio and document assets.

The format property for the following asset types can have various values:

Image
  • GIF

  • JPG

  • PDF

  • PNG

  • TIFF

Video
  • AVI

  • FLV

  • MKV

  • MOV

  • MPEG

  • MP4

  • WMV

Audio
  • MP3

  • MP4

  • MWA

Document
  • PDF

If you send the asset’s original format and that format is not in the list of values provided above, you can only request the Original size type and this will generate a direct link pointing to the original asset’s file.

For each type of Size value of a single asset, a direct link can be generated resulting in one asset having multiple direct links.

Input fields
  • assetId

This action will allow the user to retrieve a collection of Direct links.

This Action allows integrators to directly access the Retrieve Direct Links request of the Mediavalet API.

For more information, read the relevant MediaValet page.

Input fields
  • assetId

Use case-specific actions

Retrieve all assets with detailed info

Using the Retrieve an asset action on each asset returned by [Retrive assets with search criteria], this action will return detailed information about all the assets.

Input fields
  • numberOfResponses (This should be less than or equal to 50)

  • offset (A number of records to be skipped. It should be equal to at least 1 less than the total number of assets.)

Upload and create asset

This action will allow the user to create and upload an asset using one action.

Input fields
  • filename

  • fileUrl

  • title

  • description

  • fileSizeInBytes

  • category