How to publish
The endpoints.publish
object literal in the launch template can be used to configure where data is published:
{
"endpoints": {
"publish": {
"http": {
"url": "https://example.com/publish",
"method": "POST"
}
}
}
}
When adding this configuration a publish button will appear in the top right corner:
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.
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.
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/1.1 200 OK
and will display the following notification:
if a single file is published, or
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: