Distribution

Dataset Schedules

Mode datasets can be scheduled to run automatically, and even with specific dataset parameters. You can find out more about scheduling datasets here.

You can use the schedules resource on a given Mode dataset to manage and retrieve information about one or all schedules for that dataset.

{
  "token": "9288da2a1b59",
  "name": "Qui Officia",
  "parameters": {},
  "created_at": "2019-05-08T22:12:19.237Z",
  "updated_at": "2020-04-06T20:02:02.321Z",
  "retry_state": "ok",
  "retry_count": 1,
  "retry_delay": 0,
  "timeout": 86100,
  "last_run_at": "2020-04-06T20:01:53.431Z",
  "last_succeeded_at": "2020-04-06T20:02:02.313Z",
  "last_scheduled_run": "2020-04-06T20:00:00.000+00:00",
  "next_scheduled_run": "2020-04-07T20:00:00.000+00:00",
  "subscribed": false,
  "frequency": "daily",
  "time_zone": "UTC",
  "hour": "8:00 pm",
  "minute": "the top of the hour",
  "_links": {
    "account": {
      "href": "/api/hogwarts"
    },
    "creator": {
      "href": "/api/albus_dumbledore"
    },
    "self": {
      "href": "/api/hogwarts/reports/1fc11c31fdc4/schedules/9288da2a1b59"
    },
    "report": {
      "href": "/api/hogwarts/reports/1fc11c31fdc4"
    },
    "report_runs": {
      "href": "/api/hogwarts/reports/1fc11c31fdc4/schedules/9288da2a1b59/runs?embed[report_runs][executed_by]=1"
    },
    "report_subscriptions": {
      "href": "/api/hogwarts/reports/1fc11c31fdc4/schedules/9288da2a1b59/subscriptions"
    }
  },
  "_forms": {...}
}

List schedules for a dataset

To return a list of all schedules for a given Dataset, send a GET request to the schedules resource.

URL Params

workspace

required
string Workspace username

dataset

required
string Dataset token
Responses

200

Dataset Schedule collection response

401

Unauthorized

404

Dataset not found

GET /{workspace}/datasets/{dataset}/schedules

curl --include \
     --header "Content-Type: application/json" \
     --header "Accept: application/hal+json" \
  'https://app.mode.com/api/{account}/datasets/{dataset}/schedules'
require 'http'

username = 'your_api_key'
password = 'your_api_secret'

headers = {
  content_type: 'application/json',
  accept: 'application/hal+json'
}

response = HTTP.basic_auth(user: username, pass: password)
               .headers(headers)
               .get('https://app.mode.com/api/{account}/datasets/{dataset}/schedules')
puts response
from urllib2 import Request, urlopen

headers = {
  'Content-Type': 'application/json',
  'Accept': 'application/hal+json'
}
request = Request('https://app.mode.com/api/{account}/datasets/{dataset}/schedules', headers=headers)

response_body = urlopen(request).read()
print(response_body)
var request = require('request');

request({
  method: 'GET',
  url: 'https://app.mode.com/api/{account}/datasets/{dataset}/schedules',
  headers: {
    'Content-Type': 'application/json',
    'Accept': 'application/hal+json'
  }}, function (error, response, body) {
  console.log('Status:', response.statusCode);
  console.log('Headers:', JSON.stringify(response.headers));
  console.log('Response:', body);
});