NAV
Ruby Python Javascript

SchedulerAPI v1.0.0

Scroll down for code samples, example requests and responses. Select a language for code samples from the tabs above or the mobile navigation menu.

This is the API documentation for the event scheduler at SchedulerAPI.com. All API calls require authentication with an API key or a JWT Bearer token. The API key should be sent in as x-api-key. All scheduled events can respond with either a web URL hit OR via the creation of an Amazon AWS SQS message.

Base URLs:

Terms of service Email: Support

Authentication

Events

Scheduled Events (creating, modifying and removing)

Find out more at

Create a scheduled event

Code samples

require 'rest-client'
require 'json'

headers = {
  'Content-Type' => 'application/json',
  'x-api-key' => 'API_KEY'
}

result = RestClient.post 'https://api.schedulerapi.com/schedule',
  params: {
  }, headers: headers

p JSON.parse(result)

import requests
headers = {
  'Content-Type': 'application/json',
  'x-api-key': 'API_KEY'
}

r = requests.post('https://api.schedulerapi.com/schedule', headers = headers)

print(r.json())

const inputBody = '{
  "when": "2019-08-24T14:15:22Z",
  "payload": {
    "method": "post",
    "url": "string",
    "header": {},
    "body": "string"
  }
}';
const headers = {
  'Content-Type':'application/json',
  'x-api-key':'API_KEY'
};

fetch('https://api.schedulerapi.com/schedule',
{
  method: 'POST',
  body: inputBody,
  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

POST /schedule

Body parameter

{
  "when": "2019-08-24T14:15:22Z",
  "payload": {
    "method": "post",
    "url": "string",
    "header": {},
    "body": "string"
  }
}

Parameters

Name In Type Required Description
body body Event true Create a scheduled event in the system.

Example responses

Responses

Status Meaning Description Schema
400 Bad Request Invalid payload supplied None
401 Unauthorized Incorrect authentication information None

Response Schema

Updates/modifies a scheduled event. The event must be within one (1) minute for firing in order to be updated.

Code samples

require 'rest-client'
require 'json'

headers = {
  'Content-Type' => 'application/json',
  'x-api-key' => 'API_KEY'
}

result = RestClient.post 'https://api.schedulerapi.com/update',
  params: {
  }, headers: headers

p JSON.parse(result)

import requests
headers = {
  'Content-Type': 'application/json',
  'x-api-key': 'API_KEY'
}

r = requests.post('https://api.schedulerapi.com/update', headers = headers)

print(r.json())

const inputBody = '{
  "id": "string",
  "when": "2019-08-24T14:15:22Z",
  "payload": {
    "method": "post",
    "url": "string",
    "header": {},
    "body": "string"
  }
}';
const headers = {
  'Content-Type':'application/json',
  'x-api-key':'API_KEY'
};

fetch('https://api.schedulerapi.com/update',
{
  method: 'POST',
  body: inputBody,
  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

POST /update

Body parameter

{
  "id": "string",
  "when": "2019-08-24T14:15:22Z",
  "payload": {
    "method": "post",
    "url": "string",
    "header": {},
    "body": "string"
  }
}

Parameters

Name In Type Required Description
body body MutateEvent true Update/modify a scheduled event in the system.

Example responses

Responses

Status Meaning Description Schema
400 Bad Request Invalid payload supplied None
401 Unauthorized Incorrect authentication information None
404 Not Found Could not find the event None

Response Schema

Cancels a scheduled event. The event must be within one (1) minute for firing in order to be updated.

Code samples

require 'rest-client'
require 'json'

headers = {
  'Content-Type' => 'application/json',
  'x-api-key' => 'API_KEY'
}

result = RestClient.post 'https://api.schedulerapi.com/cancel',
  params: {
  }, headers: headers

p JSON.parse(result)

import requests
headers = {
  'Content-Type': 'application/json',
  'x-api-key': 'API_KEY'
}

r = requests.post('https://api.schedulerapi.com/cancel', headers = headers)

print(r.json())

const inputBody = '{
  "id": "string"
}';
const headers = {
  'Content-Type':'application/json',
  'x-api-key':'API_KEY'
};

fetch('https://api.schedulerapi.com/cancel',
{
  method: 'POST',
  body: inputBody,
  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

POST /cancel

Body parameter

{
  "id": "string"
}

Parameters

Name In Type Required Description
body body CancelEvent true Cancels a scheduled event in the system.

Example responses

Responses

Status Meaning Description Schema
400 Bad Request Did not include an event id None
401 Unauthorized Incorrect authentication information None
404 Not Found Could not find the event None

Response Schema

Schemas

ScheduledEventUrl

{
  "method": "post",
  "url": "string",
  "header": {},
  "body": "string"
}

Properties

Name Type Required Restrictions Description
method string false none The verb to use when connecting with the URL.
url string false none The URL to connect to when the event is ready.
header object false none An object of headers to send in the request to the URL when the event is ready.
body string false none The body of the HTTP/HTTPS request to send when the event is ready.

Enumerated Values

Property Value
method post
method get
method delete

ScheduledEventSqs

{
  "body": "string",
  "url": "string"
}

Properties

Name Type Required Restrictions Description
body string false none The body of the SQS message to place into the queue.
url string false none The URL of the SQS queue to add the message to.

Event

{
  "when": "2019-08-24T14:15:22Z",
  "payload": {
    "method": "post",
    "url": "string",
    "header": {},
    "body": "string"
  }
}

Properties

Name Type Required Restrictions Description
when string(date-time) false none When the event should be processed.
payload any false none Either an SQS event or a URL event payload.

oneOf

Name Type Required Restrictions Description
» anonymous ScheduledEventUrl false none none

xor

Name Type Required Restrictions Description
» anonymous ScheduledEventSqs false none none

MutateEvent

{
  "id": "string",
  "when": "2019-08-24T14:15:22Z",
  "payload": {
    "method": "post",
    "url": "string",
    "header": {},
    "body": "string"
  }
}

Properties

Name Type Required Restrictions Description
id string false none The ID of the event we are modifiying
when string(date-time) false none When the event should be processed.
payload any false none Either an SQS event or a URL event payload.

oneOf

Name Type Required Restrictions Description
» anonymous ScheduledEventUrl false none none

xor

Name Type Required Restrictions Description
» anonymous ScheduledEventSqs false none none

CancelEvent

{
  "id": "string"
}

Properties

Name Type Required Restrictions Description
id string false none The ID of the event we are modifiying