Content Publishing
In this tutorial, you will learn how to publish content in the Vimond platform. By default, newly created assets and categories are not published, allowing editors to prepare content in advance and publishers to control when it becomes available to end users. Content can be published manually through the VIA user interface or programmatically using API calls.
Asset Publish and unpublish actions
Section titled “Asset Publish and unpublish actions”To programmatically publish or unpublish an asset, you can use the following API call:
curl --request PUT \ --url https://<tenant>.rest-api.<region>.vmnd.tv/api/web/asset/12345/publishinfo \ --header 'accept: application/json;v=3' \ --header 'authorization: Bearer <access token>' \ --header 'content-type: application/json;v=3' \ --data '{ "downloadable": true, "publish": "2021-12-02T13:00:30Z", "expire": "2021-12-03T13:00:30Z", "licenseStart": "2021-11-24T13:00:30Z", "licenseEnd": "2021-12-05T13:00:31Z"}'curl --request PUT \ --url https://<tenant>.rest-api.<region>.vmnd.tv/api/web+mobile/asset/12345/publishinfo \ --header 'accept: application/json;v=3' \ --header 'authorization: Bearer <access token>' \ --header 'content-type: application/json;v=3' \ --data '{ "downloadable": true, "publish": "2021-12-02T13:00:30Z", "expire": "2021-12-03T13:00:30Z", "licenseStart": "2021-11-24T13:00:30Z", "licenseEnd": "2021-12-05T13:00:31Z"}'curl --request PUT \ --url https://<tenant>.rest-api.<region>.vmnd.tv/api/all/asset/12345/publishinfo \ --header 'accept: application/json;v=3' \ --header 'authorization: Bearer <access token>' \ --header 'content-type: application/json;v=3' \ --data '{ "downloadable": true, "publish": "2021-12-02T13:00:30Z", "expire": "2021-12-03T13:00:30Z", "licenseStart": "2021-11-24T13:00:30Z", "licenseEnd": "2021-12-05T13:00:31Z"}'The request body should include the following parameters:
downloadable: A boolean value indicating whether the asset is downloadable. If not set or null, the current value will not change.publish: A UNIX timestamp or ISO 8601 date-time string specifying the publish date and time. If not set, it defaults to the time of the request.expire: A UNIX timestamp or ISO 8601 date-time string specifying the expiration date and time. If not set or null, the current value will not change.licenseStart: A UNIX timestamp or ISO 8601 date-time string specifying the license start date and time. If not set or null, the current value will not change.licenseEnd: A UNIX timestamp or ISO 8601 date-time string specifying the license end date and time. If not set or null, the current value will not change.
For additional API details, refer to the API documentation.
Category publish and unpublish actions
Section titled “Category publish and unpublish actions”Please see API reference for additional API details.
For enabling more advanced use cases of multi-region publishing and geo-blocking please see Multi-Region publishing and Geo-blocking
To verify if an asset or a category has been published or not you can make this call to the Content Discovery API. If an has been published you will get back a response with the asset or the category, if it has not been published you will get a response claiming the asset or the category was not found.
Asset query example:
curl \--request GET \--url 'https://<tenant>.content-discovery.cf.<region>.vmnd.tv/api/v1/assets/<assetId>' \--header 'Accept: application/json'{ "data": [ { "id": "<assetId>", "timestamp": "2021-11-02T09:30:03Z", "createTime": "2020-07-17T12:41:34Z", "images": { "defaultUrl": "<<IMAGE_SERVICE_URL>>/api/v2/img/60816240e4b007b29b82070a-1635432364210", "version": "original", "templates": { "regions": [], "locations": [ "portal-carousel", "portal-landscape-cover", "portal-cover", "main" ], "withRegion": "<<IMAGE_SERVICE_URL>>/api/v2/img/60816240e4b007b29b82070a-1635432364210?region=${REGION}", "withLocation": "<<IMAGE_SERVICE_URL>>/api/v2/img/60816240e4b007b29b82070a-1635432364210?location=${LOCATION}", "complete": "<<IMAGE_SERVICE_URL>>/api/v2/img/60816240e4b007b29b82070a-1635432364210?region=${REGION}&location=${LOCATION}" } }, "category": { "path": "999 133717 133718 140236", "link": "<<CONTENT_DISCOVERY_URL>>/api/v1/categories/<parentCategoryId>", "id": "140236" }, "labeledAsFree": true, "drmProtected": false, "duration": 0.0, "assetType": " ", "isLive": false, "isParent": true, "transmissionTime": "2020-07-17T12:41:34Z", "relatedAssets": [ { "relationType": "is-extra-content", "name": "is-extra-content", "id": 369778 } ], "qualities": [], "version": { "available": [ "main" ], "type": "main" }, "publishing": { "start": "2020-07-17T12:41:40Z", "platform": "<platform>" }, "description": "Mp4 video", "description-short": "Mp4 video", "image-pack": "60816240e4b007b29b82070a-1635432364210", "title": "Asset name", } ]}{ "errors": [ { "title": "ASSET_NOT_FOUND", "detail": "The asset requested does not exist", "code": "2000" } ]}Please see API reference for additional API details.
Category query example:
curl \--request GET \--url 'https://<tenant>.content-discovery.cf.<region>.vmnd.tv/api/v1/categories/<categoryId>' \--header 'Accept: application/json'{ "data": [ { "id": "<categoryId>", "timestamp": "2021-11-24T15:02:35Z", "images": { "defaultUrl": "<<IMAGE_SERVICE_URL>>/api/v2/img/5fe1dce7e4b01a33a267e1e4-1616761035660", "version": "original", "templates": { "regions": [], "locations": [ "portal-carousel", "portal-landscape-cover", "portal-cover", "main" ], "withRegion": "<<IMAGE_SERVICE_URL>>/api/v2/img/5fe1dce7e4b01a33a267e1e4-1616761035660?region=${REGION}", "withLocation": "<<IMAGE_SERVICE_URL>>/api/v2/img/5fe1dce7e4b01a33a267e1e4-1616761035660?location=${LOCATION}", "complete": "<<IMAGE_SERVICE_URL>>/api/v2/img/5fe1dce7e4b01a33a267e1e4-1616761035660?region=${REGION}&location=${LOCATION}" } }, "categoryType": "CHANNEL", "parentId": "133718", "path": "999 133717 133718 140236", "children": [], "publishing": { "start": "2021-11-24T15:02:24Z", "platform": "<platform>" }, "publisher-id": 2, "image-pack": "5fe1dce7e4b01a33a267e1e4-1616761035660", "title": "<categoryTitle>" } ]}{ "errors": [ { "title": "CATEGORY_NOT_FOUND", "detail": "The category requested does not exist", "code": "2001" } ]}Please see API reference for additional API details.
By using these API calls, you can programmatically publish or unpublish assets and categories in the Vimond platform and verify their published status.