v6 - Subscriptions - Demo Endpoints

Retrieve push notification subscription list

Retrieve a list containing all configured push notification subscriptions.

GET /retailer-demo/subscriptions

  • Request

  • Response

Accept: application/vnd.retailer.v6+json
Content-Type: application/vnd.retailer.v6+json
Authorization: Bearer token (omitted)

This endpoint has no request body.

Content-Type: application/vnd.retailer.v6+json

Status: 200 OK

{
  "subscriptions" : [ {
    "id" : "1234",
    "resources" : [ "PROCESS_STATUS" ],
    "url" : "https://www.example.com/push"
  } ]
}

Trigger sending of a test push notification for subscription

Call that will trigger a message to be sent to all configured push notification subscription endpoints, to verify if they are working. Note: demo endpoint does not actually send any messages, use the live production version of the Retailer API to send test messages.

POST /retailer-demo/subscriptions/test

  • Request

  • Response

Accept: application/vnd.retailer.v6+json
Content-Type: application/vnd.retailer.v6+json
Authorization: Bearer token (omitted)

This endpoint has no request body.

Content-Type: application/vnd.retailer.v6+json

Status: 202 ACCEPTED

{
  "processStatusId" : "1",
  "eventType" : "SEND_SUBSCRIPTION_TST_MSG",
  "description" : "Send a test push notification for configured subscription.",
  "status" : "PENDING",
  "createTimestamp" : "2021-04-08T15:52:56+02:00",
  "links" : [ {
    "rel" : "self",
    "href" : "http://api.bol.com/retailer-demo/process-status/1",
    "method" : "GET"
  } ]
}

Create push notification subscription

Create a new push notification subscription and configure it to receive process status events on URL https://www.example.com/push.

POST /retailer-demo/subscriptions

  • Request

  • Response

Accept: application/vnd.retailer.v6+json
Content-Type: application/vnd.retailer.v6+json
Authorization: Bearer token (omitted)

{
  "resources" : [ "PROCESS_STATUS" ],
  "url" : "https://www.example.com/push"
}

Content-Type: application/vnd.retailer.v6+json

Status: 202 ACCEPTED

{
  "processStatusId" : "1",
  "eventType" : "CREATE_SUBSCRIPTION",
  "description" : "Create push notification subscription.",
  "status" : "PENDING",
  "createTimestamp" : "2021-04-08T15:52:56+02:00",
  "links" : [ {
    "rel" : "self",
    "href" : "http://api.bol.com/retailer-demo/process-status/1",
    "method" : "GET"
  } ]
}

Delete existing push notification subscription

Delete an existing push notification subscription with id 1234.

DELETE /retailer-demo/subscriptions/1234

  • Request

  • Response

Accept: application/vnd.retailer.v6+json
Content-Type: application/vnd.retailer.v6+json
Authorization: Bearer token (omitted)

This endpoint has no request body.

Content-Type: application/vnd.retailer.v6+json

Status: 202 ACCEPTED

{
  "processStatusId" : "1",
  "eventType" : "DELETE_SUBSCRIPTION",
  "description" : "Delete push notification subscription with id 1234.",
  "status" : "PENDING",
  "createTimestamp" : "2021-04-08T15:52:56+02:00",
  "links" : [ {
    "rel" : "self",
    "href" : "http://api.bol.com/retailer-demo/process-status/1",
    "method" : "GET"
  } ]
}

Retrieve push notification subscription

Retrieve push notification subscription with id 1234.

GET /retailer-demo/subscriptions/1234

  • Request

  • Response

Accept: application/vnd.retailer.v6+json
Content-Type: application/vnd.retailer.v6+json
Authorization: Bearer token (omitted)

This endpoint has no request body.

Content-Type: application/vnd.retailer.v6+json

Status: 200 OK

{
  "id" : "1234",
  "resources" : [ "PROCESS_STATUS" ],
  "url" : "https://www.example.com/push"
}

Update existing push notification subscription

Update an existing push notification subscription with id 1234 and configure it to receive process status events on URL https://www.example.com/push.

PUT /retailer-demo/subscriptions/1234

  • Request

  • Response

Accept: application/vnd.retailer.v6+json
Content-Type: application/vnd.retailer.v6+json
Authorization: Bearer token (omitted)

{
  "resources" : [ "PROCESS_STATUS" ],
  "url" : "https://www.example.com/push"
}

Content-Type: application/vnd.retailer.v6+json

Status: 202 ACCEPTED

{
  "processStatusId" : "1",
  "entityId" : "1234",
  "eventType" : "UPDATE_SUBSCRIPTION",
  "description" : "Update push notification subscription with id 1234.",
  "status" : "PENDING",
  "createTimestamp" : "2021-04-08T15:52:56+02:00",
  "links" : [ {
    "rel" : "self",
    "href" : "http://api.bol.com/retailer-demo/process-status/1",
    "method" : "GET"
  } ]
}