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

Notifications v0.4.1

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 Notifications API manages the creation, organization, publishing and delivery of events or messages. This allows the Apiture system to inform loosely coupled recipients about events, changes, and actions.

Terminology

Behavior

When an event occurs, a service will POST a new message to a topic. The Notification service matches all active subscriptions on that topic and creates a notification for each subscription. The service stores pull notifications to be pulled later, or queues push notifications to a delivery queue.

By default, push notifications will persist in the /deliveryQueue for four days. During that time, the notifications service will attempt to call the external endpoint to deliver the message. Upon success, the notification is removed from the queue and moved to the /receivedNotifications collection. Received notifications can be retrieved at a later date for historical or audit logging purposes. If delivery fails after 4 days, the notification is moved to the /failedNotifications collection, which represents "dead letter queue".

Pull notifications skip the queueing process and are stored by the service. They can be fetched via a filtered GET query to /pullNotifications (operation getPullNotifications) or by GET to /topics/{topicId}/notifications (operation getNotificationsForTopic) or /subscriptions/{subscriptionId}/notifications (operation getNotificationsSubscription). After the client has processed the pull notification, it must acknowledge the notification by performing a POST operation to the href in the notification's _links.acknowledge link; this removes the notification from the active notifications collections. Pulled notifications that have not been acknowledged remain in the /pullNotifications collection and are considered by the service to be unacknowledged, which may result in duplicate processing of the notification.

The service publishes notifications to pre-existing topics, each of which may have any number of associated subscriptions. When a message is published to a topic, it notifies all active subscriptions and passes the notification body to them.

For example, a topic "LoanPaymentApplied" could be triggered any time a payment to a loan account has been applied. The topic is triggered by a POST to /notifications, where the request body has a _link to the topic. The topic could have two subscribers. The first subscription is a push subscription, which makes a callout to an authenticated endpoint. The server is configured to receive the request and send an SMS text message to the end user; the SMS number is in the subscription. A push subscription will be considered received by the endpoint server when a 200-level status code is received (including retries after 3xx status codes). The second subscription is a pull subscription. When pull subscriptions are triggered, the notification is added to a collection, where it waits until the client retrieves it.

Download OpenAPI Definition (YAML)

Base URLs:

Terms of service

Email: Apiture Web: Apiture

Authentication

Scope Scope Description
data/read Read access to non-account, non-profile data.
data/write Write (update) access to non-account, non-profile data.
data/delete Delete access to non-account, non-profile data.
data/full Full access to non-account, non-profile data.

API

Endpoints which describe this API.

getApiDoc

Code samples

# You can also use wget
curl -X GET /notifications/apiDoc \
  -H 'Accept: application/json' \
  -H 'API-Key: API_KEY'

GET /notifications/apiDoc HTTP/1.1

Accept: application/json

var headers = {
  'Accept':'application/json',
  'API-Key':'API_KEY'

};

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

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

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

const headers = {
  'Accept':'application/json',
  'API-Key':'API_KEY'

};

fetch('/notifications/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',
  'API-Key' => 'API_KEY'
}

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

p JSON.parse(result)

import requests
headers = {
  'Accept': 'application/json',
  'API-Key': 'API_KEY'
}

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

}, headers = headers)

print r.json()

URL obj = new URL("/notifications/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"},
        "API-Key": []string{"API_KEY"},
        
    }

    data := bytes.NewBuffer([]byte{jsonReq})
    req, err := http.NewRequest("GET", "/notifications/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.

Example responses

200 Response

{}

Responses

StatusDescription
200 OK
OK
Schema: Inline

Response Schema

getApi

Code samples

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

GET /notifications/ HTTP/1.1

Accept: application/hal+json

var headers = {
  'Accept':'application/hal+json',
  'API-Key':'API_KEY'

};

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

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

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

const headers = {
  'Accept':'application/hal+json',
  'API-Key':'API_KEY'

};

fetch('/notifications/',
{
  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',
  'API-Key' => 'API_KEY'
}

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

p JSON.parse(result)

import requests
headers = {
  'Accept': 'application/hal+json',
  'API-Key': 'API_KEY'
}

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

}, headers = headers)

print r.json()

URL obj = new URL("/notifications/");
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"},
        "API-Key": []string{"API_KEY"},
        
    }

    data := bytes.NewBuffer([]byte{jsonReq})
    req, err := http.NewRequest("GET", "/notifications/", 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.

Example responses

200 Response

{
  "id": "apiName",
  "name": "API name",
  "apiVersion": "0.0.1-SNAPSHOT",
  "_profile": "https://api.apiture.com/schemas/common/root/v1.0.0/profile.json",
  "_links": {}
}

Responses

StatusDescription
200 OK
OK
Schema: root

Published Messages

Messages published to topics

publishMessage

Code samples

# You can also use wget
curl -X POST /notifications/messages \
  -H 'Content-Type: application/hal+json' \
  -H 'Accept: application/hal+json' \
  -H 'API-Key: API_KEY' \
  -H 'Authorization: Bearer {access-token}'

POST /notifications/messages HTTP/1.1

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

var headers = {
  'Content-Type':'application/hal+json',
  'Accept':'application/hal+json',
  'API-Key':'API_KEY',
  'Authorization':'Bearer {access-token}'

};

$.ajax({
  url: '/notifications/messages',
  method: 'post',

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

const fetch = require('node-fetch');
const inputBody = '{
  "body": {
    "any": "valid",
    "json": "object"
  },
  "_links": {
    "apiture:topic": {
      "href": "https://api.apiture.com/notifications/topics/ef967d9f-8bf5-412e-ba31-7d9047cb96b4"
    },
    "apiture:entity": {
      "href": "https://api.apiture.com/accounts/account/ef967d9f-8bf5-412e-ba31-7d9047cb96b4"
    }
  }
}';
const headers = {
  'Content-Type':'application/hal+json',
  'Accept':'application/hal+json',
  'API-Key':'API_KEY',
  'Authorization':'Bearer {access-token}'

};

fetch('/notifications/messages',
{
  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/hal+json',
  'API-Key' => 'API_KEY',
  'Authorization' => 'Bearer {access-token}'
}

result = RestClient.post '/notifications/messages',
  params: {
  }, headers: headers

p JSON.parse(result)

import requests
headers = {
  'Content-Type': 'application/hal+json',
  'Accept': 'application/hal+json',
  'API-Key': 'API_KEY',
  'Authorization': 'Bearer {access-token}'
}

r = requests.post('/notifications/messages', params={

}, headers = headers)

print r.json()

URL obj = new URL("/notifications/messages");
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/hal+json"},
        "API-Key": []string{"API_KEY"},
        "Authorization": []string{"Bearer {access-token}"},
        
    }

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

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

Publish a notification message on a topic

POST /messages

Publish a message on a topic, creating zero or more notifications that are delivered according to each subscription on the topic. The message topic is specified with the link apiture:topic in the message request body. Subscription delivery passes the message body to each of its subscriptions. By default, a message body can contain up to 256 kb of text data, including JSON and unformatted text.

A response with status code 202 from this endpoint confirms that the service has successfully queued notifications for delivery.

A response with status code 413 indicates that the payload body exceeds the 256 kb size limit.

If the eventual delivery of the notification fails (for example, if the destination endpoint of a push subscription is unauthorized), errors will be recorded in the notification's _error object. A message may include an apiture:entity link containing the URI of any related entity. This denotes the primary resource that the message pertains to and is used for filtering notification to only recipients which are entitled to access the entity. If the topic referenced by the apiture:topic link does not exist, the request to create the notification will fail.

Body parameter

{
  "body": {
    "any": "valid",
    "json": "object"
  },
  "_links": {
    "apiture:topic": {
      "href": "https://api.apiture.com/notifications/topics/ef967d9f-8bf5-412e-ba31-7d9047cb96b4"
    },
    "apiture:entity": {
      "href": "https://api.apiture.com/accounts/account/ef967d9f-8bf5-412e-ba31-7d9047cb96b4"
    }
  }
}

Parameters

Parameter Description
body
(body)
createMessage (required)
The data necessary to create a new message.

Example responses

400 Response

{
  "_profile": "https://api.apiture.com/schemas/common/errorResponse/v1.0.0/profile.json",
  "_error": {
    "_id": "2eae46e1-575c-4d69-8a8f-0a7b0115a4b3",
    "_profile": "https://api.apiture.com/schemas/common/errorResponse/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": {},
    "_links": {
      "describedby": {
        "href": "http://doc.apiture.com/errors/positiveNumberRequired"
      }
    },
    "_embedded": {
      "errors": []
    }
  }
}

Responses

StatusDescription
202 Accepted
Accepted
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
413 Payload Too Large
Payload to large. The request entity is larger than the limits defined by the server.
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

Notification

Endpoints which facilitate the delivery of notifications.

getPullNotifications

Code samples

# You can also use wget
curl -X GET /notifications/pullNotifications \
  -H 'Accept: application/hal+json' \
  -H 'API-Key: API_KEY' \
  -H 'Authorization: Bearer {access-token}'

GET /notifications/pullNotifications HTTP/1.1

Accept: application/hal+json

var headers = {
  'Accept':'application/hal+json',
  'API-Key':'API_KEY',
  'Authorization':'Bearer {access-token}'

};

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

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

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

const headers = {
  'Accept':'application/hal+json',
  'API-Key':'API_KEY',
  'Authorization':'Bearer {access-token}'

};

fetch('/notifications/pullNotifications',
{
  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',
  'API-Key' => 'API_KEY',
  'Authorization' => 'Bearer {access-token}'
}

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

p JSON.parse(result)

import requests
headers = {
  'Accept': 'application/hal+json',
  'API-Key': 'API_KEY',
  'Authorization': 'Bearer {access-token}'
}

r = requests.get('/notifications/pullNotifications', params={

}, headers = headers)

print r.json()

URL obj = new URL("/notifications/pullNotifications");
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"},
        "API-Key": []string{"API_KEY"},
        "Authorization": []string{"Bearer {access-token}"},
        
    }

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

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

Returns a collection of pull notification resources

GET /pullNotifications

Return a paginated sortable filterable searchable collection of notifications. These are pull notifications which have been created based on a topic and a pull subscrioption and are available for delivery polling. The links in the response include pagination links.

Parameters

Parameter Description
subscription
(query)
string
A string which identifies a specific subscription. The value may be a {subscriptionId} or a subscription URI.
subscriptionUri
(query)
string
The unique resource identifier of this subscription. This parameter is deprecated. Use the ?subscription= query parameter instead.
topic
(query)
string
A string which identifies a specific topic The value may be a {topicId} or a topic URI.
state
(query)
string
Subset the accounts or external accounts collection to those whose state matches this value. Use | to separate multiple values. For example, ?state=pending will match only items whose state is pending; ?state=removed|inactive will match items whose state is removed or inactive. This is combined with an implicit and with other filters if they are used. See filtering.
Enumerated values:
active
inactive
createdAt
(query)
string(date-time)
Subset the accounts or external accounts collection to those with this createdAt value. Use | to separate multiple values. For example, ?createdAt=2018-04-17T10:04:46.375Z will match only items whose createdAt is 2018-04-17T10:04:46.375Z; ?createdAt=2018-04-17T10:04:46.375Z|2018-05-17T10:04:46.375Z will match items whose createdAt is 2018-04-17T10:04:46.375Z or 2018-05-17T10:04:46.375Z. This is combined with an implicit and with other filters if they are used. See filtering.
updatedAt
(query)
string(date-time)
Subset the accounts or external accounts collection to those with this updatedAt value. Use | to separate multiple values. For example, ?updatedAt=2018-04-17T10:04:46.375Z will match only items whose updatedAt is 2018-04-17T10:04:46.375Z; ?updatedAt=2018-04-17T10:04:46.375Z|2018-05-17T10:04:46.375Z will match items whose updatedAt is 2018-04-17T10:04:46.375Z or 2018-05-17T10:04:46.375Z. This is combined with an implicit and with other filters if they are used. See filtering.
start
(query)
integer(int64)
The zero-based index of the first notification item to include in this page. The default 0 denotes the beginning of the collection.
limit
(query)
integer(int32)
The maximum number of notification representations to return in this page.
sortBy
(query)
string
Optional sort criteria. See sort criteria format, such as ?sortBy=field1,-field2.
filter
(query)
string
Optional filter criteria. See filtering.
q
(query)
string
Optional search string. See searching.

Example responses

200 Response

{
  "_profile": "https://api.apiture.com/schemas/notifications/notifications/v1.0.0/profile.json",
  "start": 10,
  "limit": 10,
  "count": 67,
  "name": "notifications",
  "_links": {
    "self": {
      "href": "/basePath/notifications?start=10&limit=10"
    },
    "first": {
      "href": "/basePath/notifications?start=0&limit=10"
    },
    "next": {
      "href": "/basePath/notifications?start=20&limit=10"
    },
    "collection": {
      "href": "/basePath/notifications"
    }
  },
  "_embedded": {
    "items": [
      {
        "_id": "0399abed-fd3d-4830-a88b-30f38b8a365c",
        "_profile": "https://api.apiture.com/schemas/notifications/notification/v1.0.0/profile.json",
        "_links": {
          "self": {
            "href": "/basePath/notifications/0399abed-fd3d-4830-a88b-30f38b8a365c"
          }
        }
      },
      {
        "_id": "d62c0701-0d74-4836-83f9-ebf3709442ea",
        "_profile": "https://api.apiture.com/schemas/notifications/notification/v1.0.0/profile.json",
        "_links": {
          "self": {
            "href": "/basePath/notifications/d62c0701-0d74-4836-83f9-ebf3709442ea"
          }
        }
      }
    ]
  }
}

Responses

StatusDescription
200 OK
OK
Schema: notifications
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

getPullNotification

Code samples

# You can also use wget
curl -X GET /notifications/pullNotifications/{notificationId} \
  -H 'Accept: application/hal+json' \
  -H 'API-Key: API_KEY' \
  -H 'Authorization: Bearer {access-token}'

GET /notifications/pullNotifications/{notificationId} HTTP/1.1

Accept: application/hal+json

var headers = {
  'Accept':'application/hal+json',
  'API-Key':'API_KEY',
  'Authorization':'Bearer {access-token}'

};

$.ajax({
  url: '/notifications/pullNotifications/{notificationId}',
  method: 'get',

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

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

const headers = {
  'Accept':'application/hal+json',
  'API-Key':'API_KEY',
  'Authorization':'Bearer {access-token}'

};

fetch('/notifications/pullNotifications/{notificationId}',
{
  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',
  'API-Key' => 'API_KEY',
  'Authorization' => 'Bearer {access-token}'
}

result = RestClient.get '/notifications/pullNotifications/{notificationId}',
  params: {
  }, headers: headers

p JSON.parse(result)

import requests
headers = {
  'Accept': 'application/hal+json',
  'API-Key': 'API_KEY',
  'Authorization': 'Bearer {access-token}'
}

r = requests.get('/notifications/pullNotifications/{notificationId}', params={

}, headers = headers)

print r.json()

URL obj = new URL("/notifications/pullNotifications/{notificationId}");
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"},
        "API-Key": []string{"API_KEY"},
        "Authorization": []string{"Bearer {access-token}"},
        
    }

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

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

Fetch a representation of this pull notification

GET /pullNotifications/{notificationId}

Return a HAL representation of this notification resource.

Parameters

Parameter Description
notificationId
(path)
string (required)
The unique identifier of this notification. This is an opaque string.

Example responses

200 Response

{
  "_id": "0399abed-fd3d-4830-a88b-30f38b8a365c",
  "_profile": "https://api.apiture.com/schemas/notifications/notification/v1.0.0/profile.json",
  "createdAt": "2018-04-17T10:04:46.375Z",
  "updatedAt": "2018-04-17T10:12:58.375Z",
  "_links": {
    "apiture:topic": {
      "href": "https://api.apiture.com/notifications/topics/ef967d9f-8bf5-412e-ba31-7d9047cb96b4"
    },
    "apiture:subscription": {
      "href": "https://api.apiture.com/notifications/subscriptions/ff968d9f-8bf7-412e-ba31-7d9047cb96b3"
    },
    "apiture:entity": {
      "href": "https://api.apiture.com/users/user/ff968d9f-8bf7-412e-ba31-7d9047cb96b3"
    },
    "apiture:acknowledge": {
      "href": "https://api.apiture.com/notifications/receivedNotifications?notification=https://api.apiture.com/notifications/pullNotifications/ff968d9f-8bf7-412e-ba31-7d9047cb96b3"
    }
  }
}

Responses

StatusDescription
200 OK
OK
Schema: notification
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
404 Not Found
Not Found. There is no such notification resource at the specified {notificationId} 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

deleteNotification

Code samples

# You can also use wget
curl -X DELETE /notifications/pullNotifications/{notificationId} \
  -H 'Accept: application/hal+json' \
  -H 'If-Match: string' \
  -H 'API-Key: API_KEY' \
  -H 'Authorization: Bearer {access-token}'

DELETE /notifications/pullNotifications/{notificationId} HTTP/1.1

Accept: application/hal+json
If-Match: string

var headers = {
  'Accept':'application/hal+json',
  'If-Match':'string',
  'API-Key':'API_KEY',
  'Authorization':'Bearer {access-token}'

};

$.ajax({
  url: '/notifications/pullNotifications/{notificationId}',
  method: 'delete',

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

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

const headers = {
  'Accept':'application/hal+json',
  'If-Match':'string',
  'API-Key':'API_KEY',
  'Authorization':'Bearer {access-token}'

};

fetch('/notifications/pullNotifications/{notificationId}',
{
  method: 'DELETE',

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

require 'rest-client'
require 'json'

headers = {
  'Accept' => 'application/hal+json',
  'If-Match' => 'string',
  'API-Key' => 'API_KEY',
  'Authorization' => 'Bearer {access-token}'
}

result = RestClient.delete '/notifications/pullNotifications/{notificationId}',
  params: {
  }, headers: headers

p JSON.parse(result)

import requests
headers = {
  'Accept': 'application/hal+json',
  'If-Match': 'string',
  'API-Key': 'API_KEY',
  'Authorization': 'Bearer {access-token}'
}

r = requests.delete('/notifications/pullNotifications/{notificationId}', params={

}, headers = headers)

print r.json()

URL obj = new URL("/notifications/pullNotifications/{notificationId}");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("DELETE");
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"},
        "If-Match": []string{"string"},
        "API-Key": []string{"API_KEY"},
        "Authorization": []string{"Bearer {access-token}"},
        
    }

    data := bytes.NewBuffer([]byte{jsonReq})
    req, err := http.NewRequest("DELETE", "/notifications/pullNotifications/{notificationId}", data)
    req.Header = headers

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

Delete this notification resource

DELETE /pullNotifications/{notificationId}

Delete this notification resource. Note that deleting a notification does not cancel in-flight delivery to subscribers.

Parameters

Parameter Description
If-Match
(header)
string
The entity tag that was returned in the ETag response. This must match the current entity tag of the resource.
notificationId
(path)
string (required)
The unique identifier of this notification. This is an opaque string.

Example responses

400 Response

{
  "_profile": "https://api.apiture.com/schemas/common/errorResponse/v1.0.0/profile.json",
  "_error": {
    "_id": "2eae46e1-575c-4d69-8a8f-0a7b0115a4b3",
    "_profile": "https://api.apiture.com/schemas/common/errorResponse/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": {},
    "_links": {
      "describedby": {
        "href": "http://doc.apiture.com/errors/positiveNumberRequired"
      }
    },
    "_embedded": {
      "errors": []
    }
  }
}

Responses

StatusDescription
204 No Content
No Content. The resource was deleted successfully.
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
404 Not Found
Not Found. There is no such notification resource at the specified {notificationId} The _error field in the response will contain details about the request error.
Schema: errorResponse
412 Precondition Failed
Precondition Failed. The supplied if-Match header value does not match the most recent ETag response header value. The resource has changed in the interim.
Schema: errorResponse

getDeliveryQueue

Code samples

# You can also use wget
curl -X GET /notifications/deliveryQueue \
  -H 'Accept: application/hal+json' \
  -H 'API-Key: API_KEY' \
  -H 'Authorization: Bearer {access-token}'

GET /notifications/deliveryQueue HTTP/1.1

Accept: application/hal+json

var headers = {
  'Accept':'application/hal+json',
  'API-Key':'API_KEY',
  'Authorization':'Bearer {access-token}'

};

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

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

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

const headers = {
  'Accept':'application/hal+json',
  'API-Key':'API_KEY',
  'Authorization':'Bearer {access-token}'

};

fetch('/notifications/deliveryQueue',
{
  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',
  'API-Key' => 'API_KEY',
  'Authorization' => 'Bearer {access-token}'
}

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

p JSON.parse(result)

import requests
headers = {
  'Accept': 'application/hal+json',
  'API-Key': 'API_KEY',
  'Authorization': 'Bearer {access-token}'
}

r = requests.get('/notifications/deliveryQueue', params={

}, headers = headers)

print r.json()

URL obj = new URL("/notifications/deliveryQueue");
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"},
        "API-Key": []string{"API_KEY"},
        "Authorization": []string{"Bearer {access-token}"},
        
    }

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

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

Returns a collection of push notifications that are queued for delivery

GET /deliveryQueue

Return a paginated sortable filterable searchable collection of notifications. These are notifications which have been created and are available for delivery. The links in the response include pagination links.

Parameters

Parameter Description
subscription
(query)
string
A string which identifies a specific subscription. The value may be a {subscriptionId} or a subscription URI.
subscriptionUri
(query)
string
The unique resource identifier of this subscription. This parameter is deprecated. Use the ?subscription= query parameter instead.
topic
(query)
string
A string which identifies a specific topic The value may be a {topicId} or a topic URI.
start
(query)
integer(int64)
The zero-based index of the first notification item to include in this page. The default 0 denotes the beginning of the collection.
limit
(query)
integer(int32)
The maximum number of notification representations to return in this page.
sortBy
(query)
string
Optional sort criteria. See sort criteria format, such as ?sortBy=field1,-field2.
filter
(query)
string
Optional filter criteria. See filtering.
q
(query)
string
Optional search string. See searching.

Example responses

200 Response

{
  "_profile": "https://api.apiture.com/schemas/notifications/notifications/v1.0.0/profile.json",
  "start": 10,
  "limit": 10,
  "count": 67,
  "name": "notifications",
  "_links": {
    "self": {
      "href": "/basePath/notifications?start=10&limit=10"
    },
    "first": {
      "href": "/basePath/notifications?start=0&limit=10"
    },
    "next": {
      "href": "/basePath/notifications?start=20&limit=10"
    },
    "collection": {
      "href": "/basePath/notifications"
    }
  },
  "_embedded": {
    "items": [
      {
        "_id": "0399abed-fd3d-4830-a88b-30f38b8a365c",
        "_profile": "https://api.apiture.com/schemas/notifications/notification/v1.0.0/profile.json",
        "_links": {
          "self": {
            "href": "/basePath/notifications/0399abed-fd3d-4830-a88b-30f38b8a365c"
          }
        }
      },
      {
        "_id": "d62c0701-0d74-4836-83f9-ebf3709442ea",
        "_profile": "https://api.apiture.com/schemas/notifications/notification/v1.0.0/profile.json",
        "_links": {
          "self": {
            "href": "/basePath/notifications/d62c0701-0d74-4836-83f9-ebf3709442ea"
          }
        }
      }
    ]
  }
}

Responses

StatusDescription
200 OK
OK
Schema: notifications
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

getPushNotification

Code samples

# You can also use wget
curl -X GET /notifications/deliveryQueue/{notificationId} \
  -H 'Accept: application/hal+json' \
  -H 'API-Key: API_KEY' \
  -H 'Authorization: Bearer {access-token}'

GET /notifications/deliveryQueue/{notificationId} HTTP/1.1

Accept: application/hal+json

var headers = {
  'Accept':'application/hal+json',
  'API-Key':'API_KEY',
  'Authorization':'Bearer {access-token}'

};

$.ajax({
  url: '/notifications/deliveryQueue/{notificationId}',
  method: 'get',

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

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

const headers = {
  'Accept':'application/hal+json',
  'API-Key':'API_KEY',
  'Authorization':'Bearer {access-token}'

};

fetch('/notifications/deliveryQueue/{notificationId}',
{
  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',
  'API-Key' => 'API_KEY',
  'Authorization' => 'Bearer {access-token}'
}

result = RestClient.get '/notifications/deliveryQueue/{notificationId}',
  params: {
  }, headers: headers

p JSON.parse(result)

import requests
headers = {
  'Accept': 'application/hal+json',
  'API-Key': 'API_KEY',
  'Authorization': 'Bearer {access-token}'
}

r = requests.get('/notifications/deliveryQueue/{notificationId}', params={

}, headers = headers)

print r.json()

URL obj = new URL("/notifications/deliveryQueue/{notificationId}");
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"},
        "API-Key": []string{"API_KEY"},
        "Authorization": []string{"Bearer {access-token}"},
        
    }

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

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

Fetch a representation of a queued push notification

GET /deliveryQueue/{notificationId}

Return a HAL representation of this notification resource.

Parameters

Parameter Description
notificationId
(path)
string (required)
The unique identifier of this notification. This is an opaque string.

Example responses

200 Response

{
  "_id": "0399abed-fd3d-4830-a88b-30f38b8a365c",
  "_profile": "https://api.apiture.com/schemas/notifications/notification/v1.0.0/profile.json",
  "createdAt": "2018-04-17T10:04:46.375Z",
  "updatedAt": "2018-04-17T10:12:58.375Z",
  "_links": {
    "apiture:topic": {
      "href": "https://api.apiture.com/notifications/topics/ef967d9f-8bf5-412e-ba31-7d9047cb96b4"
    },
    "apiture:subscription": {
      "href": "https://api.apiture.com/notifications/subscriptions/ff968d9f-8bf7-412e-ba31-7d9047cb96b3"
    },
    "apiture:entity": {
      "href": "https://api.apiture.com/users/user/ff968d9f-8bf7-412e-ba31-7d9047cb96b3"
    },
    "apiture:acknowledge": {
      "href": "https://api.apiture.com/notifications/receivedNotifications?notification=https://api.apiture.com/notifications/pullNotifications/ff968d9f-8bf7-412e-ba31-7d9047cb96b3"
    }
  }
}

Responses

StatusDescription
200 OK
OK
Schema: notification
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
404 Not Found
Not Found. There is no such notification resource at the specified {notificationId} 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

deletePushNotification

Code samples

# You can also use wget
curl -X DELETE /notifications/deliveryQueue/{notificationId} \
  -H 'Accept: application/hal+json' \
  -H 'If-Match: string' \
  -H 'API-Key: API_KEY' \
  -H 'Authorization: Bearer {access-token}'

DELETE /notifications/deliveryQueue/{notificationId} HTTP/1.1

Accept: application/hal+json
If-Match: string

var headers = {
  'Accept':'application/hal+json',
  'If-Match':'string',
  'API-Key':'API_KEY',
  'Authorization':'Bearer {access-token}'

};

$.ajax({
  url: '/notifications/deliveryQueue/{notificationId}',
  method: 'delete',

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

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

const headers = {
  'Accept':'application/hal+json',
  'If-Match':'string',
  'API-Key':'API_KEY',
  'Authorization':'Bearer {access-token}'

};

fetch('/notifications/deliveryQueue/{notificationId}',
{
  method: 'DELETE',

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

require 'rest-client'
require 'json'

headers = {
  'Accept' => 'application/hal+json',
  'If-Match' => 'string',
  'API-Key' => 'API_KEY',
  'Authorization' => 'Bearer {access-token}'
}

result = RestClient.delete '/notifications/deliveryQueue/{notificationId}',
  params: {
  }, headers: headers

p JSON.parse(result)

import requests
headers = {
  'Accept': 'application/hal+json',
  'If-Match': 'string',
  'API-Key': 'API_KEY',
  'Authorization': 'Bearer {access-token}'
}

r = requests.delete('/notifications/deliveryQueue/{notificationId}', params={

}, headers = headers)

print r.json()

URL obj = new URL("/notifications/deliveryQueue/{notificationId}");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("DELETE");
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"},
        "If-Match": []string{"string"},
        "API-Key": []string{"API_KEY"},
        "Authorization": []string{"Bearer {access-token}"},
        
    }

    data := bytes.NewBuffer([]byte{jsonReq})
    req, err := http.NewRequest("DELETE", "/notifications/deliveryQueue/{notificationId}", data)
    req.Header = headers

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

Delete this notification resource

DELETE /deliveryQueue/{notificationId}

Delete this notification resource. Note that deleting a notification does not cancel delivery to subscribers. Notifications are typically already queued by the time they are available for deletion from storage.

Parameters

Parameter Description
If-Match
(header)
string
The entity tag that was returned in the ETag response. This must match the current entity tag of the resource.
notificationId
(path)
string (required)
The unique identifier of this notification. This is an opaque string.

Example responses

400 Response

{
  "_profile": "https://api.apiture.com/schemas/common/errorResponse/v1.0.0/profile.json",
  "_error": {
    "_id": "2eae46e1-575c-4d69-8a8f-0a7b0115a4b3",
    "_profile": "https://api.apiture.com/schemas/common/errorResponse/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": {},
    "_links": {
      "describedby": {
        "href": "http://doc.apiture.com/errors/positiveNumberRequired"
      }
    },
    "_embedded": {
      "errors": []
    }
  }
}

Responses

StatusDescription
204 No Content
No Content. The resource was deleted successfully.
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
404 Not Found
Not Found. There is no such notification resource at the specified {notificationId} The _error field in the response will contain details about the request error.
Schema: errorResponse
412 Precondition Failed
Precondition Failed. The supplied if-Match header value does not match the most recent ETag response header value. The resource has changed in the interim.
Schema: errorResponse

getFailedNotifications

Code samples

# You can also use wget
curl -X GET /notifications/failedNotifications \
  -H 'Accept: application/hal+json' \
  -H 'API-Key: API_KEY' \
  -H 'Authorization: Bearer {access-token}'

GET /notifications/failedNotifications HTTP/1.1

Accept: application/hal+json

var headers = {
  'Accept':'application/hal+json',
  'API-Key':'API_KEY',
  'Authorization':'Bearer {access-token}'

};

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

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

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

const headers = {
  'Accept':'application/hal+json',
  'API-Key':'API_KEY',
  'Authorization':'Bearer {access-token}'

};

fetch('/notifications/failedNotifications',
{
  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',
  'API-Key' => 'API_KEY',
  'Authorization' => 'Bearer {access-token}'
}

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

p JSON.parse(result)

import requests
headers = {
  'Accept': 'application/hal+json',
  'API-Key': 'API_KEY',
  'Authorization': 'Bearer {access-token}'
}

r = requests.get('/notifications/failedNotifications', params={

}, headers = headers)

print r.json()

URL obj = new URL("/notifications/failedNotifications");
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"},
        "API-Key": []string{"API_KEY"},
        "Authorization": []string{"Bearer {access-token}"},
        
    }

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

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

Returns a collection of failed notifications

GET /failedNotifications

Return a paginated sortable filterable searchable collection of notifications. These are notifications which have been created and are available for delivery and polling. The links in the response include pagination links.

Parameters

Parameter Description
subscription
(query)
string
A string which identifies a specific subscription. The value may be a {subscriptionId} or a subscription URI.
topic
(query)
string
A string which identifies a specific topic The value may be a {topicId} or a topic URI.
start
(query)
integer(int64)
The zero-based index of the first notification item to include in this page. The default 0 denotes the beginning of the collection.
limit
(query)
integer(int32)
The maximum number of notification representations to return in this page.
sortBy
(query)
string
Optional sort criteria. See sort criteria format, such as ?sortBy=field1,-field2.
filter
(query)
string
Optional filter criteria. See filtering.
q
(query)
string
Optional search string. See searching.

Example responses

200 Response

{
  "_profile": "https://api.apiture.com/schemas/notifications/notifications/v1.0.0/profile.json",
  "start": 10,
  "limit": 10,
  "count": 67,
  "name": "notifications",
  "_links": {
    "self": {
      "href": "/basePath/notifications?start=10&limit=10"
    },
    "first": {
      "href": "/basePath/notifications?start=0&limit=10"
    },
    "next": {
      "href": "/basePath/notifications?start=20&limit=10"
    },
    "collection": {
      "href": "/basePath/notifications"
    }
  },
  "_embedded": {
    "items": [
      {
        "_id": "0399abed-fd3d-4830-a88b-30f38b8a365c",
        "_profile": "https://api.apiture.com/schemas/notifications/notification/v1.0.0/profile.json",
        "_links": {
          "self": {
            "href": "/basePath/notifications/0399abed-fd3d-4830-a88b-30f38b8a365c"
          }
        }
      },
      {
        "_id": "d62c0701-0d74-4836-83f9-ebf3709442ea",
        "_profile": "https://api.apiture.com/schemas/notifications/notification/v1.0.0/profile.json",
        "_links": {
          "self": {
            "href": "/basePath/notifications/d62c0701-0d74-4836-83f9-ebf3709442ea"
          }
        }
      }
    ]
  }
}

Responses

StatusDescription
200 OK
OK
Schema: notifications
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

getFailedNotification

Code samples

# You can also use wget
curl -X GET /notifications/failedNotifications/{notificationId} \
  -H 'Accept: application/hal+json' \
  -H 'API-Key: API_KEY' \
  -H 'Authorization: Bearer {access-token}'

GET /notifications/failedNotifications/{notificationId} HTTP/1.1

Accept: application/hal+json

var headers = {
  'Accept':'application/hal+json',
  'API-Key':'API_KEY',
  'Authorization':'Bearer {access-token}'

};

$.ajax({
  url: '/notifications/failedNotifications/{notificationId}',
  method: 'get',

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

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

const headers = {
  'Accept':'application/hal+json',
  'API-Key':'API_KEY',
  'Authorization':'Bearer {access-token}'

};

fetch('/notifications/failedNotifications/{notificationId}',
{
  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',
  'API-Key' => 'API_KEY',
  'Authorization' => 'Bearer {access-token}'
}

result = RestClient.get '/notifications/failedNotifications/{notificationId}',
  params: {
  }, headers: headers

p JSON.parse(result)

import requests
headers = {
  'Accept': 'application/hal+json',
  'API-Key': 'API_KEY',
  'Authorization': 'Bearer {access-token}'
}

r = requests.get('/notifications/failedNotifications/{notificationId}', params={

}, headers = headers)

print r.json()

URL obj = new URL("/notifications/failedNotifications/{notificationId}");
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"},
        "API-Key": []string{"API_KEY"},
        "Authorization": []string{"Bearer {access-token}"},
        
    }

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

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

Fetch a representation of this failed notification

GET /failedNotifications/{notificationId}

Return a paginated sortable filterable searchable collection of notifications. These are notifications which have been created and are available for delivery and polling. The links in the response include pagination links.

Parameters

Parameter Description
start
(query)
integer(int64)
The zero-based index of the first notification item to include in this page. The default 0 denotes the beginning of the collection.
limit
(query)
integer(int32)
The maximum number of notification representations to return in this page.
sortBy
(query)
string
Optional sort criteria. See sort criteria format, such as ?sortBy=field1,-field2.
filter
(query)
string
Optional filter criteria. See filtering.
q
(query)
string
Optional search string. See searching.
notificationId
(path)
string (required)
The unique identifier of this notification. This is an opaque string.

Example responses

200 Response

{
  "_id": "0399abed-fd3d-4830-a88b-30f38b8a365c",
  "_profile": "https://api.apiture.com/schemas/notifications/notification/v1.0.0/profile.json",
  "createdAt": "2018-04-17T10:04:46.375Z",
  "updatedAt": "2018-04-17T10:12:58.375Z",
  "_links": {
    "apiture:topic": {
      "href": "https://api.apiture.com/notifications/topics/ef967d9f-8bf5-412e-ba31-7d9047cb96b4"
    },
    "apiture:subscription": {
      "href": "https://api.apiture.com/notifications/subscriptions/ff968d9f-8bf7-412e-ba31-7d9047cb96b3"
    },
    "apiture:entity": {
      "href": "https://api.apiture.com/users/user/ff968d9f-8bf7-412e-ba31-7d9047cb96b3"
    },
    "apiture:acknowledge": {
      "href": "https://api.apiture.com/notifications/receivedNotifications?notification=https://api.apiture.com/notifications/pullNotifications/ff968d9f-8bf7-412e-ba31-7d9047cb96b3"
    }
  }
}

Responses

StatusDescription
200 OK
OK
Schema: notification
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

getReceivedNotifications

Code samples

# You can also use wget
curl -X GET /notifications/receivedNotifications \
  -H 'Accept: application/hal+json' \
  -H 'API-Key: API_KEY' \
  -H 'Authorization: Bearer {access-token}'

GET /notifications/receivedNotifications HTTP/1.1

Accept: application/hal+json

var headers = {
  'Accept':'application/hal+json',
  'API-Key':'API_KEY',
  'Authorization':'Bearer {access-token}'

};

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

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

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

const headers = {
  'Accept':'application/hal+json',
  'API-Key':'API_KEY',
  'Authorization':'Bearer {access-token}'

};

fetch('/notifications/receivedNotifications',
{
  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',
  'API-Key' => 'API_KEY',
  'Authorization' => 'Bearer {access-token}'
}

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

p JSON.parse(result)

import requests
headers = {
  'Accept': 'application/hal+json',
  'API-Key': 'API_KEY',
  'Authorization': 'Bearer {access-token}'
}

r = requests.get('/notifications/receivedNotifications', params={

}, headers = headers)

print r.json()

URL obj = new URL("/notifications/receivedNotifications");
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"},
        "API-Key": []string{"API_KEY"},
        "Authorization": []string{"Bearer {access-token}"},
        
    }

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

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

Returns a collection of notifications which have been received

GET /receivedNotifications

Return a paginated sortable filterable searchable collection of notifications. These are notifications which have been delivered through either push or pull. The links in the response include pagination links.

Parameters

Parameter Description
subscription
(query)
string
A string which identifies a specific subscription. The value may be a {subscriptionId} or a subscription URI.
topic
(query)
string
A string which identifies a specific topic The value may be a {topicId} or a topic URI.
start
(query)
integer(int64)
The zero-based index of the first notification item to include in this page. The default 0 denotes the beginning of the collection.
limit
(query)
integer(int32)
The maximum number of notification representations to return in this page.
sortBy
(query)
string
Optional sort criteria. See sort criteria format, such as ?sortBy=field1,-field2.
filter
(query)
string
Optional filter criteria. See filtering.
q
(query)
string
Optional search string. See searching.

Example responses

200 Response

{
  "_profile": "https://api.apiture.com/schemas/notifications/notifications/v1.0.0/profile.json",
  "start": 10,
  "limit": 10,
  "count": 67,
  "name": "notifications",
  "_links": {
    "self": {
      "href": "/basePath/notifications?start=10&limit=10"
    },
    "first": {
      "href": "/basePath/notifications?start=0&limit=10"
    },
    "next": {
      "href": "/basePath/notifications?start=20&limit=10"
    },
    "collection": {
      "href": "/basePath/notifications"
    }
  },
  "_embedded": {
    "items": [
      {
        "_id": "0399abed-fd3d-4830-a88b-30f38b8a365c",
        "_profile": "https://api.apiture.com/schemas/notifications/notification/v1.0.0/profile.json",
        "_links": {
          "self": {
            "href": "/basePath/notifications/0399abed-fd3d-4830-a88b-30f38b8a365c"
          }
        }
      },
      {
        "_id": "d62c0701-0d74-4836-83f9-ebf3709442ea",
        "_profile": "https://api.apiture.com/schemas/notifications/notification/v1.0.0/profile.json",
        "_links": {
          "self": {
            "href": "/basePath/notifications/d62c0701-0d74-4836-83f9-ebf3709442ea"
          }
        }
      }
    ]
  }
}

Responses

StatusDescription
200 OK
OK
Schema: notifications
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

acknowledgeNotification

Code samples

# You can also use wget
curl -X POST /notifications/receivedNotifications \
  -H 'Accept: application/hal+json' \
  -H 'API-Key: API_KEY' \
  -H 'Authorization: Bearer {access-token}'

POST /notifications/receivedNotifications HTTP/1.1

Accept: application/hal+json

var headers = {
  'Accept':'application/hal+json',
  'API-Key':'API_KEY',
  'Authorization':'Bearer {access-token}'

};

$.ajax({
  url: '/notifications/receivedNotifications',
  method: 'post',

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

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

const headers = {
  'Accept':'application/hal+json',
  'API-Key':'API_KEY',
  'Authorization':'Bearer {access-token}'

};

fetch('/notifications/receivedNotifications',
{
  method: 'POST',

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

require 'rest-client'
require 'json'

headers = {
  'Accept' => 'application/hal+json',
  'API-Key' => 'API_KEY',
  'Authorization' => 'Bearer {access-token}'
}

result = RestClient.post '/notifications/receivedNotifications',
  params: {
  }, headers: headers

p JSON.parse(result)

import requests
headers = {
  'Accept': 'application/hal+json',
  'API-Key': 'API_KEY',
  'Authorization': 'Bearer {access-token}'
}

r = requests.post('/notifications/receivedNotifications', params={

}, headers = headers)

print r.json()

URL obj = new URL("/notifications/receivedNotifications");
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{
        "Accept": []string{"application/hal+json"},
        "API-Key": []string{"API_KEY"},
        "Authorization": []string{"Bearer {access-token}"},
        
    }

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

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

Acknowledges a notification as received

POST /receivedNotifications

This operation Primarily for pull notifications. This changes the state of a notification to received, and removes the notification from the active collections and moves it to the /receivedNotifications collection.

This operation is invoked via a POST to the href in a pull notifcation's apiture:acknowledge link.

Parameters

Parameter Description
notification
(query)
string
A string which identifies a specific notification. The value may be a {notificationId} or a notification URI.

Example responses

200 Response

{
  "_id": "0399abed-fd3d-4830-a88b-30f38b8a365c",
  "_profile": "https://api.apiture.com/schemas/notifications/notification/v1.0.0/profile.json",
  "createdAt": "2018-04-17T10:04:46.375Z",
  "updatedAt": "2018-04-17T10:12:58.375Z",
  "_links": {
    "apiture:topic": {
      "href": "https://api.apiture.com/notifications/topics/ef967d9f-8bf5-412e-ba31-7d9047cb96b4"
    },
    "apiture:subscription": {
      "href": "https://api.apiture.com/notifications/subscriptions/ff968d9f-8bf7-412e-ba31-7d9047cb96b3"
    },
    "apiture:entity": {
      "href": "https://api.apiture.com/users/user/ff968d9f-8bf7-412e-ba31-7d9047cb96b3"
    },
    "apiture:acknowledge": {
      "href": "https://api.apiture.com/notifications/receivedNotifications?notification=https://api.apiture.com/notifications/pullNotifications/ff968d9f-8bf7-412e-ba31-7d9047cb96b3"
    }
  }
}

Responses

StatusDescription
200 OK
OK
Schema: notification
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

getReceivedNotification

Code samples

# You can also use wget
curl -X GET /notifications/receivedNotifications/{notificationId} \
  -H 'Accept: application/hal+json' \
  -H 'API-Key: API_KEY' \
  -H 'Authorization: Bearer {access-token}'

GET /notifications/receivedNotifications/{notificationId} HTTP/1.1

Accept: application/hal+json

var headers = {
  'Accept':'application/hal+json',
  'API-Key':'API_KEY',
  'Authorization':'Bearer {access-token}'

};

$.ajax({
  url: '/notifications/receivedNotifications/{notificationId}',
  method: 'get',

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

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

const headers = {
  'Accept':'application/hal+json',
  'API-Key':'API_KEY',
  'Authorization':'Bearer {access-token}'

};

fetch('/notifications/receivedNotifications/{notificationId}',
{
  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',
  'API-Key' => 'API_KEY',
  'Authorization' => 'Bearer {access-token}'
}

result = RestClient.get '/notifications/receivedNotifications/{notificationId}',
  params: {
  }, headers: headers

p JSON.parse(result)

import requests
headers = {
  'Accept': 'application/hal+json',
  'API-Key': 'API_KEY',
  'Authorization': 'Bearer {access-token}'
}

r = requests.get('/notifications/receivedNotifications/{notificationId}', params={

}, headers = headers)

print r.json()

URL obj = new URL("/notifications/receivedNotifications/{notificationId}");
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"},
        "API-Key": []string{"API_KEY"},
        "Authorization": []string{"Bearer {access-token}"},
        
    }

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

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

Fetch a representation of this received notification

GET /receivedNotifications/{notificationId}

Return a paginated sortable filterable searchable collection of notifications. These are notifications which have been created and are available for delivery and polling. The links in the response include pagination links.

Parameters

Parameter Description
start
(query)
integer(int64)
The zero-based index of the first notification item to include in this page. The default 0 denotes the beginning of the collection.
limit
(query)
integer(int32)
The maximum number of notification representations to return in this page.
sortBy
(query)
string
Optional sort criteria. See sort criteria format, such as ?sortBy=field1,-field2.
filter
(query)
string
Optional filter criteria. See filtering.
q
(query)
string
Optional search string. See searching.
notificationId
(path)
string (required)
The unique identifier of this notification. This is an opaque string.

Example responses

200 Response

{
  "_id": "0399abed-fd3d-4830-a88b-30f38b8a365c",
  "_profile": "https://api.apiture.com/schemas/notifications/notification/v1.0.0/profile.json",
  "createdAt": "2018-04-17T10:04:46.375Z",
  "updatedAt": "2018-04-17T10:12:58.375Z",
  "_links": {
    "apiture:topic": {
      "href": "https://api.apiture.com/notifications/topics/ef967d9f-8bf5-412e-ba31-7d9047cb96b4"
    },
    "apiture:subscription": {
      "href": "https://api.apiture.com/notifications/subscriptions/ff968d9f-8bf7-412e-ba31-7d9047cb96b3"
    },
    "apiture:entity": {
      "href": "https://api.apiture.com/users/user/ff968d9f-8bf7-412e-ba31-7d9047cb96b3"
    },
    "apiture:acknowledge": {
      "href": "https://api.apiture.com/notifications/receivedNotifications?notification=https://api.apiture.com/notifications/pullNotifications/ff968d9f-8bf7-412e-ba31-7d9047cb96b3"
    }
  }
}

Responses

StatusDescription
200 OK
OK
Schema: notification
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

getNotificationsSubscription

Code samples

# You can also use wget
curl -X GET /notifications/subscriptions/{subscriptionId}/notifications \
  -H 'Accept: application/hal+json' \
  -H 'API-Key: API_KEY' \
  -H 'Authorization: Bearer {access-token}'

GET /notifications/subscriptions/{subscriptionId}/notifications HTTP/1.1

Accept: application/hal+json

var headers = {
  'Accept':'application/hal+json',
  'API-Key':'API_KEY',
  'Authorization':'Bearer {access-token}'

};

$.ajax({
  url: '/notifications/subscriptions/{subscriptionId}/notifications',
  method: 'get',

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

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

const headers = {
  'Accept':'application/hal+json',
  'API-Key':'API_KEY',
  'Authorization':'Bearer {access-token}'

};

fetch('/notifications/subscriptions/{subscriptionId}/notifications',
{
  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',
  'API-Key' => 'API_KEY',
  'Authorization' => 'Bearer {access-token}'
}

result = RestClient.get '/notifications/subscriptions/{subscriptionId}/notifications',
  params: {
  }, headers: headers

p JSON.parse(result)

import requests
headers = {
  'Accept': 'application/hal+json',
  'API-Key': 'API_KEY',
  'Authorization': 'Bearer {access-token}'
}

r = requests.get('/notifications/subscriptions/{subscriptionId}/notifications', params={

}, headers = headers)

print r.json()

URL obj = new URL("/notifications/subscriptions/{subscriptionId}/notifications");
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"},
        "API-Key": []string{"API_KEY"},
        "Authorization": []string{"Bearer {access-token}"},
        
    }

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

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

Fetch notifications associated with this subscription

GET /subscriptions/{subscriptionId}/notifications

Return a paginated sortable filterable searchable collection of notifications. The links in the response include pagination links.

Parameters

Parameter Description
subscriptionId
(path)
string (required)
The unique identifier of the subscription. This is an opaque string.
topic
(query)
string
A string which identifies a specific topic The value may be a {topicId} or a topic URI.
start
(query)
integer(int64)
The zero-based index of the first notification item to include in this page. The default 0 denotes the beginning of the collection.
limit
(query)
integer(int32)
The maximum number of notification representations to return in this page.
sortBy
(query)
string
Optional sort criteria. See sort criteria format, such as ?sortBy=field1,-field2.
filter
(query)
string
Optional filter criteria. See filtering.
q
(query)
string
Optional search string. See searching.

Example responses

200 Response

{
  "_profile": "https://api.apiture.com/schemas/notifications/notifications/v1.0.0/profile.json",
  "start": 10,
  "limit": 10,
  "count": 67,
  "name": "notifications",
  "_links": {
    "self": {
      "href": "/basePath/notifications?start=10&limit=10"
    },
    "first": {
      "href": "/basePath/notifications?start=0&limit=10"
    },
    "next": {
      "href": "/basePath/notifications?start=20&limit=10"
    },
    "collection": {
      "href": "/basePath/notifications"
    }
  },
  "_embedded": {
    "items": [
      {
        "_id": "0399abed-fd3d-4830-a88b-30f38b8a365c",
        "_profile": "https://api.apiture.com/schemas/notifications/notification/v1.0.0/profile.json",
        "_links": {
          "self": {
            "href": "/basePath/notifications/0399abed-fd3d-4830-a88b-30f38b8a365c"
          }
        }
      },
      {
        "_id": "d62c0701-0d74-4836-83f9-ebf3709442ea",
        "_profile": "https://api.apiture.com/schemas/notifications/notification/v1.0.0/profile.json",
        "_links": {
          "self": {
            "href": "/basePath/notifications/d62c0701-0d74-4836-83f9-ebf3709442ea"
          }
        }
      }
    ]
  }
}

Responses

StatusDescription
200 OK
OK
Schema: notifications
404 Not Found
Not Found. There is no such subscription resource at the specified {subscriptionId} 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

getNotificationsForTopic

Code samples

# You can also use wget
curl -X GET /notifications/topics/{topicId}/notifications \
  -H 'Accept: application/hal+json' \
  -H 'API-Key: API_KEY' \
  -H 'Authorization: Bearer {access-token}'

GET /notifications/topics/{topicId}/notifications HTTP/1.1

Accept: application/hal+json

var headers = {
  'Accept':'application/hal+json',
  'API-Key':'API_KEY',
  'Authorization':'Bearer {access-token}'

};

$.ajax({
  url: '/notifications/topics/{topicId}/notifications',
  method: 'get',

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

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

const headers = {
  'Accept':'application/hal+json',
  'API-Key':'API_KEY',
  'Authorization':'Bearer {access-token}'

};

fetch('/notifications/topics/{topicId}/notifications',
{
  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',
  'API-Key' => 'API_KEY',
  'Authorization' => 'Bearer {access-token}'
}

result = RestClient.get '/notifications/topics/{topicId}/notifications',
  params: {
  }, headers: headers

p JSON.parse(result)

import requests
headers = {
  'Accept': 'application/hal+json',
  'API-Key': 'API_KEY',
  'Authorization': 'Bearer {access-token}'
}

r = requests.get('/notifications/topics/{topicId}/notifications', params={

}, headers = headers)

print r.json()

URL obj = new URL("/notifications/topics/{topicId}/notifications");
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"},
        "API-Key": []string{"API_KEY"},
        "Authorization": []string{"Bearer {access-token}"},
        
    }

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

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

Fetch notifications associated with this topic

GET /topics/{topicId}/notifications

Return a paginated sortable filterable searchable collection of subscriptions. The links in the response include pagination links.

Parameters

Parameter Description
topicId
(path)
string (required)
The unique identifier of the topic. This is an opaque string.
subscription
(query)
string
A string which identifies a specific subscription. The value may be a {subscriptionId} or a subscription URI.
start
(query)
integer(int64)
The zero-based index of the first notification item to include in this page. The default 0 denotes the beginning of the collection.
limit
(query)
integer(int32)
The maximum number of notification representations to return in this page.
sortBy
(query)
string
Optional sort criteria. See sort criteria format, such as ?sortBy=field1,-field2.
filter
(query)
string
Optional filter criteria. See filtering.
q
(query)
string
Optional search string. See searching.

Example responses

200 Response

{
  "_profile": "https://api.apiture.com/schemas/notifications/topicNotifications/v1.0.0/profile.json",
  "start": 10,
  "limit": 10,
  "count": 67,
  "name": "notifications",
  "_links": {
    "self": {
      "href": "/basePath/notifications?start=10&limit=10"
    },
    "first": {
      "href": "/basePath/notifications?start=0&limit=10"
    },
    "next": {
      "href": "/basePath/notifications?start=20&limit=10"
    },
    "collection": {
      "href": "/basePath/notifications"
    }
  },
  "_embedded": {
    "items": [
      {
        "_id": "0399abed-fd3d-4830-a88b-30f38b8a365c",
        "_profile": "https://api.apiture.com/schemas/notifications/notification/v1.0.0/profile.json",
        "_links": {
          "self": {
            "href": "/basePath/notifications/0399abed-fd3d-4830-a88b-30f38b8a365c"
          }
        },
        "deliveryChannel": "web",
        "deliveryMethod": "pull"
      },
      {
        "_id": "d62c0701-0d74-4836-83f9-ebf3709442ea",
        "_profile": "https://api.apiture.com/schemas/notifications/notification/v1.0.0/profile.json",
        "_links": {
          "self": {
            "href": "/basePath/notifications/d62c0701-0d74-4836-83f9-ebf3709442ea"
          }
        },
        "deliveryChannel": "sms",
        "deliveryMethod": "push"
      }
    ]
  }
}

Responses

StatusDescription
200 OK
OK
Schema: topicNotifications
404 Not Found
Not Found. There is no such topic resource at the specified {topicId} 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

Subscription

Endpoints which facilitate the creation and modification of notification subscriptions.

getSubscriptions

Code samples

# You can also use wget
curl -X GET /notifications/subscriptions \
  -H 'Accept: application/hal+json' \
  -H 'API-Key: API_KEY' \
  -H 'Authorization: Bearer {access-token}'

GET /notifications/subscriptions HTTP/1.1

Accept: application/hal+json

var headers = {
  'Accept':'application/hal+json',
  'API-Key':'API_KEY',
  'Authorization':'Bearer {access-token}'

};

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

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

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

const headers = {
  'Accept':'application/hal+json',
  'API-Key':'API_KEY',
  'Authorization':'Bearer {access-token}'

};

fetch('/notifications/subscriptions',
{
  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',
  'API-Key' => 'API_KEY',
  'Authorization' => 'Bearer {access-token}'
}

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

p JSON.parse(result)

import requests
headers = {
  'Accept': 'application/hal+json',
  'API-Key': 'API_KEY',
  'Authorization': 'Bearer {access-token}'
}

r = requests.get('/notifications/subscriptions', params={

}, headers = headers)

print r.json()

URL obj = new URL("/notifications/subscriptions");
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"},
        "API-Key": []string{"API_KEY"},
        "Authorization": []string{"Bearer {access-token}"},
        
    }

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

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

Return a collection of subscriptions

GET /subscriptions

Return a paginated sortable filterable searchable collection of subscriptions. The links in the response include pagination links.

Parameters

Parameter Description
start
(query)
integer(int64)
The zero-based index of the first subscription in this page. The default, 0, represents the first page of the collection.
limit
(query)
integer(int32)
The maximum number of subscription representations to return in this page.
sortBy
(query)
string
Optional sort criteria. See sort criteria format, such as ?sortBy=field1,-field2.
filter
(query)
string
Optional filter criteria. See filtering.
q
(query)
string
Optional search string. See searching.
state
(query)
string
Subset the accounts or external accounts collection to those whose state matches this value. Use | to separate multiple values. For example, ?state=pending will match only items whose state is pending; ?state=removed|inactive will match items whose state is removed or inactive. This is combined with an implicit and with other filters if they are used. See filtering.
Enumerated values:
active
inactive
createdAt
(query)
string(date-time)
Subset the accounts or external accounts collection to those with this createdAt value. Use | to separate multiple values. For example, ?createdAt=2018-04-17T10:04:46.375Z will match only items whose createdAt is 2018-04-17T10:04:46.375Z; ?createdAt=2018-04-17T10:04:46.375Z|2018-05-17T10:04:46.375Z will match items whose createdAt is 2018-04-17T10:04:46.375Z or 2018-05-17T10:04:46.375Z. This is combined with an implicit and with other filters if they are used. See filtering.
updatedAt
(query)
string(date-time)
Subset the accounts or external accounts collection to those with this updatedAt value. Use | to separate multiple values. For example, ?updatedAt=2018-04-17T10:04:46.375Z will match only items whose updatedAt is 2018-04-17T10:04:46.375Z; ?updatedAt=2018-04-17T10:04:46.375Z|2018-05-17T10:04:46.375Z will match items whose updatedAt is 2018-04-17T10:04:46.375Z or 2018-05-17T10:04:46.375Z. This is combined with an implicit and with other filters if they are used. See filtering.

Example responses

200 Response

{
  "_links": {
    "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"
    }
  },
  "_embedded": {
    "items": [
      {
        "deliveryChannel": "string",
        "deliveryMethod": "push",
        "endpoint": {
          "token": "string",
          "recipientUrl": "string"
        },
        "state": "inactive",
        "subscriberContent": {
          "email": "beto@apiture.com",
          "subject": "Hello Apiture"
        },
        "_links": {
          "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"
          }
        },
        "_embedded": {},
        "_profile": "http://example.com",
        "_error": {
          "_id": "2eae46e1-575c-4d69-8a8f-0a7b0115a4b3",
          "_profile": "https://api.apiture.com/schemas/common/errorResponse/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": []
          }
        },
        "_id": "string",
        "authenticationState": "authenticated"
      }
    ]
  },
  "_profile": "http://example.com",
  "_error": {
    "_id": "2eae46e1-575c-4d69-8a8f-0a7b0115a4b3",
    "_profile": "https://api.apiture.com/schemas/common/errorResponse/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": []
    }
  },
  "count": 0,
  "start": 0,
  "limit": 0,
  "name": "string"
}

Responses

StatusDescription
200 OK
OK
Schema: subscriptions
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

createSubscription

Code samples

# You can also use wget
curl -X POST /notifications/subscriptions \
  -H 'Content-Type: application/hal+json' \
  -H 'Accept: application/hal+json' \
  -H 'API-Key: API_KEY' \
  -H 'Authorization: Bearer {access-token}'

POST /notifications/subscriptions HTTP/1.1

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

var headers = {
  'Content-Type':'application/hal+json',
  'Accept':'application/hal+json',
  'API-Key':'API_KEY',
  'Authorization':'Bearer {access-token}'

};

$.ajax({
  url: '/notifications/subscriptions',
  method: 'post',

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

const fetch = require('node-fetch');
const inputBody = '{
  "deliveryMethod": "pull",
  "deliveryChannel": "SMS",
  "state": "inactive",
  "endpoint": {
    "token": "8BE74E2B956A9532D3534A835EB66",
    "recipientUrl": "http://somedomain.com/an/external/endpoint"
  },
  "subscriberContent": {
    "smsNumber": "555-555-5555"
  },
  "_links": {
    "apiture:topic": {
      "href": "https://api.apiture.com/notifications/topics/ef967d9f-8bf5-412e-ba31-7d9047cb96b4"
    },
    "apiture:subscriber": {
      "href": "https://api.apiture.com/accounts/account/ef967d9f-8bf5-412e-ba31-7d9047cb96b4"
    }
  }
}';
const headers = {
  'Content-Type':'application/hal+json',
  'Accept':'application/hal+json',
  'API-Key':'API_KEY',
  'Authorization':'Bearer {access-token}'

};

fetch('/notifications/subscriptions',
{
  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/hal+json',
  'API-Key' => 'API_KEY',
  'Authorization' => 'Bearer {access-token}'
}

result = RestClient.post '/notifications/subscriptions',
  params: {
  }, headers: headers

p JSON.parse(result)

import requests
headers = {
  'Content-Type': 'application/hal+json',
  'Accept': 'application/hal+json',
  'API-Key': 'API_KEY',
  'Authorization': 'Bearer {access-token}'
}

r = requests.post('/notifications/subscriptions', params={

}, headers = headers)

print r.json()

URL obj = new URL("/notifications/subscriptions");
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/hal+json"},
        "API-Key": []string{"API_KEY"},
        "Authorization": []string{"Bearer {access-token}"},
        
    }

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

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

Create a new subscription

POST /subscriptions

Create a new subscription associated with a topic. The endpoint field is not required, even if the deliveryMethod field is set to push. A push subscription with no endpoint field cannot be activated until it has an authenticated endpoint. Attempts to activate a push subscription with no valid endpoint will return an error. A subscription may include additional subscriber information (subscriberContent) such as an email address or a phone number if required by the delivery channel. A push subscription can be created with an endpoint property that is missing a value for its token property. The push subscription will remain unauthenticated and unusable until an authorization token is provided. The notifications API attempts an authentication request at the location specified in the endpoint property at the time of subscription creation. If the authentication attempt fails, creation of the subscription fails. A subscription must have a link named apiture:topic which contains the href of a valid topic instance, as well as an apiture:subscriber link containing a reference to the subscriber entity.

Body parameter

{
  "deliveryMethod": "pull",
  "deliveryChannel": "SMS",
  "state": "inactive",
  "endpoint": {
    "token": "8BE74E2B956A9532D3534A835EB66",
    "recipientUrl": "http://somedomain.com/an/external/endpoint"
  },
  "subscriberContent": {
    "smsNumber": "555-555-5555"
  },
  "_links": {
    "apiture:topic": {
      "href": "https://api.apiture.com/notifications/topics/ef967d9f-8bf5-412e-ba31-7d9047cb96b4"
    },
    "apiture:subscriber": {
      "href": "https://api.apiture.com/accounts/account/ef967d9f-8bf5-412e-ba31-7d9047cb96b4"
    }
  }
}

Parameters

Parameter Description
body
(body)
createSubscription (required)
The data necessary to create a new subscription.

Example responses

201 Response

{
  "_id": "0399abed-fd3d-4830-a88b-30f38b8a365c",
  "_profile": "https://api.apiture.com/schemas/notifications/subscription/v1.0.0/profile.json",
  "createdAt": "2018-04-17T10:04:46.375Z",
  "updatedAt": "2018-04-17T10:12:58.375Z",
  "deliveryMethod": "pull",
  "deliveryChannel": "SMS",
  "state": "active",
  "endpoint": {
    "token": "8BE74E2B956A9532D3534A835EB66",
    "recipientUrl": "http://somedomain.com/an/external/endpoint"
  },
  "subscriberContent": {
    "smsNumber": "555-555-5555"
  },
  "_links": {
    "apiture:topic": {
      "href": "https://api.apiture.com/notifications/topics/ef967d9f-8bf5-412e-ba31-7d9047cb96b4"
    },
    "apiture:subscriber": {
      "href": "https://api.apiture.com/accounts/account/ef967d9f-8bf5-412e-ba31-7d9047cb96b4"
    }
  }
}

Responses

StatusDescription
201 Created
Created
Schema: subscription
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

Response Headers

StatusDescription
201 Location string uri
The URI of the new resource. If the URI begins with / it is relative to the API root context. Else, it is a full URI starting with scheme://host
201 ETag string
The ETag response header specifies an entity tag which must be provided in an If-Match request header for PUT or PATCH operations which update the resource.

activateSubscription

Code samples

# You can also use wget
curl -X POST /notifications/activeSubscriptions \
  -H 'Accept: application/hal+json' \
  -H 'API-Key: API_KEY' \
  -H 'Authorization: Bearer {access-token}'

POST /notifications/activeSubscriptions HTTP/1.1

Accept: application/hal+json

var headers = {
  'Accept':'application/hal+json',
  'API-Key':'API_KEY',
  'Authorization':'Bearer {access-token}'

};

$.ajax({
  url: '/notifications/activeSubscriptions',
  method: 'post',

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

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

const headers = {
  'Accept':'application/hal+json',
  'API-Key':'API_KEY',
  'Authorization':'Bearer {access-token}'

};

fetch('/notifications/activeSubscriptions',
{
  method: 'POST',

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

require 'rest-client'
require 'json'

headers = {
  'Accept' => 'application/hal+json',
  'API-Key' => 'API_KEY',
  'Authorization' => 'Bearer {access-token}'
}

result = RestClient.post '/notifications/activeSubscriptions',
  params: {
  }, headers: headers

p JSON.parse(result)

import requests
headers = {
  'Accept': 'application/hal+json',
  'API-Key': 'API_KEY',
  'Authorization': 'Bearer {access-token}'
}

r = requests.post('/notifications/activeSubscriptions', params={

}, headers = headers)

print r.json()

URL obj = new URL("/notifications/activeSubscriptions");
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{
        "Accept": []string{"application/hal+json"},
        "API-Key": []string{"API_KEY"},
        "Authorization": []string{"Bearer {access-token}"},
        
    }

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

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

Activate a subscription

POST /activeSubscriptions

Changes the state of a subscription to active

Parameters

Parameter Description
subscription
(query)
string
A string which identifies a specific subscription. The value may be a {subscriptionId} or a subscription URI.

Example responses

200 Response

{
  "_id": "0399abed-fd3d-4830-a88b-30f38b8a365c",
  "_profile": "https://api.apiture.com/schemas/notifications/subscription/v1.0.0/profile.json",
  "createdAt": "2018-04-17T10:04:46.375Z",
  "updatedAt": "2018-04-17T10:12:58.375Z",
  "deliveryMethod": "pull",
  "deliveryChannel": "SMS",
  "state": "active",
  "endpoint": {
    "token": "8BE74E2B956A9532D3534A835EB66",
    "recipientUrl": "http://somedomain.com/an/external/endpoint"
  },
  "subscriberContent": {
    "smsNumber": "555-555-5555"
  },
  "_links": {
    "apiture:topic": {
      "href": "https://api.apiture.com/notifications/topics/ef967d9f-8bf5-412e-ba31-7d9047cb96b4"
    },
    "apiture:subscriber": {
      "href": "https://api.apiture.com/accounts/account/ef967d9f-8bf5-412e-ba31-7d9047cb96b4"
    }
  }
}

Responses

StatusDescription
200 OK
OK
Schema: subscription
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

Response Headers

StatusDescription
200 ETag string
The ETag response header specifies an entity tag which must be provided in an If-Match request header for PUT or PATCH operations which update the resource.

deactivateSubscription

Code samples

# You can also use wget
curl -X POST /notifications/inactiveSubscriptions \
  -H 'Accept: application/hal+json' \
  -H 'API-Key: API_KEY' \
  -H 'Authorization: Bearer {access-token}'

POST /notifications/inactiveSubscriptions HTTP/1.1

Accept: application/hal+json

var headers = {
  'Accept':'application/hal+json',
  'API-Key':'API_KEY',
  'Authorization':'Bearer {access-token}'

};

$.ajax({
  url: '/notifications/inactiveSubscriptions',
  method: 'post',

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

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

const headers = {
  'Accept':'application/hal+json',
  'API-Key':'API_KEY',
  'Authorization':'Bearer {access-token}'

};

fetch('/notifications/inactiveSubscriptions',
{
  method: 'POST',

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

require 'rest-client'
require 'json'

headers = {
  'Accept' => 'application/hal+json',
  'API-Key' => 'API_KEY',
  'Authorization' => 'Bearer {access-token}'
}

result = RestClient.post '/notifications/inactiveSubscriptions',
  params: {
  }, headers: headers

p JSON.parse(result)

import requests
headers = {
  'Accept': 'application/hal+json',
  'API-Key': 'API_KEY',
  'Authorization': 'Bearer {access-token}'
}

r = requests.post('/notifications/inactiveSubscriptions', params={

}, headers = headers)

print r.json()

URL obj = new URL("/notifications/inactiveSubscriptions");
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{
        "Accept": []string{"application/hal+json"},
        "API-Key": []string{"API_KEY"},
        "Authorization": []string{"Bearer {access-token}"},
        
    }

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

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

Deactivate a subscription

POST /inactiveSubscriptions

Changes the state of a subscription to inactive

Parameters

Parameter Description
subscription
(query)
string
A string which identifies a specific subscription. The value may be a {subscriptionId} or a subscription URI.

Example responses

200 Response

{
  "_id": "0399abed-fd3d-4830-a88b-30f38b8a365c",
  "_profile": "https://api.apiture.com/schemas/notifications/subscription/v1.0.0/profile.json",
  "createdAt": "2018-04-17T10:04:46.375Z",
  "updatedAt": "2018-04-17T10:12:58.375Z",
  "deliveryMethod": "pull",
  "deliveryChannel": "SMS",
  "state": "active",
  "endpoint": {
    "token": "8BE74E2B956A9532D3534A835EB66",
    "recipientUrl": "http://somedomain.com/an/external/endpoint"
  },
  "subscriberContent": {
    "smsNumber": "555-555-5555"
  },
  "_links": {
    "apiture:topic": {
      "href": "https://api.apiture.com/notifications/topics/ef967d9f-8bf5-412e-ba31-7d9047cb96b4"
    },
    "apiture:subscriber": {
      "href": "https://api.apiture.com/accounts/account/ef967d9f-8bf5-412e-ba31-7d9047cb96b4"
    }
  }
}

Responses

StatusDescription
200 OK
OK
Schema: subscription
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

Response Headers

StatusDescription
200 ETag string
The ETag response header specifies an entity tag which must be provided in an If-Match request header for PUT or PATCH operations which update the resource.

getSubscription

Code samples

# You can also use wget
curl -X GET /notifications/subscriptions/{subscriptionId} \
  -H 'Accept: application/hal+json' \
  -H 'If-None-Match: string' \
  -H 'API-Key: API_KEY' \
  -H 'Authorization: Bearer {access-token}'

GET /notifications/subscriptions/{subscriptionId} HTTP/1.1

Accept: application/hal+json
If-None-Match: string

var headers = {
  'Accept':'application/hal+json',
  'If-None-Match':'string',
  'API-Key':'API_KEY',
  'Authorization':'Bearer {access-token}'

};

$.ajax({
  url: '/notifications/subscriptions/{subscriptionId}',
  method: 'get',

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

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

const headers = {
  'Accept':'application/hal+json',
  'If-None-Match':'string',
  'API-Key':'API_KEY',
  'Authorization':'Bearer {access-token}'

};

fetch('/notifications/subscriptions/{subscriptionId}',
{
  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',
  'If-None-Match' => 'string',
  'API-Key' => 'API_KEY',
  'Authorization' => 'Bearer {access-token}'
}

result = RestClient.get '/notifications/subscriptions/{subscriptionId}',
  params: {
  }, headers: headers

p JSON.parse(result)

import requests
headers = {
  'Accept': 'application/hal+json',
  'If-None-Match': 'string',
  'API-Key': 'API_KEY',
  'Authorization': 'Bearer {access-token}'
}

r = requests.get('/notifications/subscriptions/{subscriptionId}', params={

}, headers = headers)

print r.json()

URL obj = new URL("/notifications/subscriptions/{subscriptionId}");
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"},
        "If-None-Match": []string{"string"},
        "API-Key": []string{"API_KEY"},
        "Authorization": []string{"Bearer {access-token}"},
        
    }

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

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

Fetch a representation of this subscription

GET /subscriptions/{subscriptionId}

Return a HAL representation of this subscription resource.

Parameters

Parameter Description
subscriptionId
(path)
string (required)
The unique identifier of the subscription. This is an opaque string.
If-None-Match
(header)
string
The entity tag that was returned in the ETag response. If the resource's current entity tag matches, the GET will return 304 (Not Modified) and no response body, else the resource representation will be returned.

Example responses

200 Response

{
  "_id": "0399abed-fd3d-4830-a88b-30f38b8a365c",
  "_profile": "https://api.apiture.com/schemas/notifications/subscription/v1.0.0/profile.json",
  "createdAt": "2018-04-17T10:04:46.375Z",
  "updatedAt": "2018-04-17T10:12:58.375Z",
  "deliveryMethod": "pull",
  "deliveryChannel": "SMS",
  "state": "active",
  "endpoint": {
    "token": "8BE74E2B956A9532D3534A835EB66",
    "recipientUrl": "http://somedomain.com/an/external/endpoint"
  },
  "subscriberContent": {
    "smsNumber": "555-555-5555"
  },
  "_links": {
    "apiture:topic": {
      "href": "https://api.apiture.com/notifications/topics/ef967d9f-8bf5-412e-ba31-7d9047cb96b4"
    },
    "apiture:subscriber": {
      "href": "https://api.apiture.com/accounts/account/ef967d9f-8bf5-412e-ba31-7d9047cb96b4"
    }
  }
}

Responses

StatusDescription
200 OK
OK
Schema: subscription
304 Not Modified
Not Modified. The resource has not been modified since it was last fetched.
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
404 Not Found
Not Found. There is no such subscription resource at the specified {subscriptionId} The _error field in the response will contain details about the request error.
Schema: errorResponse

Response Headers

StatusDescription
200 ETag string
The ETag response header specifies an entity tag which must be provided in an If-Match request header for PUT or PATCH operations which update this subscription resource.

updateSubscription

Code samples

# You can also use wget
curl -X PUT /notifications/subscriptions/{subscriptionId} \
  -H 'Content-Type: application/hal+json' \
  -H 'Accept: application/hal+json' \
  -H 'If-Match: string' \
  -H 'API-Key: API_KEY' \
  -H 'Authorization: Bearer {access-token}'

PUT /notifications/subscriptions/{subscriptionId} HTTP/1.1

Content-Type: application/hal+json
Accept: application/hal+json
If-Match: string

var headers = {
  'Content-Type':'application/hal+json',
  'Accept':'application/hal+json',
  'If-Match':'string',
  'API-Key':'API_KEY',
  'Authorization':'Bearer {access-token}'

};

$.ajax({
  url: '/notifications/subscriptions/{subscriptionId}',
  method: 'put',

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

const fetch = require('node-fetch');
const inputBody = '{
  "deliveryMethod": "pull",
  "deliveryChannel": "SMS",
  "state": "inactive",
  "endpoint": {
    "token": "8BE74E2B956A9532D3534A835EB66",
    "recipientUrl": "http://somedomain.com/an/external/endpoint"
  },
  "subscriberContent": {
    "smsNumber": "555-555-5555"
  },
  "_links": {
    "apiture:topic": {
      "href": "https://api.apiture.com/notifications/topics/ef967d9f-8bf5-412e-ba31-7d9047cb96b4"
    },
    "apiture:subscriber": {
      "href": "https://api.apiture.com/accounts/account/ef967d9f-8bf5-412e-ba31-7d9047cb96b4"
    }
  }
}';
const headers = {
  'Content-Type':'application/hal+json',
  'Accept':'application/hal+json',
  'If-Match':'string',
  'API-Key':'API_KEY',
  'Authorization':'Bearer {access-token}'

};

fetch('/notifications/subscriptions/{subscriptionId}',
{
  method: 'PUT',
  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/hal+json',
  'If-Match' => 'string',
  'API-Key' => 'API_KEY',
  'Authorization' => 'Bearer {access-token}'
}

result = RestClient.put '/notifications/subscriptions/{subscriptionId}',
  params: {
  }, headers: headers

p JSON.parse(result)

import requests
headers = {
  'Content-Type': 'application/hal+json',
  'Accept': 'application/hal+json',
  'If-Match': 'string',
  'API-Key': 'API_KEY',
  'Authorization': 'Bearer {access-token}'
}

r = requests.put('/notifications/subscriptions/{subscriptionId}', params={

}, headers = headers)

print r.json()

URL obj = new URL("/notifications/subscriptions/{subscriptionId}");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("PUT");
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/hal+json"},
        "If-Match": []string{"string"},
        "API-Key": []string{"API_KEY"},
        "Authorization": []string{"Bearer {access-token}"},
        
    }

    data := bytes.NewBuffer([]byte{jsonReq})
    req, err := http.NewRequest("PUT", "/notifications/subscriptions/{subscriptionId}", data)
    req.Header = headers

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

Update this subscription

PUT /subscriptions/{subscriptionId}

Perform a complete replacement of the subscription. Modifying the contents of the endpoint property will trigger the notification service to re-validate the subscription with the new endpoint attributes. This may cause the authenticationState of the subscription to change. For example, if the modified authentication token is invalid, the authenticationState will transition to "unauthenticated".

Updating the subscription may not alter existing in-process deliveries.

Body parameter

{
  "deliveryMethod": "pull",
  "deliveryChannel": "SMS",
  "state": "inactive",
  "endpoint": {
    "token": "8BE74E2B956A9532D3534A835EB66",
    "recipientUrl": "http://somedomain.com/an/external/endpoint"
  },
  "subscriberContent": {
    "smsNumber": "555-555-5555"
  },
  "_links": {
    "apiture:topic": {
      "href": "https://api.apiture.com/notifications/topics/ef967d9f-8bf5-412e-ba31-7d9047cb96b4"
    },
    "apiture:subscriber": {
      "href": "https://api.apiture.com/accounts/account/ef967d9f-8bf5-412e-ba31-7d9047cb96b4"
    }
  }
}

Parameters

Parameter Description
subscriptionId
(path)
string (required)
The unique identifier of the subscription. This is an opaque string.
If-Match
(header)
string
The entity tag that was returned in the ETag response. This must match the current entity tag of the resource.
body
(body)
updateSubscription (required)

Example responses

200 Response

{
  "_id": "0399abed-fd3d-4830-a88b-30f38b8a365c",
  "_profile": "https://api.apiture.com/schemas/notifications/subscription/v1.0.0/profile.json",
  "createdAt": "2018-04-17T10:04:46.375Z",
  "updatedAt": "2018-04-17T10:12:58.375Z",
  "deliveryMethod": "pull",
  "deliveryChannel": "SMS",
  "state": "active",
  "endpoint": {
    "token": "8BE74E2B956A9532D3534A835EB66",
    "recipientUrl": "http://somedomain.com/an/external/endpoint"
  },
  "subscriberContent": {
    "smsNumber": "555-555-5555"
  },
  "_links": {
    "apiture:topic": {
      "href": "https://api.apiture.com/notifications/topics/ef967d9f-8bf5-412e-ba31-7d9047cb96b4"
    },
    "apiture:subscriber": {
      "href": "https://api.apiture.com/accounts/account/ef967d9f-8bf5-412e-ba31-7d9047cb96b4"
    }
  }
}

Responses

StatusDescription
200 OK
OK
Schema: subscription
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
404 Not Found
Not Found. There is no such subscription resource at the specified {subscriptionId} The _error field in the response will contain details about the request error.
Schema: errorResponse
412 Precondition Failed
Precondition Failed. The supplied if-Match header value does not match the most recent ETag response header value. The resource has changed in the interim.
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

Response Headers

StatusDescription
200 ETag string
The ETag response header specifies an entity tag which must be provided in an If-Match request header for PUT or PATCH operations which update this subscription resource.

patchSubscription

Code samples

# You can also use wget
curl -X PATCH /notifications/subscriptions/{subscriptionId} \
  -H 'Content-Type: application/hal+json' \
  -H 'Accept: application/hal+json' \
  -H 'If-Match: string' \
  -H 'API-Key: API_KEY' \
  -H 'Authorization: Bearer {access-token}'

PATCH /notifications/subscriptions/{subscriptionId} HTTP/1.1

Content-Type: application/hal+json
Accept: application/hal+json
If-Match: string

var headers = {
  'Content-Type':'application/hal+json',
  'Accept':'application/hal+json',
  'If-Match':'string',
  'API-Key':'API_KEY',
  'Authorization':'Bearer {access-token}'

};

$.ajax({
  url: '/notifications/subscriptions/{subscriptionId}',
  method: 'patch',

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

const fetch = require('node-fetch');
const inputBody = '{
  "deliveryMethod": "pull",
  "deliveryChannel": "SMS",
  "state": "inactive",
  "endpoint": {
    "token": "8BE74E2B956A9532D3534A835EB66",
    "recipientUrl": "http://somedomain.com/an/external/endpoint"
  },
  "subscriberContent": {
    "smsNumber": "555-555-5555"
  },
  "_links": {
    "apiture:topic": {
      "href": "https://api.apiture.com/notifications/topics/ef967d9f-8bf5-412e-ba31-7d9047cb96b4"
    },
    "apiture:subscriber": {
      "href": "https://api.apiture.com/accounts/account/ef967d9f-8bf5-412e-ba31-7d9047cb96b4"
    }
  }
}';
const headers = {
  'Content-Type':'application/hal+json',
  'Accept':'application/hal+json',
  'If-Match':'string',
  'API-Key':'API_KEY',
  'Authorization':'Bearer {access-token}'

};

fetch('/notifications/subscriptions/{subscriptionId}',
{
  method: 'PATCH',
  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/hal+json',
  'If-Match' => 'string',
  'API-Key' => 'API_KEY',
  'Authorization' => 'Bearer {access-token}'
}

result = RestClient.patch '/notifications/subscriptions/{subscriptionId}',
  params: {
  }, headers: headers

p JSON.parse(result)

import requests
headers = {
  'Content-Type': 'application/hal+json',
  'Accept': 'application/hal+json',
  'If-Match': 'string',
  'API-Key': 'API_KEY',
  'Authorization': 'Bearer {access-token}'
}

r = requests.patch('/notifications/subscriptions/{subscriptionId}', params={

}, headers = headers)

print r.json()

URL obj = new URL("/notifications/subscriptions/{subscriptionId}");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("PATCH");
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/hal+json"},
        "If-Match": []string{"string"},
        "API-Key": []string{"API_KEY"},
        "Authorization": []string{"Bearer {access-token}"},
        
    }

    data := bytes.NewBuffer([]byte{jsonReq})
    req, err := http.NewRequest("PATCH", "/notifications/subscriptions/{subscriptionId}", data)
    req.Header = headers

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

Update this subscription

PATCH /subscriptions/{subscriptionId}

Perform a partial update of this subscription. Fields which are omitted notification service to re-validate the subscription with the new endpoint attributes. This may cause the authenticationState of the subscription to change. For example, if the modified authentication token is invalid, the authenticationState will transition to "unauthenticated".

Updating the subscription may not alter existing in-process deliveries.

Body parameter

{
  "deliveryMethod": "pull",
  "deliveryChannel": "SMS",
  "state": "inactive",
  "endpoint": {
    "token": "8BE74E2B956A9532D3534A835EB66",
    "recipientUrl": "http://somedomain.com/an/external/endpoint"
  },
  "subscriberContent": {
    "smsNumber": "555-555-5555"
  },
  "_links": {
    "apiture:topic": {
      "href": "https://api.apiture.com/notifications/topics/ef967d9f-8bf5-412e-ba31-7d9047cb96b4"
    },
    "apiture:subscriber": {
      "href": "https://api.apiture.com/accounts/account/ef967d9f-8bf5-412e-ba31-7d9047cb96b4"
    }
  }
}

Parameters

Parameter Description
subscriptionId
(path)
string (required)
The unique identifier of the subscription. This is an opaque string.
If-Match
(header)
string
The entity tag that was returned in the ETag response. This must match the current entity tag of the resource.
body
(body)
updateSubscription (required)

Example responses

200 Response

{
  "_id": "0399abed-fd3d-4830-a88b-30f38b8a365c",
  "_profile": "https://api.apiture.com/schemas/notifications/subscription/v1.0.0/profile.json",
  "createdAt": "2018-04-17T10:04:46.375Z",
  "updatedAt": "2018-04-17T10:12:58.375Z",
  "deliveryMethod": "pull",
  "deliveryChannel": "SMS",
  "state": "active",
  "endpoint": {
    "token": "8BE74E2B956A9532D3534A835EB66",
    "recipientUrl": "http://somedomain.com/an/external/endpoint"
  },
  "subscriberContent": {
    "smsNumber": "555-555-5555"
  },
  "_links": {
    "apiture:topic": {
      "href": "https://api.apiture.com/notifications/topics/ef967d9f-8bf5-412e-ba31-7d9047cb96b4"
    },
    "apiture:subscriber": {
      "href": "https://api.apiture.com/accounts/account/ef967d9f-8bf5-412e-ba31-7d9047cb96b4"
    }
  }
}

Responses

StatusDescription
200 OK
OK
Schema: subscription
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
404 Not Found
Not Found. There is no such subscription resource at the specified {subscriptionId} The _error field in the response will contain details about the request error.
Schema: errorResponse
412 Precondition Failed
Precondition Failed. The supplied if-Match header value does not match the most recent ETag response header value. The resource has changed in the interim.
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

Response Headers

StatusDescription
200 ETag string
The ETag response header specifies an entity tag which must be provided in an If-Match request header for PUT or PATCH operations which update this subscription resource.

deleteSubscription

Code samples

# You can also use wget
curl -X DELETE /notifications/subscriptions/{subscriptionId} \
  -H 'Accept: application/hal+json' \
  -H 'If-Match: string' \
  -H 'API-Key: API_KEY' \
  -H 'Authorization: Bearer {access-token}'

DELETE /notifications/subscriptions/{subscriptionId} HTTP/1.1

Accept: application/hal+json
If-Match: string

var headers = {
  'Accept':'application/hal+json',
  'If-Match':'string',
  'API-Key':'API_KEY',
  'Authorization':'Bearer {access-token}'

};

$.ajax({
  url: '/notifications/subscriptions/{subscriptionId}',
  method: 'delete',

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

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

const headers = {
  'Accept':'application/hal+json',
  'If-Match':'string',
  'API-Key':'API_KEY',
  'Authorization':'Bearer {access-token}'

};

fetch('/notifications/subscriptions/{subscriptionId}',
{
  method: 'DELETE',

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

require 'rest-client'
require 'json'

headers = {
  'Accept' => 'application/hal+json',
  'If-Match' => 'string',
  'API-Key' => 'API_KEY',
  'Authorization' => 'Bearer {access-token}'
}

result = RestClient.delete '/notifications/subscriptions/{subscriptionId}',
  params: {
  }, headers: headers

p JSON.parse(result)

import requests
headers = {
  'Accept': 'application/hal+json',
  'If-Match': 'string',
  'API-Key': 'API_KEY',
  'Authorization': 'Bearer {access-token}'
}

r = requests.delete('/notifications/subscriptions/{subscriptionId}', params={

}, headers = headers)

print r.json()

URL obj = new URL("/notifications/subscriptions/{subscriptionId}");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("DELETE");
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"},
        "If-Match": []string{"string"},
        "API-Key": []string{"API_KEY"},
        "Authorization": []string{"Bearer {access-token}"},
        
    }

    data := bytes.NewBuffer([]byte{jsonReq})
    req, err := http.NewRequest("DELETE", "/notifications/subscriptions/{subscriptionId}", data)
    req.Header = headers

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

Delete a subscription

DELETE /subscriptions/{subscriptionId}

Delete a subscription resource. Note that deleting a subscription may not cancel any associated notifications that the notifications service is actively processing. Active subscriptions can be deleted. There is no need to deactivate a subscription before deleting it.

Parameters

Parameter Description
If-Match
(header)
string
The entity tag that was returned in the ETag response. This must match the current entity tag of the resource.
subscriptionId
(path)
string (required)
The unique identifier of the subscription. This is an opaque string.

Example responses

400 Response

{
  "_profile": "https://api.apiture.com/schemas/common/errorResponse/v1.0.0/profile.json",
  "_error": {
    "_id": "2eae46e1-575c-4d69-8a8f-0a7b0115a4b3",
    "_profile": "https://api.apiture.com/schemas/common/errorResponse/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": {},
    "_links": {
      "describedby": {
        "href": "http://doc.apiture.com/errors/positiveNumberRequired"
      }
    },
    "_embedded": {
      "errors": []
    }
  }
}

Responses

StatusDescription
204 No Content
No Content. The resource was deleted successfully.
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
404 Not Found
Not Found. There is no such subscription resource at the specified {subscriptionId} The _error field in the response will contain details about the request error.
Schema: errorResponse
412 Precondition Failed
Precondition Failed. The supplied if-Match header value does not match the most recent ETag response header value. The resource has changed in the interim.
Schema: errorResponse

Topic

Endpoints which facilitate the creation and modification of notification topics.

getTopics

Code samples

# You can also use wget
curl -X GET /notifications/topics \
  -H 'Accept: application/hal+json' \
  -H 'API-Key: API_KEY' \
  -H 'Authorization: Bearer {access-token}'

GET /notifications/topics HTTP/1.1

Accept: application/hal+json

var headers = {
  'Accept':'application/hal+json',
  'API-Key':'API_KEY',
  'Authorization':'Bearer {access-token}'

};

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

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

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

const headers = {
  'Accept':'application/hal+json',
  'API-Key':'API_KEY',
  'Authorization':'Bearer {access-token}'

};

fetch('/notifications/topics',
{
  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',
  'API-Key' => 'API_KEY',
  'Authorization' => 'Bearer {access-token}'
}

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

p JSON.parse(result)

import requests
headers = {
  'Accept': 'application/hal+json',
  'API-Key': 'API_KEY',
  'Authorization': 'Bearer {access-token}'
}

r = requests.get('/notifications/topics', params={

}, headers = headers)

print r.json()

URL obj = new URL("/notifications/topics");
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"},
        "API-Key": []string{"API_KEY"},
        "Authorization": []string{"Bearer {access-token}"},
        
    }

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

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

Retrieve a collection of topics

GET /topics

Return a paginated sortable filterable searchable collection of topics. The links in the response include pagination links.

Parameters

Parameter Description
start
(query)
integer(int64)
The zero-based index of the first subscription in this page. The default, 0, represents the first page of the collection.
limit
(query)
integer(int32)
The maximum number of subscription representations to return in this page.
sortBy
(query)
string
Optional sort criteria. See sort criteria format, such as ?sortBy=field1,-field2.
filter
(query)
string
Optional filter criteria. See filtering.
q
(query)
string
Optional search string. See searching.
name
(query)
string
Subset the accounts or external accounts collection to those with this name value. Use
createdAt
(query)
string(date-time)
Subset the accounts or external accounts collection to those with this createdAt value. Use | to separate multiple values. For example, ?createdAt=2018-04-17T10:04:46.375Z will match only items whose createdAt is 2018-04-17T10:04:46.375Z; ?createdAt=2018-04-17T10:04:46.375Z|2018-05-17T10:04:46.375Z will match items whose createdAt is 2018-04-17T10:04:46.375Z or 2018-05-17T10:04:46.375Z. This is combined with an implicit and with other filters if they are used. See filtering.
updatedAt
(query)
string(date-time)
Subset the accounts or external accounts collection to those with this updatedAt value. Use | to separate multiple values. For example, ?updatedAt=2018-04-17T10:04:46.375Z will match only items whose updatedAt is 2018-04-17T10:04:46.375Z; ?updatedAt=2018-04-17T10:04:46.375Z|2018-05-17T10:04:46.375Z will match items whose updatedAt is 2018-04-17T10:04:46.375Z or 2018-05-17T10:04:46.375Z. This is combined with an implicit and with other filters if they are used. See filtering.

Example responses

200 Response

{
  "_links": {
    "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"
    }
  },
  "_embedded": {
    "items": [
      {
        "_id": "0399abed-fd3d-4830-a88b-30f38b8a365c",
        "_profile": "https://api.apiture.com/schemas/notifications/topic/v1.0.0/profile.json",
        "createdAt": "2018-04-17T10:04:46.375Z",
        "updatedAt": "2018-04-17T10:12:58.375Z",
        "name": "AccountCreated",
        "domain": "Accounts"
      }
    ]
  },
  "_profile": "http://example.com",
  "_error": {
    "_id": "2eae46e1-575c-4d69-8a8f-0a7b0115a4b3",
    "_profile": "https://api.apiture.com/schemas/common/errorResponse/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": []
    }
  },
  "count": 0,
  "start": 0,
  "limit": 0,
  "name": "string"
}

Responses

StatusDescription
200 OK
OK
Schema: topics
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

createTopic

Code samples

# You can also use wget
curl -X POST /notifications/topics \
  -H 'Content-Type: application/hal+json' \
  -H 'Accept: application/hal+json' \
  -H 'API-Key: API_KEY' \
  -H 'Authorization: Bearer {access-token}'

POST /notifications/topics HTTP/1.1

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

var headers = {
  'Content-Type':'application/hal+json',
  'Accept':'application/hal+json',
  'API-Key':'API_KEY',
  'Authorization':'Bearer {access-token}'

};

$.ajax({
  url: '/notifications/topics',
  method: 'post',

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

const fetch = require('node-fetch');
const inputBody = '{
  "name": "AccountCreated",
  "domain": "Accounts"
}';
const headers = {
  'Content-Type':'application/hal+json',
  'Accept':'application/hal+json',
  'API-Key':'API_KEY',
  'Authorization':'Bearer {access-token}'

};

fetch('/notifications/topics',
{
  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/hal+json',
  'API-Key' => 'API_KEY',
  'Authorization' => 'Bearer {access-token}'
}

result = RestClient.post '/notifications/topics',
  params: {
  }, headers: headers

p JSON.parse(result)

import requests
headers = {
  'Content-Type': 'application/hal+json',
  'Accept': 'application/hal+json',
  'API-Key': 'API_KEY',
  'Authorization': 'Bearer {access-token}'
}

r = requests.post('/notifications/topics', params={

}, headers = headers)

print r.json()

URL obj = new URL("/notifications/topics");
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/hal+json"},
        "API-Key": []string{"API_KEY"},
        "Authorization": []string{"Bearer {access-token}"},
        
    }

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

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

Create a new topic

POST /topics

Create a new topic in the topics collection. A topic can be created without any associated subscriptions. However, any subscriptions that do not already exist must be created first via a POST to /subscriptions.

Body parameter

{
  "name": "AccountCreated",
  "domain": "Accounts"
}

Parameters

Parameter Description
body
(body)
createTopic (required)
The data necessary to create a new topic.

Example responses

201 Response

{
  "_id": "0399abed-fd3d-4830-a88b-30f38b8a365c",
  "_profile": "https://api.apiture.com/schemas/notifications/topic/v1.0.0/profile.json",
  "createdAt": "2018-04-17T10:04:46.375Z",
  "updatedAt": "2018-04-17T10:12:58.375Z",
  "name": "AccountCreated",
  "domain": "Accounts"
}

Responses

StatusDescription
201 Created
Created
Schema: topic
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

Response Headers

StatusDescription
201 Location string uri
The URI of the new resource. If the URI begins with / it is relative to the API root context. Else, it is a full URI starting with scheme://host
201 ETag string
The ETag response header specifies an entity tag which must be provided in an If-Match request header for PUT or PATCH operations which update the resource.

getTopic

Code samples

# You can also use wget
curl -X GET /notifications/topics/{topicId} \
  -H 'Accept: application/hal+json' \
  -H 'If-None-Match: string' \
  -H 'API-Key: API_KEY' \
  -H 'Authorization: Bearer {access-token}'

GET /notifications/topics/{topicId} HTTP/1.1

Accept: application/hal+json
If-None-Match: string

var headers = {
  'Accept':'application/hal+json',
  'If-None-Match':'string',
  'API-Key':'API_KEY',
  'Authorization':'Bearer {access-token}'

};

$.ajax({
  url: '/notifications/topics/{topicId}',
  method: 'get',

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

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

const headers = {
  'Accept':'application/hal+json',
  'If-None-Match':'string',
  'API-Key':'API_KEY',
  'Authorization':'Bearer {access-token}'

};

fetch('/notifications/topics/{topicId}',
{
  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',
  'If-None-Match' => 'string',
  'API-Key' => 'API_KEY',
  'Authorization' => 'Bearer {access-token}'
}

result = RestClient.get '/notifications/topics/{topicId}',
  params: {
  }, headers: headers

p JSON.parse(result)

import requests
headers = {
  'Accept': 'application/hal+json',
  'If-None-Match': 'string',
  'API-Key': 'API_KEY',
  'Authorization': 'Bearer {access-token}'
}

r = requests.get('/notifications/topics/{topicId}', params={

}, headers = headers)

print r.json()

URL obj = new URL("/notifications/topics/{topicId}");
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"},
        "If-None-Match": []string{"string"},
        "API-Key": []string{"API_KEY"},
        "Authorization": []string{"Bearer {access-token}"},
        
    }

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

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

Fetch a representation of a topic

GET /topics/{topicId}

Return a HAL representation of this topic resource.

Parameters

Parameter Description
topicId
(path)
string (required)
The unique identifier of the topic. This is an opaque string.
If-None-Match
(header)
string
The entity tag that was returned in the ETag response. If the resource's current entity tag matches, the GET will return 304 (Not Modified) and no response body, else the resource representation will be returned.

Example responses

200 Response

{
  "_id": "0399abed-fd3d-4830-a88b-30f38b8a365c",
  "_profile": "https://api.apiture.com/schemas/notifications/topic/v1.0.0/profile.json",
  "createdAt": "2018-04-17T10:04:46.375Z",
  "updatedAt": "2018-04-17T10:12:58.375Z",
  "name": "AccountCreated",
  "domain": "Accounts"
}

Responses

StatusDescription
200 OK
OK
Schema: topic
304 Not Modified
Not Modified. The resource has not been modified since it was last fetched.
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

Response Headers

StatusDescription
200 ETag string
The ETag response header specifies an entity tag which must be provided in an If-Match request header for PUT or PATCH operations which update this topic resource.

deleteTopic

Code samples

# You can also use wget
curl -X DELETE /notifications/topics/{topicId} \
  -H 'Accept: application/hal+json' \
  -H 'If-Match: string' \
  -H 'API-Key: API_KEY' \
  -H 'Authorization: Bearer {access-token}'

DELETE /notifications/topics/{topicId} HTTP/1.1

Accept: application/hal+json
If-Match: string

var headers = {
  'Accept':'application/hal+json',
  'If-Match':'string',
  'API-Key':'API_KEY',
  'Authorization':'Bearer {access-token}'

};

$.ajax({
  url: '/notifications/topics/{topicId}',
  method: 'delete',

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

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

const headers = {
  'Accept':'application/hal+json',
  'If-Match':'string',
  'API-Key':'API_KEY',
  'Authorization':'Bearer {access-token}'

};

fetch('/notifications/topics/{topicId}',
{
  method: 'DELETE',

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

require 'rest-client'
require 'json'

headers = {
  'Accept' => 'application/hal+json',
  'If-Match' => 'string',
  'API-Key' => 'API_KEY',
  'Authorization' => 'Bearer {access-token}'
}

result = RestClient.delete '/notifications/topics/{topicId}',
  params: {
  }, headers: headers

p JSON.parse(result)

import requests
headers = {
  'Accept': 'application/hal+json',
  'If-Match': 'string',
  'API-Key': 'API_KEY',
  'Authorization': 'Bearer {access-token}'
}

r = requests.delete('/notifications/topics/{topicId}', params={

}, headers = headers)

print r.json()

URL obj = new URL("/notifications/topics/{topicId}");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("DELETE");
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"},
        "If-Match": []string{"string"},
        "API-Key": []string{"API_KEY"},
        "Authorization": []string{"Bearer {access-token}"},
        
    }

    data := bytes.NewBuffer([]byte{jsonReq})
    req, err := http.NewRequest("DELETE", "/notifications/topics/{topicId}", data)
    req.Header = headers

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

Delete this topic

DELETE /topics/{topicId}

Delete this topic resource. Deleting a topic will also remove any associated subscription resources, but may not cancel notifications already posted to the topic.

Parameters

Parameter Description
If-Match
(header)
string
The entity tag that was returned in the ETag response. This must match the current entity tag of the resource.
topicId
(path)
string (required)
The unique identifier of the topic. This is an opaque string.

Example responses

400 Response

{
  "_profile": "https://api.apiture.com/schemas/common/errorResponse/v1.0.0/profile.json",
  "_error": {
    "_id": "2eae46e1-575c-4d69-8a8f-0a7b0115a4b3",
    "_profile": "https://api.apiture.com/schemas/common/errorResponse/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": {},
    "_links": {
      "describedby": {
        "href": "http://doc.apiture.com/errors/positiveNumberRequired"
      }
    },
    "_embedded": {
      "errors": []
    }
  }
}

Responses

StatusDescription
204 No Content
No Content. The resource was deleted successfully.
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
404 Not Found
Not Found. There is no such topic resource at the specified {topicId} The _error field in the response will contain details about the request error.
Schema: errorResponse
412 Precondition Failed
Precondition Failed. The supplied if-Match header value does not match the most recent ETag response header value. The resource has changed in the interim.
Schema: errorResponse

Schemas

topicFields

{
  "name": "Document Approval",
  "domain": "apiture"
}

Topic Fields

Common fields of the topic resource.

Properties

NameDescription
name string
The name of the topic.
read-only
domain string
The domain, or namespace, of the topic. To avoid conflicts with other topics, the domain should be a URN or a URI.
read-only

createTopic

{
  "name": "AccountCreated",
  "domain": "Accounts"
}

Create Topic

Representation used to create a new notification topic. The combination of name and domain fields must be unique.

Properties

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.
name string (required)
The name of the topic.
read-only
domain string (required)
The domain, or namespace, of the topic. To avoid conflicts with other topics, the domain should be a URN or a URI.
read-only

summaryTopic

{
  "name": "string",
  "domain": "string",
  "_links": {
    "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"
    }
  },
  "_embedded": {},
  "_profile": "http://example.com",
  "_error": {
    "_id": "2eae46e1-575c-4d69-8a8f-0a7b0115a4b3",
    "_profile": "https://api.apiture.com/schemas/common/errorResponse/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": []
    }
  },
  "_id": "string"
}

Summary Topic

Summary representation of a topic resource in topics collections. This representation normally does not contain any _embedded objects. If needed, call the GET operations on the item's self link to get _embedded objects.

Properties

NameDescription
name string
The name of the topic.
read-only
domain string
The domain, or namespace, of the topic. To avoid conflicts with other topics, the domain should be a URN or a URI.
read-only
_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.
_id string
The unique identifier for this topic resource. This is an opaque string.
read-only

topic

{
  "_id": "0399abed-fd3d-4830-a88b-30f38b8a365c",
  "_profile": "https://api.apiture.com/schemas/notifications/topic/v1.0.0/profile.json",
  "createdAt": "2018-04-17T10:04:46.375Z",
  "updatedAt": "2018-04-17T10:12:58.375Z",
  "name": "AccountCreated",
  "domain": "Accounts"
}

Topic

Topics are the resource used to group notifications and subscriptions around a specific notification subject. A topic can have any number of associated subscriptions. When a notification is published to a topic, the topic then notifies all of its active subscribers and passes the body of the notification to them. Topics are immutable - the name and domain may not be changed. Hence there is no PUT or PATCH on a topic.

Properties

NameDescription
name string
The name of the topic.
read-only
domain string
The domain, or namespace, of the topic. To avoid conflicts with other topics, the domain should be a URN or a URI.
read-only
_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
Embedded resources for this topic representation. May contain summary representations of the subscription resources associated with a topic, where applicable.
» items [summarySubscription]
An array of subscription representations associated with this topic.
_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.
_id string
The unique identifier for this topic resource. This is an opaque string.
read-only
createdAt string(date-time)
Date and time the resource was created
updatedAt string(date-time)
Date and time the resource was updated

topics

{
  "_links": {
    "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"
    }
  },
  "_embedded": {
    "items": [
      {
        "_id": "0399abed-fd3d-4830-a88b-30f38b8a365c",
        "_profile": "https://api.apiture.com/schemas/notifications/topic/v1.0.0/profile.json",
        "createdAt": "2018-04-17T10:04:46.375Z",
        "updatedAt": "2018-04-17T10:12:58.375Z",
        "name": "AccountCreated",
        "domain": "Accounts"
      }
    ]
  },
  "_profile": "http://example.com",
  "_error": {
    "_id": "2eae46e1-575c-4d69-8a8f-0a7b0115a4b3",
    "_profile": "https://api.apiture.com/schemas/common/errorResponse/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": []
    }
  },
  "count": 0,
  "start": 0,
  "limit": 0,
  "name": "string"
}

Topics collection

Collection of topics. 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).

Properties

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
» items [topic]
[Topics are the resource used to group notifications and subscriptions around a specific notification subject. A topic can have any number of associated subscriptions. When a notification is published to a topic, the topic then notifies all of its active subscribers and passes the body of the notification to them. Topics are immutable - the name and domain may not be changed. Hence there is no PUT or PATCH on a topic.]
_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.
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.

deliveryMethod

"push"

Delivery Method

Enumeration of possible methods for delivering a notification.

Properties

No properties

subscriberContent

{
  "email": "beto@apiture.com",
  "subject": "Hello Apiture"
}

Subscriber Content

Subscriber information required by the channel to process the notficiation.

Properties

No properties

subscriptionFields

{
  "deliveryChannel": "string",
  "deliveryMethod": "push",
  "endpoint": {
    "token": "string",
    "recipientUrl": "string"
  },
  "state": "inactive",
  "subscriberContent": {
    "email": "beto@apiture.com",
    "subject": "Hello Apiture"
  }
}

Subscription Fields

Common fields of the subscription resource.

Properties

NameDescription
deliveryChannel string
Delivery channel for the subscription.
deliveryMethod deliveryMethod
Enumeration of possible methods for delivering a notification.
endpoint endpoint
Representation of the recipient of a push notification. If a subscription's publishMethod is push, endpoint is a required field on the subscription resource. # TODO: Document that this uses POST (or, add a method field). Also document what the schema of the body is.
state string
State of the subscription. Inactive subscriptions are not notified when a notification is published to a topic.


Enumerated values:
active
inactive

subscriberContent subscriberContent
Subscriber information required by the channel to process the notficiation.

subscription

{
  "_id": "0399abed-fd3d-4830-a88b-30f38b8a365c",
  "_profile": "https://api.apiture.com/schemas/notifications/subscription/v1.0.0/profile.json",
  "createdAt": "2018-04-17T10:04:46.375Z",
  "updatedAt": "2018-04-17T10:12:58.375Z",
  "deliveryMethod": "pull",
  "deliveryChannel": "SMS",
  "state": "active",
  "endpoint": {
    "token": "8BE74E2B956A9532D3534A835EB66",
    "recipientUrl": "http://somedomain.com/an/external/endpoint"
  },
  "subscriberContent": {
    "smsNumber": "555-555-5555"
  },
  "_links": {
    "apiture:topic": {
      "href": "https://api.apiture.com/notifications/topics/ef967d9f-8bf5-412e-ba31-7d9047cb96b4"
    },
    "apiture:subscriber": {
      "href": "https://api.apiture.com/accounts/account/ef967d9f-8bf5-412e-ba31-7d9047cb96b4"
    }
  }
}

Subscription

Representation of a subscription resource. The _links in a subscription must contain the following:

Properties

NameDescription
deliveryChannel string
Delivery channel for the subscription.
deliveryMethod deliveryMethod
Enumeration of possible methods for delivering a notification.
endpoint endpoint
Representation of the recipient of a push notification. If a subscription's publishMethod is push, endpoint is a required field on the subscription resource. # TODO: Document that this uses POST (or, add a method field). Also document what the schema of the body is.
state string
State of the subscription. Inactive subscriptions are not notified when a notification is published to a topic.


Enumerated values:
active
inactive

subscriberContent subscriberContent
Subscriber information required by the channel to process the notficiation.
_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.
_id string
The unique identifier for this subscription resource. This is an opaque string.
read-only
authenticationState string
State of the subscription's authorization with the subscriber endpoint. This field is derived from the state of the endpoint property and is thus immutable via PATCH or PUT operations. The notifications API attempts an authentication request at the Location specified in the endpoint property at the time of subscription creation. If the authentication attempt fails, creation of the subscription fails. Consequently, new push subscriptions with valid endpoint data are always initialized as authenticated. authenticationState can transition to unauthenticated when the notifications service attempts to send the push request and receives a 401 Unauthorized or 403 Forbidden HTTP status code.


Enumerated values:
authenticated
unauthenticated

createdAt string(date-time)
Date and time the resource was created.
updatedAt string(date-time)
Date and time the resource was updated.

subscriptions

{
  "_links": {
    "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"
    }
  },
  "_embedded": {
    "items": [
      {
        "deliveryChannel": "string",
        "deliveryMethod": "push",
        "endpoint": {
          "token": "string",
          "recipientUrl": "string"
        },
        "state": "inactive",
        "subscriberContent": {
          "email": "beto@apiture.com",
          "subject": "Hello Apiture"
        },
        "_links": {
          "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"
          }
        },
        "_embedded": {},
        "_profile": "http://example.com",
        "_error": {
          "_id": "2eae46e1-575c-4d69-8a8f-0a7b0115a4b3",
          "_profile": "https://api.apiture.com/schemas/common/errorResponse/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": []
          }
        },
        "_id": "string",
        "authenticationState": "authenticated"
      }
    ]
  },
  "_profile": "http://example.com",
  "_error": {
    "_id": "2eae46e1-575c-4d69-8a8f-0a7b0115a4b3",
    "_profile": "https://api.apiture.com/schemas/common/errorResponse/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": []
    }
  },
  "count": 0,
  "start": 0,
  "limit": 0,
  "name": "string"
}

Subscriptions collection

Collection of subscriptions. The items in the collection are ordered in the _embedded.items array; the name is subscriptions. The top-level _links object may contain pagination links (self, next, prev, first, last, collection).

Properties

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
» items [summarySubscription]
[Summary representation of an subscription resource in subscriptions collections. This representation normally does not contain any _embedded objects. If needed, call the GET operation on the item's self link to get _embedded objects.]
_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.
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.

createSubscription

{
  "deliveryMethod": "pull",
  "deliveryChannel": "SMS",
  "state": "inactive",
  "endpoint": {
    "token": "8BE74E2B956A9532D3534A835EB66",
    "recipientUrl": "http://somedomain.com/an/external/endpoint"
  },
  "subscriberContent": {
    "smsNumber": "555-555-5555"
  },
  "_links": {
    "apiture:topic": {
      "href": "https://api.apiture.com/notifications/topics/ef967d9f-8bf5-412e-ba31-7d9047cb96b4"
    },
    "apiture:subscriber": {
      "href": "https://api.apiture.com/accounts/account/ef967d9f-8bf5-412e-ba31-7d9047cb96b4"
    }
  }
}

Create Subscription

Representation used to create a new subscription. The _links in a createSubscription must contain the following: * apiture:*topic - The URI of the topic resource the subscription is associated with. Each subscription must be associated with one topic. Multiple subscriptions can be associated with the same topic. A _link to an existing topic is required when creating a new subscription via a POST to /subscriptions. * apiture:*subscriber - The URI of the subscriber resource the subscription is associated with.

Properties

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.
deliveryChannel string (required)
Delivery channel for the subscription.
deliveryMethod deliveryMethod (required)
Enumeration of possible methods for delivering a notification.
endpoint endpoint
Representation of the recipient of a push notification. If a subscription's publishMethod is push, endpoint is a required field on the subscription resource. # TODO: Document that this uses POST (or, add a method field). Also document what the schema of the body is.
state string
State of the subscription. Inactive subscriptions are not notified when a notification is published to a topic.


Enumerated values:
active
inactive

subscriberContent subscriberContent
Subscriber information required by the channel to process the notficiation.

summarySubscription

{
  "deliveryChannel": "string",
  "deliveryMethod": "push",
  "endpoint": {
    "token": "string",
    "recipientUrl": "string"
  },
  "state": "inactive",
  "subscriberContent": {
    "email": "beto@apiture.com",
    "subject": "Hello Apiture"
  },
  "_links": {
    "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"
    }
  },
  "_embedded": {},
  "_profile": "http://example.com",
  "_error": {
    "_id": "2eae46e1-575c-4d69-8a8f-0a7b0115a4b3",
    "_profile": "https://api.apiture.com/schemas/common/errorResponse/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": []
    }
  },
  "_id": "string",
  "authenticationState": "authenticated"
}

Summary Subscription

Summary representation of an subscription resource in subscriptions collections. This representation normally does not contain any _embedded objects. If needed, call the GET operation on the item's self link to get _embedded objects.

Properties

NameDescription
deliveryChannel string
Delivery channel for the subscription.
deliveryMethod deliveryMethod
Enumeration of possible methods for delivering a notification.
endpoint endpoint
Representation of the recipient of a push notification. If a subscription's publishMethod is push, endpoint is a required field on the subscription resource. # TODO: Document that this uses POST (or, add a method field). Also document what the schema of the body is.
state string
State of the subscription. Inactive subscriptions are not notified when a notification is published to a topic.


Enumerated values:
active
inactive

subscriberContent subscriberContent
Subscriber information required by the channel to process the notficiation.
_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.
_id string
The unique identifier for this subscription resource. This is an opaque string.
read-only
authenticationState string
State of the subscription's authorization with the subscriber endpoint. This field is derived from the state of the endpoint property and is thus immutable via PATCH or PUT operations. The notifications API attempts an authentication request at the Location specified in the endpoint property at the time of subscription creation. If the authentication attempt fails, creation of the subscription fails. Consequently, new push subscriptions with valid endpoint data are always initialized as authenticated. authenticationState can transition to unauthenticated when the notifications service attempts to send the push request and receives a 401 Unauthorized or 403 Forbidden HTTP status code.


Enumerated values:
authenticated
unauthenticated

updateSubscription

{
  "deliveryMethod": "pull",
  "deliveryChannel": "SMS",
  "state": "inactive",
  "endpoint": {
    "token": "8BE74E2B956A9532D3534A835EB66",
    "recipientUrl": "http://somedomain.com/an/external/endpoint"
  },
  "subscriberContent": {
    "smsNumber": "555-555-5555"
  },
  "_links": {
    "apiture:topic": {
      "href": "https://api.apiture.com/notifications/topics/ef967d9f-8bf5-412e-ba31-7d9047cb96b4"
    },
    "apiture:subscriber": {
      "href": "https://api.apiture.com/accounts/account/ef967d9f-8bf5-412e-ba31-7d9047cb96b4"
    }
  }
}

Update Subscription

Representation used to update or patch a subscription. The _links in a subscription must contain the following: * apiture:*topic - The URI of the topic resource the subscription is associated with. Each subscription must be associated with one topic. Multiple subscriptions can be associated with the same topic. A _link to an existing topic is required when creating a new subscription via a POST to /subscriptions. * apiture:*subscriber - The URI of the subscriber resource the subscription is associated with.

Properties

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.
deliveryChannel string
Delivery channel for the subscription.
deliveryMethod deliveryMethod
Enumeration of possible methods for delivering a notification.
endpoint endpoint
Representation of the recipient of a push notification. If a subscription's publishMethod is push, endpoint is a required field on the subscription resource. # TODO: Document that this uses POST (or, add a method field). Also document what the schema of the body is.
state string
State of the subscription. Inactive subscriptions are not notified when a notification is published to a topic.


Enumerated values:
active
inactive

subscriberContent subscriberContent
Subscriber information required by the channel to process the notficiation.

endpoint

{
  "token": "string",
  "recipientUrl": "string"
}

Endpoint

Representation of the recipient of a push notification. If a subscription's publishMethod is push, endpoint is a required field on the subscription resource. # TODO: Document that this uses POST (or, add a method field). Also document what the schema of the body is.

Properties

NameDescription
token string
Authentication token received by the endpoint server.
recipientUrl string (required)
The URL to which the push notification will be sent.

collection

{
  "_links": {
    "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"
    }
  },
  "_embedded": {},
  "_profile": "http://example.com",
  "_error": {
    "_id": "2eae46e1-575c-4d69-8a8f-0a7b0115a4b3",
    "_profile": "https://api.apiture.com/schemas/common/errorResponse/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": []
    }
  },
  "count": 0,
  "start": 0,
  "limit": 0,
  "name": "string"
}

Collection

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

Properties

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.
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.

body

{
  "body": {}
}

Body

Message body attached to a notification

Properties

NameDescription
body object
The JSON body of the notification. Any valid JSON object.

createMessage

{
  "body": {
    "any": "valid",
    "json": "object"
  },
  "_links": {
    "apiture:topic": {
      "href": "https://api.apiture.com/notifications/topics/ef967d9f-8bf5-412e-ba31-7d9047cb96b4"
    },
    "apiture:entity": {
      "href": "https://api.apiture.com/accounts/account/ef967d9f-8bf5-412e-ba31-7d9047cb96b4"
    }
  }
}

Create Message

Representation used to create a notification message. The apiture:topic link is required and must refer to an existing topic to which the message is posted. A message may include an apiture:entity link containing the URI of any related entity. This denotes the primary resource that the message pertains to and is used for filtering notification to only recipients which are entitled to access the entity.

Properties

NameDescription
body body
Message body attached to a notification
_links links
An optional map of links, mapping each link relation to a link object. This model defines the _links object of HAL representations.

notificationFields

{
  "body": {
    "body": {}
  }
}

Notification Fields

Common fields of the notification resource.

Properties

NameDescription
body body
Message body attached to a notification

summaryNotification

{
  "_id": "0399abed-fd3d-4830-a88b-30f38b8a365c",
  "state": "expired",
  "body": {
    "any": "valid",
    "json": "object"
  }
}

Summary Notification

Summary representation of a notification resource in the notifications collections. This representation normally does not contain any _embedded objects. If needed, call the GET operation on the item's self link to get _embedded objects.

Properties

NameDescription
body body
Message body attached to a notification
_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.
_id string
The unique identifier for this notification resource. This is an opaque string.
read-only
state string

The state of the notification. failed means the notification was successfully queued for processing by the topic, but there was a failure in communicating the notification to one or more of the topic's subscribers. This field is a derived field and thus is immutable via PATCH or PUT operations.

  • pending - Subscribers are in process of being notified. The subscriber is responsible to update the state of a pull notification to received once retrieved. A push notification will update its state automatically once the subscriber endpoint responds successfully.
  • received - The subscriber has been notified. After retrieving pull notifications, the API consumer must update the state to received by POST to the apiture:acknowledge link's href. Pulled notifications that have not been set to received are considered by the service to be new and pending, which may cause unexpected behaviors in your application.
  • expired - Primarily associated with push notifications. By default, push notifications will persist in the queue for 4 days. If during that time the notification cannot successfully be delivered, it is set to expired and moved to a dead letter queue. expired notifications will be stored with an _embedded.errors array to identify the cause of expiration.
  • failed - If the notifications service experiences any errors or unforeseen circumstances that would cause a failure of notification delivery, the state is set to failed and the notification will be stored with an _embedded.errors array containing causes of failure.


Enumerated values:
received
expired
failed
pending

summaryTopicNotification

{
  "_id": "0399abed-fd3d-4830-a88b-30f38b8a365c",
  "state": "expired",
  "deliveryChannel": "email",
  "deliveryMethod": "push",
  "body": {
    "any": "valid",
    "json": "object"
  }
}

Summary Topic Notification

Summary representation of a notification resource in the notifications collections. This representation normally does not contain any _embedded objects. If needed, call the GET operation on the item's self link to get _embedded objects.

Properties

NameDescription
body body
Message body attached to a notification
_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.
_id string
The unique identifier for this notification resource. This is an opaque string.
read-only
state string

The state of the notification. failed means the notification was successfully queued for processing by the topic, but there was a failure in communicating the notification to one or more of the topic's subscribers. This field is a derived field and thus is immutable via PATCH or PUT operations.

  • pending - Subscribers are in process of being notified. The subscriber is responsible to update the state of a pull notification to received once retrieved. A push notification will update its state automatically once the subscriber endpoint responds successfully.
  • received - The subscriber has been notified. After retrieving pull notifications, the API consumer must update the state to received by POST to the apiture:acknowledge link's href. Pulled notifications that have not been set to received are considered by the service to be new and pending, which may cause unexpected behaviors in your application.
  • expired - Primarily associated with push notifications. By default, push notifications will persist in the queue for 4 days. If during that time the notification cannot successfully be delivered, it is set to expired and moved to a dead letter queue. expired notifications will be stored with an _embedded.errors array to identify the cause of expiration.
  • failed - If the notifications service experiences any errors or unforeseen circumstances that would cause a failure of notification delivery, the state is set to failed and the notification will be stored with an _embedded.errors array containing causes of failure.


Enumerated values:
received
expired
failed
pending

deliveryChannel string
Delivery channel for the subscription.
deliveryMethod deliveryMethod
Enumeration of possible methods for delivering a notification.

notification

{
  "_id": "0399abed-fd3d-4830-a88b-30f38b8a365c",
  "_profile": "https://api.apiture.com/schemas/notifications/notification/v1.0.0/profile.json",
  "createdAt": "2018-04-17T10:04:46.375Z",
  "updatedAt": "2018-04-17T10:12:58.375Z",
  "_links": {
    "apiture:topic": {
      "href": "https://api.apiture.com/notifications/topics/ef967d9f-8bf5-412e-ba31-7d9047cb96b4"
    },
    "apiture:subscription": {
      "href": "https://api.apiture.com/notifications/subscriptions/ff968d9f-8bf7-412e-ba31-7d9047cb96b3"
    },
    "apiture:entity": {
      "href": "https://api.apiture.com/users/user/ff968d9f-8bf7-412e-ba31-7d9047cb96b3"
    },
    "apiture:acknowledge": {
      "href": "https://api.apiture.com/notifications/receivedNotifications?notification=https://api.apiture.com/notifications/pullNotifications/ff968d9f-8bf7-412e-ba31-7d9047cb96b3"
    }
  }
}

Notification

Representation of notification resource. A notification resource is a resource which matches a message, the topic it was published to, and the subscription instance that it is delivered to. In addition to the normal self link, the links for a notification include:

Properties

NameDescription
body body
Message body attached to a notification
_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.
_id string
The unique identifier for this notification resource. This is an opaque string.
read-only
state string

The state of the notification. failed means the notification was successfully queued for processing by the topic, but there was a failure in communicating the notification to one or more of the topic's subscribers. This field is a derived field and thus is immutable via PATCH or PUT operations.

  • pending - Subscribers are in process of being notified. The subscriber is responsible to update the state of a pull notification to received once retrieved. A push notification will update its state automatically once the subscriber endpoint responds successfully.
  • received - The subscriber has been notified. After retrieving pull notifications, the API consumer must update the state to received by POST to the apiture:acknowledge link's href. Pulled notifications that have not been set to received are considered by the service to be new and pending, which may cause unexpected behaviors in your application.
  • expired - Primarily associated with push notifications. By default, push notifications will persist in the queue for 4 days. If during that time the notification cannot successfully be delivered, it is set to expired and moved to a dead letter queue. expired notifications will be stored with an _embedded.errors array to identify the cause of expiration.
  • failed - If the notifications service experiences any errors or unforeseen circumstances that would cause a failure of notification delivery, the state is set to failed and the notification will be stored with an _embedded.errors array containing causes of failure.


Enumerated values:
received
expired
failed
pending

createdAt string(date-time)
Date and time the resource was created
updatedAt string(date-time)
Date and time the resource was updated

notifications

{
  "_profile": "https://api.apiture.com/schemas/notifications/notifications/v1.0.0/profile.json",
  "start": 10,
  "limit": 10,
  "count": 67,
  "name": "notifications",
  "_links": {
    "self": {
      "href": "/basePath/notifications?start=10&limit=10"
    },
    "first": {
      "href": "/basePath/notifications?start=0&limit=10"
    },
    "next": {
      "href": "/basePath/notifications?start=20&limit=10"
    },
    "collection": {
      "href": "/basePath/notifications"
    }
  },
  "_embedded": {
    "items": [
      {
        "_id": "0399abed-fd3d-4830-a88b-30f38b8a365c",
        "_profile": "https://api.apiture.com/schemas/notifications/notification/v1.0.0/profile.json",
        "_links": {
          "self": {
            "href": "/basePath/notifications/0399abed-fd3d-4830-a88b-30f38b8a365c"
          }
        }
      },
      {
        "_id": "d62c0701-0d74-4836-83f9-ebf3709442ea",
        "_profile": "https://api.apiture.com/schemas/notifications/notification/v1.0.0/profile.json",
        "_links": {
          "self": {
            "href": "/basePath/notifications/d62c0701-0d74-4836-83f9-ebf3709442ea"
          }
        }
      }
    ]
  }
}

Notification Collection

Collection of notifications. 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).

Properties

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
» items [summaryNotification]
An array containing a page of notification items.
_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.
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.

topicNotifications

{
  "_profile": "https://api.apiture.com/schemas/notifications/topicNotifications/v1.0.0/profile.json",
  "start": 10,
  "limit": 10,
  "count": 67,
  "name": "notifications",
  "_links": {
    "self": {
      "href": "/basePath/notifications?start=10&limit=10"
    },
    "first": {
      "href": "/basePath/notifications?start=0&limit=10"
    },
    "next": {
      "href": "/basePath/notifications?start=20&limit=10"
    },
    "collection": {
      "href": "/basePath/notifications"
    }
  },
  "_embedded": {
    "items": [
      {
        "_id": "0399abed-fd3d-4830-a88b-30f38b8a365c",
        "_profile": "https://api.apiture.com/schemas/notifications/notification/v1.0.0/profile.json",
        "_links": {
          "self": {
            "href": "/basePath/notifications/0399abed-fd3d-4830-a88b-30f38b8a365c"
          }
        },
        "deliveryChannel": "web",
        "deliveryMethod": "pull"
      },
      {
        "_id": "d62c0701-0d74-4836-83f9-ebf3709442ea",
        "_profile": "https://api.apiture.com/schemas/notifications/notification/v1.0.0/profile.json",
        "_links": {
          "self": {
            "href": "/basePath/notifications/d62c0701-0d74-4836-83f9-ebf3709442ea"
          }
        },
        "deliveryChannel": "sms",
        "deliveryMethod": "push"
      }
    ]
  }
}

Topic Notifications Collection

Collection of notifications. 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).

Properties

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
» items [summaryTopicNotification]
An array containing a page of notification items.
_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.
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.

abstractResource

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

Abstract Resource

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.

Properties

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": "apiName",
  "name": "API name",
  "apiVersion": "0.0.1-SNAPSHOT",
  "_profile": "https://api.apiture.com/schemas/common/root/v1.0.0/profile.json",
  "_links": {}
}

API Root

A HAL response, with hypermedia _links for the top-level resources and operations in API.

Properties

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.
_id string
This API's unique ID.
name string
This API's name.
apiVersion string
This API's version.

errorResponse

{
  "_profile": "https://api.apiture.com/schemas/common/errorResponse/v1.0.0/profile.json",
  "_error": {
    "_id": "2eae46e1-575c-4d69-8a8f-0a7b0115a4b3",
    "_profile": "https://api.apiture.com/schemas/common/errorResponse/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": {},
    "_links": {
      "describedby": {
        "href": "http://doc.apiture.com/errors/positiveNumberRequired"
      }
    },
    "_embedded": {
      "errors": []
    }
  }
}

Error Response

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

Properties

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.

error

{
  "_id": "2eae46e1-575c-4d69-8a8f-0a7b0115a4b3",
  "_profile": "https://api.apiture.com/schemas/common/errorResponse/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

An error description. Nested source errors are contained in the _embedded object with the key "errors"; this is an array of nested error objects. For example, an API which validates its request body may find multiple errors in the request, which may be detailed here. The _links may contain a describedby link which refers to a web page with details about the error. The attributes field An optional map of name/value pairs which provide structured data about the error. For example, if the error is a value out of range, the attributes may specify the range values min and max. This allows clients to present error messages as they see fit (the API does not assume the client/presentation tier).

Properties

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.
read-only
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

An optional map of name/value pairs which contains additional dynamic data about the resource.

Properties

No properties

{
  "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

An optional map of links, mapping each link relation to a link object. This model defines the _links object of HAL representations.

Properties

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

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.

Properties

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.