NAV Navigation
Shell HTTP JavaScript Node.JS Ruby Python Java Go

Dates v0.1.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.

The Dates API provides various operations relating to calendars and dates. For example, the /eventDates method can be used to find upcoming events given one or more schedules and a calendar of exclusions.

Download OpenAPI Definition (YAML)

Base URLs:

Terms of service

Email: Apiture Web: Apiture

API

Endpoints which describe this API.

getApi

Code samples

# You can also use wget
curl -X GET /dates/ \
  -H 'Accept: application/hal+json'

GET /dates/ HTTP/1.1

Accept: application/hal+json

var headers = {
  'Accept':'application/hal+json'

};

$.ajax({
  url: '/dates/',
  method: 'get',

  headers: headers,
  success: function(data) {
    console.log(JSON.stringify(data));
  }
})

const fetch = require('node-fetch');

const headers = {
  'Accept':'application/hal+json'

};

fetch('/dates/',
{
  method: 'GET',

  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

require 'rest-client'
require 'json'

headers = {
  'Accept' => 'application/hal+json'
}

result = RestClient.get '/dates/',
  params: {
  }, headers: headers

p JSON.parse(result)

import requests
headers = {
  'Accept': 'application/hal+json'
}

r = requests.get('/dates/', params={

}, headers = headers)

print r.json()

URL obj = new URL("/dates/");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("GET");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
    new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
    response.append(inputLine);
}
in.close();
System.out.println(response.toString());

package main

import (
       "bytes"
       "net/http"
)

func main() {

    headers := map[string][]string{
        "Accept": []string{"application/hal+json"},
        
    }

    data := bytes.NewBuffer([]byte{jsonReq})
    req, err := http.NewRequest("GET", "/dates/", data)
    req.Header = headers

    client := &http.Client{}
    resp, err := client.Do(req)
    // ...
}

Top-level resources and operations in this API

GET /

Return links to the top-level resources and operations in this API. Links included in this response include:

Try it

Fields marked with * are mandatory.

ParameterValue
MethodGET
* URL
* API Key
* Access Token

Response

Response Code:

Response Headers:

Response Body:

    
      Click on 'Try It' to get a response.
    
  

Example responses

200 Response

{
  "id": "dates",
  "name": "dates",
  "apiVersion": "0.1.0",
  "_profile": "https://api.apiture.com/schemas/root/v1.0.0/profile.json",
  "_links": {}
}

Responses

StatusDescription
200 OK
OK
Schema: root

getApiDoc

Code samples

# You can also use wget
curl -X GET /dates/apiDoc \
  -H 'Accept: application/json'

GET /dates/apiDoc HTTP/1.1

Accept: application/json

var headers = {
  'Accept':'application/json'

};

$.ajax({
  url: '/dates/apiDoc',
  method: 'get',

  headers: headers,
  success: function(data) {
    console.log(JSON.stringify(data));
  }
})

const fetch = require('node-fetch');

const headers = {
  'Accept':'application/json'

};

fetch('/dates/apiDoc',
{
  method: 'GET',

  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

require 'rest-client'
require 'json'

headers = {
  'Accept' => 'application/json'
}

result = RestClient.get '/dates/apiDoc',
  params: {
  }, headers: headers

p JSON.parse(result)

import requests
headers = {
  'Accept': 'application/json'
}

r = requests.get('/dates/apiDoc', params={

}, headers = headers)

print r.json()

URL obj = new URL("/dates/apiDoc");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("GET");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
    new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
    response.append(inputLine);
}
in.close();
System.out.println(response.toString());

package main

import (
       "bytes"
       "net/http"
)

func main() {

    headers := map[string][]string{
        "Accept": []string{"application/json"},
        
    }

    data := bytes.NewBuffer([]byte{jsonReq})
    req, err := http.NewRequest("GET", "/dates/apiDoc", data)
    req.Header = headers

    client := &http.Client{}
    resp, err := client.Do(req)
    // ...
}

Return API definition document

GET /apiDoc

Return the OpenAPI document that describes this API.

Try it

Fields marked with * are mandatory.

ParameterValue
MethodGET
* URL
* API Key
* Access Token

Response

Response Code:

Response Headers:

Response Body:

    
      Click on 'Try It' to get a response.
    
  

Example responses

200 Response

{}

Responses

StatusDescription
200 OK
OK
Schema: Inline

Response Schema

Event Dates

List of event dates

findEventDates

Code samples

# You can also use wget
curl -X POST /dates/eventDates \
  -H 'Content-Type: application/hal+json' \
  -H 'Accept: application/json'

POST /dates/eventDates HTTP/1.1

Content-Type: application/hal+json
Accept: application/json

var headers = {
  'Content-Type':'application/hal+json',
  'Accept':'application/json'

};

$.ajax({
  url: '/dates/eventDates',
  method: 'post',

  headers: headers,
  success: function(data) {
    console.log(JSON.stringify(data));
  }
})

const fetch = require('node-fetch');
const inputBody = '{
  "schedules": [
    {
      "label": "Retirement savings transfer",
      "start": "2018-06-10",
      "every": "P14D",
      "count": 5,
      "skippedCount": 0,
      "maximumCount": 10,
      "skipNext": true,
      "end": "2018-08-01"
    }
  ],
  "exclusions": {
    "holidays": [
      "2018-12-24",
      "2018-12-25"
    ],
    "unprocessableDays": [
      "sunday",
      "saturday"
    ]
  }
}';
const headers = {
  'Content-Type':'application/hal+json',
  'Accept':'application/json'

};

fetch('/dates/eventDates',
{
  method: 'POST',
  body: inputBody,
  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

require 'rest-client'
require 'json'

headers = {
  'Content-Type' => 'application/hal+json',
  'Accept' => 'application/json'
}

result = RestClient.post '/dates/eventDates',
  params: {
  }, headers: headers

p JSON.parse(result)

import requests
headers = {
  'Content-Type': 'application/hal+json',
  'Accept': 'application/json'
}

r = requests.post('/dates/eventDates', params={

}, headers = headers)

print r.json()

URL obj = new URL("/dates/eventDates");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("POST");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
    new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
    response.append(inputLine);
}
in.close();
System.out.println(response.toString());

package main

import (
       "bytes"
       "net/http"
)

func main() {

    headers := map[string][]string{
        "Content-Type": []string{"application/hal+json"},
        "Accept": []string{"application/json"},
        
    }

    data := bytes.NewBuffer([]byte{jsonReq})
    req, err := http.NewRequest("POST", "/dates/eventDates", data)
    req.Header = headers

    client := &http.Client{}
    resp, err := client.Do(req)
    // ...
}

Return a collection of event dates

POST /eventDates

Finds upcoming event dates given one or more schedules of events and exclusions. Available parameters include start, limit, startDate, and period. There are two modes of pagination available:

Only one mode of pagination can be used at a time and the default mode is period with a value of P1Y.

To obtain the next page of results, use the next link in the response (if it exists) with a POST verb. Pass the same request body as passed to this operation (this operation is fully stateless.) If there is no next link, the collection has been exhausted. Note that some queries may not have a terminating collection (for example, if the schedule does not have a start date). The service will update the query parameters in the link to access the next page, according to the type of pagination in use. Thait is, it will increment the start if initially invoked with indexed-based pagination, or it will adjust the startDate if initially invoked with period-based pagination. The limit passed to this operation will also be passed to the next page.

Body parameter

{
  "schedules": [
    {
      "label": "Retirement savings transfer",
      "start": "2018-06-10",
      "every": "P14D",
      "count": 5,
      "skippedCount": 0,
      "maximumCount": 10,
      "skipNext": true,
      "end": "2018-08-01"
    }
  ],
  "exclusions": {
    "holidays": [
      "2018-12-24",
      "2018-12-25"
    ],
    "unprocessableDays": [
      "sunday",
      "saturday"
    ]
  }
}

Parameters

Parameter Description
start
(query)
integer(int64)
The zero-based index of the first event date item to include in this page. The default 0 denotes the beginning of the collection. If startDate is also provided start will be ignored.
limit
(query)
integer(int32)
The maximum number of event dates to return in this page. If period is also provided, limit will be ignored.
startDate
(query)
string(date)
The start date of the period in which to look for events. If period pagination mode is being used and no startDate is provided, the current date will be used.
startDate will override start if both are provided.
period
(query)
string
The length of time used to paginate event date results. period will override limit if both are provided.
This value is an ISO 8601 duration string of the form P[n]Y[n]M[n]D to specify the number of years/months/days between dates. For example, use P7D to paginate by weeks, P2M to paginate by 2 months. Time values in period are ignored but may be honored in the future.
body
(body)
eventDatesRequest (required)
The data necessary to find event dates.

Try it

Fields marked with * are mandatory.

ParameterValue
MethodPOST
* URL
* API Key
* Access Token

start

limit

startDate

period

* body

Response

Response Code:

Response Headers:

Response Body:

    
      Click on 'Try It' to get a response.
    
  

Example responses

200 Response

{
  "_profile": "http://api.apiture.com/schemas/collection/eventDate/v0.1.0/profile.json",
  "start": 0,
  "limit": 5,
  "count": 28,
  "name": "eventDates",
  "_links": {
    "self": {
      "href": "/dates/eventDates?start=0&limit=5"
    },
    "first": {
      "href": "/dates/eventDates?start=0&limit=5"
    },
    "next": {
      "href": "/dates/eventDates?start=5&limit=5"
    },
    "collection": {
      "href": "/dates/eventDates"
    }
  },
  "_embedded": {
    "items": [
      {
        "labels": [
          "Core Schedule"
        ],
        "date": "2018-06-14"
      },
      {
        "labels": [
          "Core Schedule"
        ],
        "date": "2018-06-16"
      },
      {
        "labels": [
          "Core Schedule"
        ],
        "date": "2018-06-18"
      },
      {
        "labels": [
          "Core Schedule",
          "Second Schedule"
        ],
        "date": "2018-06-20"
      },
      {
        "labels": [
          "Core Schedule",
          "Second Schedule"
        ],
        "date": "2018-06-22"
      }
    ]
  }
}

Responses

StatusDescription
200 OK
OK
Schema: eventDates
400 Bad Request
Bad Request. The request body or one or more of the query parameters was not well formed. The _error field in the response will contain details about the request error.
Schema: errorResponse
422 Unprocessable Entity
Unprocessable Entity. One or more of the query parameters was well formed but otherwise invalid. The _error field in the response will contain details about the request error.
Schema: errorResponse

Schemas

abstractResource

{
  "_profile": "http://api.apiture.com/schemas/example/v1.0.0/profile.json",
  "_links": {
    "self": {
      "href": "{uri of current resource}"
    }
  }
}

Abstract Resource

Properties

Schema NameDescription
_links links
An optional map of links, mapping each link relation to a link object. This model defines the _links object of HAL representations.
_embedded object
An optional map of nested resources, mapping each nested resource name to a nested resource representation.
_profile string(uri)
The URI of a resource profile which describes the representation.
_error error
An object which describes an error. This value is omitted if the operation succeeded without error.

root

{
  "id": "dates",
  "name": "dates",
  "apiVersion": "0.1.0",
  "_profile": "https://api.apiture.com/schemas/root/v1.0.0/profile.json",
  "_links": {}
}

Dates API Root

Properties

Schema NameDescription
Dates API Root any
A HAL response, with hypermedia _links for the top-level resources and operations in API.

allOf

Schema NameDescription
anonymous abstractResource
An augmented HAL resource representation. This model contains hypermedia _links, and either optional domain object data with _profile and optional _embedded objects, or an _error object. In responses, if the operation was successful, this object will not include the _error, but if the operation was a 4xx or 5xx error, this object will not include _embedded or any data fields, only _error and optionally _links.

and

Schema NameDescription
anonymous object
undefined
_id string
This API's unique ID.
name string
This API's name.
apiVersion string
This API's version.

errorResponse

{
  "_profile": "http://api.apiture.com/schemas/error/v1.0.0/profile.json",
  "_error": {
    "_id": "2eae46e1-575c-4d69-8a8f-0a7b0115a4b3",
    "_profile": "https://api.apiture.com/schemas/error/v1.0.0/profile.json",
    "message": "The value for deposit must be greater than 0.",
    "statusCode": 422,
    "type": "integer",
    "attributes": {
      "value": -125.5
    },
    "remediation": "Provide a value which is greater than 0",
    "occurredAt": "2019-02-20T12:18:18.844Z",
    "_links": {
      "describedby": {
        "href": "http://doc.apiture.com/errors/positiveNumberRequired"
      }
    },
    "_embedded": {
      "errors": []
    }
  }
}

Error Response

Properties

Schema NameDescription
Error Response abstractResource
Describes an error response, typically returned on 4xx or 5xx errors from API operations. The _error object contains the error details.

error

{
  "_id": "2eae46e1-575c-4d69-8a8f-0a7b0115a4b3",
  "_profile": "https://api.apiture.com/schemas/error/v1.0.0/profile.json",
  "message": "The value for deposit must be greater than 0.",
  "statusCode": 422,
  "type": "positiveNumberRequired",
  "attributes": {
    "value": -125.5
  },
  "remediation": "Provide a value which is greater than 0",
  "occurredAt": "2018-01-25T05:50:52.375Z",
  "_links": {
    "describedby": {
      "href": "http://doc.apiture.com/errors/positiveNumberRequired"
    }
  },
  "_embedded": {
    "errors": []
  }
}

Error

Properties

Schema NameDescription
message string (required)
A localized message string describing the error condition.
_id string
A unique identifier for this error instance. This may be used as a correlation ID with the root cause error (i.e. this ID may be logged at the source of the error). This is is an opaque string.
statusCode integer
The HTTP status code associate with this error.
minimum: 100
maximum: 599
type string
An error identifier which indicates the category of error and associate it with API support documentation or which the UI tier can use to render an appropriate message or hint. This provides a finer level of granularity than the statusCode. For example, instead of just 400 Bad Request, the type may be much more specific. such as integerValueNotInAllowedRange or numericValueExceedsMaximum or stringValueNotInAllowedSet.
occurredAt string(date-time)
An ISO 8601 UTC time stamp indicating when the error occurred.
attributes attributes
Data attribute associated with the error, such as values or constraints.
remediation string
An optional localized string which provides hints for how the user or client can resolve the error.
_embedded object
Optional embedded array of errors. This field may not exist if the error does not have nested errors.
items [errorResponse]
An array of error objects.

attributes

{}

Attributes

Properties

No properties

eventDatesRequest

{
  "schedules": [
    {
      "label": "Retirement savings transfer",
      "start": "2018-06-10",
      "every": "P14D",
      "count": 5,
      "skippedCount": 0,
      "maximumCount": 10,
      "skipNext": true,
      "end": "2018-08-01"
    }
  ],
  "exclusions": {
    "holidays": [
      "2018-12-24",
      "2018-12-25"
    ],
    "unprocessableDays": [
      "sunday",
      "saturday"
    ]
  }
}

Event Dates Request

Properties

Schema NameDescription
schedules [schedule] (required)
[A definition for a one-time or recurring scheduled event.]
exclusions calendar
A definition of a calendar

eventDates

{
  "_profile": "http://api.apiture.com/schemas/collection/eventDate/v0.1.0/profile.json",
  "start": 0,
  "limit": 5,
  "count": 28,
  "name": "eventDates",
  "_links": {
    "self": {
      "href": "/dates/eventDates?start=0&limit=5"
    },
    "first": {
      "href": "/dates/eventDates?start=0&limit=5"
    },
    "next": {
      "href": "/dates/eventDates?start=5&limit=5"
    },
    "collection": {
      "href": "/dates/eventDates"
    }
  },
  "_embedded": {
    "items": [
      {
        "labels": [
          "Core Schedule"
        ],
        "date": "2018-06-14"
      },
      {
        "labels": [
          "Core Schedule"
        ],
        "date": "2018-06-16"
      },
      {
        "labels": [
          "Core Schedule"
        ],
        "date": "2018-06-18"
      },
      {
        "labels": [
          "Core Schedule",
          "Second Schedule"
        ],
        "date": "2018-06-20"
      },
      {
        "labels": [
          "Core Schedule",
          "Second Schedule"
        ],
        "date": "2018-06-22"
      }
    ]
  }
}

Event Date Collection

Properties

Schema NameDescription
Event Date Collection any
Collection of event dates. The items in the collection are ordered in the _embedded object with name items. The top-level _links object may contain pagination links (self, next, prev, first, last, collection.) These pagination links require using POST and should pass the same Event Dates Request object as described in the findEventsDate operation.

allOf

Schema NameDescription
anonymous collection
A collection of resources. This is an abstract model schema which is extended to define specific resource collections.

and

Schema NameDescription
anonymous object
undefined
startDate string
The start date of events on this page.
period string
The length of time used to paginate event date results.
_embedded object
undefined
items [eventDate]
An array containing a page of event dates.

eventDate

{
  "labels": [
    "string"
  ],
  "date": "2018-04-05"
}

Event Date

Properties

Schema NameDescription
labels [string] (required)
The text label for this event, suitable for presentation to the client. This label references the one or more associated schedules.
date string(date) (required)
This date is in the ISO 8601 Date format, yyyy-mm-dd.

schedule

{
  "label": "Retirement savings transfer",
  "start": "2018-06-10",
  "every": "P14D",
  "count": 5,
  "skippedCount": 0,
  "maximumCount": 10,
  "skipNext": true,
  "end": "2018-08-01"
}

Schedule

Properties

Schema NameDescription
label string (required)
The text label for this schedule, suitable for presentation to the client. Events will use this label to reference a schedule.
start string
When the event occurs, or when a recurring event begins. This may be either a date in yyyy-mm-dd format, or a date-time in yyyy-mm-ddTHH:MM:SSZ format. If present, the time portion is a _hint_; the FI may not be able to schedule events at specific times. If start is omitted, the event will be scheduled for the next processing day. If start is the current day, the event may be scheduled for the next processing day if event processing has stopped for the day. If start is not provided, the current date will be used.
every string
The every period indicates the interval at which the event recurs, such as every week, every month, every 3 months. If omitted or empty, this event is a one-time event. every is required if either maximumCount is greater than 1 or if end is greater than start. This value is an ISO 8601 duration string of the form P[n]Y[n]M[n]D to specify the number of years/months/days between events. For example, use P7D to schedule every week, P2M to schedule every other month, P4Y to schedule every four years on the anniversary set by start. Time values in every are ignored but may be honored in the future. (That is, it is not possible to schedule an event every 8 hours; the minimum is P1D.) To specify semi-monthly or semi-annually, use P0.5M or P0.5Y. Fractional values are only allowed for month and year, and 0.5 is the only allowed fractional value. Some financial institutions may limit recurring events such that the period must be a year (P1Y, 'P12M, 'P365D) or less. Scheduling may adjust event dates if start occurs near boundary dates which do occur not every year/month, such as start: "2018-01-31", every: "P1M". For example, the next event may occur on the 30th for months which have only 30 days (Apr, Jun, Sep, Nov), or 29th or 28th for February. Actual event dates may also be adjusted to account for holidays or other days when processing does not occur.
count integer
For a recurring event, this is the number of events which have occurred. It is a derived value and ignored on updates.
skippedCount integer
For a recurring event, this is the number of events which have been skipped, either because a processing date passed when a recurring event had a value of true for skipNext, or a recurring event was suspended. It is a derived value and ignored on updates.
maximumCount integer
The maximum number of events to schedule for a recurring event. (Events in the recurrence will stop if the current date is beyond that set by end, even if fewer thanmaximumCountevents have occurred.) Theeveryperiod is required ifmaximumCountorendis set. It is an error (422) ifmaximumCountis anything other than 0 or 1 andeveryis not set. If a schedule contains bothendandmaximumCount`, the earliest will determine when the recurrence ends.
skipNext boolean
This field is ignored for one-time events. If true for recurring schedules, skip (do not schedule) the next event. After that instance is skipped, this field is reset to false (only one instance may be skipped).
end string
The date when the recurring event ends (inclusive). Events will occur until the maximumCount of events have occurred or the next scheduled event will be after the date or date-time specified in end. (Earliest of maximumCount or end wins.) If specified, end must be no earlier than start.

This has the same format as start (may be a ISO 8601 date or a date-time).

When scheduling an event, the request should contain either maximumCount or end, but not both. The other field will be computed.

calendar

{
  "holidays": [
    "2018-12-24",
    "2018-12-25"
  ],
  "unprocessableDays": [
    "sunday",
    "saturday"
  ]
}

Calendar

Properties

Schema NameDescription
holidays [string] (required)
A collection of dates on which events cannot occur. These dates should be in the ISO 8601 Date format, yyyy-mm-dd.
uniqueItems: true
unprocessableDays [string] (required)
A collection of days of the week on which events cannot occur.
uniqueItems: true

collection

{
  "_profile": "http://api.apiture.com/schemas/example/v1.0.0/profile.json",
  "_links": {
    "self": {
      "href": "{uri of current resource}"
    }
  },
  "count": 0,
  "start": 0,
  "limit": 0,
  "name": "string"
}

Collection

Properties

Schema NameDescription
Collection any
A collection of resources. This is an abstract model schema which is extended to define specific resource collections.

allOf

Schema NameDescription
anonymous abstractResource
An augmented HAL resource representation. This model contains hypermedia _links, and either optional domain object data with _profile and optional _embedded objects, or an _error object. In responses, if the operation was successful, this object will not include the _error, but if the operation was a 4xx or 5xx error, this object will not include _embedded or any data fields, only _error and optionally _links.

and

Schema NameDescription
anonymous object
undefined
count integer
The number of items in the full collection.
start integer
The start index of this page of items.
limit integer
The maximum number of items per page.
name string
The name of the collection.

{
  "property1": {
    "href": "http://example.com",
    "type": "string",
    "templated": true,
    "title": "string",
    "deprecation": "http://example.com",
    "profile": "http://example.com"
  },
  "property2": {
    "href": "http://example.com",
    "type": "string",
    "templated": true,
    "title": "string",
    "deprecation": "http://example.com",
    "profile": "http://example.com"
  }
}

Links

Properties

Schema NameDescription
additionalProperties link
Describes a hypermedia link within a _links object in HAL representations. In Apiture APIs, links are HAL links, but Apiture APIs do not use the name or hreflang properties of HAL. Apiture links may include a method property.

{
  "href": "http://example.com",
  "type": "string",
  "templated": true,
  "title": "string",
  "deprecation": "http://example.com",
  "profile": "http://example.com"
}

Link

Properties

Schema NameDescription
href string(uri) (required)
The URI or URI template for the resource/operation this link refers to.
type string
The media type for the resource.
templated boolean
If true, the link's href is a URI template.
title string
An optional human-readable localized title for the link.
deprecation string(uri)
If present, the containing link is deprecated and the value is a URI which provides human-readable text information about the deprecation.
profile string(uri)
The URI of a profile document, a JSON document which describes the target resource/operation.