Next (Importing) Previous (Asynchronous Operation)

Streaming Events

The import, export and render commands support sending an event stream rather than a single result.

The event stream follows the W3C Server-Sent Events standard.

The event stream is useful when you wish to monitor progress of the job.

To request an event stream, send the header Accept: text/event-stream.

You must ensure that you request a synchronous result, not an asynchronous request.

Example

curl -u ${username}:${apiKey} \
     -H "Accept: text/event-stream" \
    https://clara.io/api/scenes/${sceneID}/render

Output

The server will send a stream of JSON encoded objects. The first object will be the job data, and subsequent objects will be the changed attributes for the job object.

If the the job produces output, it’s name, type, size and URL will appear in the files attribute when it is ready.

The event stream will send a message at least once every 5 seconds to help keep the HTTP connections open.


Next (Importing) Previous (Asynchronous Operation)