Media API
The Media API allows the CMS to create and search media entities of various different types
The endpoints are as follows
/api/media/bundles
/api/media/search
/api/media/create
/api/media/upload
Bundles
The bundles endpoint gives you a list of available bundles for the media entities, this includes JW Player, Twitter etc
https://indy-api-dev.brightsites.co.uk/api/media/bundles
Search
The search endpoint has the following query parameters and returns an array of matching entities
Query Parameters | Description |
---|---|
bundle | The bundle to filter by |
q | The search query |
id | The ID of a specific entity |
limit | Items to get |
offset | Where to start from |
workflowTid | The ID of the workflow term attached to the image |
// Example calls
https://indy-api-dev.brightsites.co.uk/api/media/search?bundle=remote_image&q=Football&limit=10&offset=0
https://indy-api-dev.brightsites.co.uk/api/media/search?id=123
Creating Media Entities
The different bundles have different POST fields, images have the most and are listed below
Query Parameters | Description |
---|---|
bundle | The Bundle |
caption | The Caption |
copyright | The Copyright |
credit | The Credit |
description | The Description |
image_id | The ID of the image from any remote system, this is a string field |
title | The Title |
doNotReuse | 1 or 0, whether or not to allow the image to be reused |
alt | The Alt |
notes | Notes is a JSON field |
field_extra_media_info | Another JSON Field |
agency_id | The Agency id for a remote agency |
image | The Image file to upload to S3 |
The other bundles only have bundle
and id
as this is all that's needed
// Example calls
https://indy-api-dev.brightsites.co.uk/api/media/create
Upload to S3 only and don't create a media entity
I'm not sure what the old CMS used this for but you can also just upload an image to S3 via the API
This endpoint accepts only bundle
and the image
// Example calls
https://indy-api-dev.brightsites.co.uk/api/media/upload