NEWDolby Media Processing APIs are now the Dolby.io Media APIs Learn More >
X

Job Management

Querying Jobs

Media processing is a job-based engine that tracks work in progress with a job_id. While jobs are running, they will go through a number of states:

  • Pending - your media is waiting for an available resource to run it
  • Running - your media is being processed, check back again soon
  • Success - this status indicates the result is ready
  • Failed - there was a problem and you'll see an error with some additional notes about what the cause might be

The Query Media Jobs API provides a resource to query the list of any submitted jobs for up to the past 31 days.

Example Output

Here is an example of the results from a /media/jobs query:

{
  "count": 1,
  "jobs": [
    {
      "job_id": "ad4bcd54-3d27-401f-b1c2-39b509779443",
      "api_version": "v1.1.1",
      "path": "/media/enhance",
      "status": "Success",
      "progress": 100,
      "duration": 10.472,
      "time_submitted": "2021-08-10T05:16:31.494Z",
      "time_started": "2021-08-10T05:16:32.000Z",
      "time_completed": "2021-08-10T05:17:00.074Z",
      "expiry": "2021-09-10T05:17:00.000Z"
    }
  ]
}

Filtering

There are a few ways you can customize the results.

  • Filter by status
  • Filter by date

For example, if you want to see which jobs are currently running you can query with a status of Running. If you wanted to get jobs that were processed or processing within the past 24 hours, you can specify submitted_after for the previous day. These dates should be provided as ISO 8601 format.

Pagination

Due to the high volume of jobs some customers run, these job results are paginated to return a maximum of 100 entries in the response. The response includes a token that can be used to fetch the next page of records. This can be done with the next_token parameter. You can continue using the next_token until no additional results are returned.

Retrieving a specific job

To retrieve details of a particular job, you can specify the job_id as a parameter for the query.

import os
import requests
      
response = requests.get("https://api.dolby.com/media/jobs", 
        headers = {
          "Content-Type": "application/json",
          "x-api-key": os.environ["DOLBYIO_API_KEY"],
        })
response.raise_for_status()
print(response.json())
const axios = require('axios').default;

const config = {
        method: 'get',
        url: 'https://api.dolby.com/media/jobs',
        headers: {
          'x-api-key': process.env.DOLBYIO_API_KEY,
          'Content-Type': 'application/json'
        }
      };

axios(config)
        .then(function (response) {
          console.log(response.data);
        })
        .catch(function (error) {
          console.log(error);
        });
curl -X GET "https://api.dolby.com/media/jobs" \
          --header "x-api-key: $DOLBYIO_API_KEY" \
          --header 'Content-Type: application/json'

API Reference


Did this page help you?