Skip to main content

How to publish

The endpoints.publish object literal in the launch template can be used to configure where data is published:

Example: Publish HTTP configuration
{
"endpoints": {
"publish": {
"http": {
"url": "https://example.com/publish",
"method": "POST"
}
}
}
}

When adding this configuration a publish button will appear in the top right corner:

Publish button

When this button is pressed, a modal is presented where you can choose which files to publish. Files that have been altered will be pre-selected.

Publish modal

When the publish button in the modal is pressed, one HTTP POST request will be sent to https://example.com/publish?fileId={your-file-id} for each file that is selected. The request body will include the TTML file contents and the query parameter fileId will be set to the file id of the file being published.

For more details about the format, read the publish output format reference documentation.

info

When receiving the publish request we recommend that you process the data asynchronously when responding to the request to avoid making the user having to wait for potential processing.

The application expects an HTTP response with a 2XX status code to indicate that everything went OK:

HTTP Response
HTTP/1.1 200 OK

and will display the following notification:

Publish success single file

if a single file is published, or

Publish success multiple file

if multiple files are published at the same time.

In case of error the application expects a 4XX HTTP status code. When a publish request fails an error notification is displayed:

Publish failure