NAV
curl HTTP

Subaio Receive Notifications API v1.0

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

The Subaio Receive Notifications API allows partners to send push notifications to a user.

Base URLs:

Email: Support

Authentication

Notifications

Receive notifications.

Code samples

# You can also use wget
curl -X POST https://notification-api/notifications \
  -H 'Content-Type: application/json' \
  -H 'Authorization: Bearer {access-token}'

POST https://notification-api/notifications HTTP/1.1
Host: notification-api
Content-Type: application/json

POST /notifications

Body parameter

{
  "notification": {
    "type": "NEW_SUBSCRIPTION",
    "country": "DK",
    "userId": "4242d747-d2cc-454d-857d-c4cab7fa2d11",
    "suggestedLocale": "da-dk",
    "payload": [
      {
        "name": "SUBSCRIPTION",
        "params": {
          "notificationType": "NEW_SUBSCRIPTION",
          "notificationId": "ac729cac-d985-4c35-a5d5-edaf3ae7dfe2",
          "serviceId": "a7a3146f-973c-4821-b862-d94ae80b2690",
          "url": "string"
        }
      }
    ],
    "texts": {
      "en": {
        "title": "Subscriptions",
        "body": "You have a new subscription"
      },
      "da": {
        "title": "Abonnement",
        "body": "Du har et nyt abonnement"
      }
    },
    "data": {
      "productTitle": "Booksy",
      "productImageUrl": "https://cdn.prod.subaio.com/products/fa208ed5-c15e-4e73-8ed0-450602395f7f/42872372cbd9be0cf664ddd284fe4804.png",
      "productType": "subscription",
      "product": {
        "title": "Booksy",
        "imageUrl": "https://cdn.prod.subaio.com/products/fa208ed5-c15e-4e73-8ed0-450602395f7f/42872372cbd9be0cf664ddd284fe4804.png",
        "type": "SUBSCRIPTION"
      },
      "subscriptionCount": 1,
      "amount": 99,
      "currency": "DKK"
    }
  }
}

Parameters

Name In Type Required Description
body body ReceiveNotificationRequest true none

Responses

Status Meaning Description Schema
202 Accepted Notifications have been received. None
401 Unauthorized Bearer token is invalid or expired. None

Schemas

ReceiveNotificationRequest

{
  "notification": {
    "type": "NEW_SUBSCRIPTION",
    "country": "DK",
    "userId": "4242d747-d2cc-454d-857d-c4cab7fa2d11",
    "payload": [
      {
        "name": "SUBSCRIPTION",
        "params": {
          "notificationType": "NEW_SUBSCRIPTION",
          "notificationId": "ac729cac-d985-4c35-a5d5-edaf3ae7dfe2",
          "serviceId": "a7a3146f-973c-4821-b862-d94ae80b2690",
          "url": "string"
        }
      }
    ],
    "suggestedLocale": "da-dk",
    "texts": [
      {
        "en": {
          "title": "Subscriptions",
          "body": "You have a new subscription"
        },
        "da": {
          "title": "Abonnement",
          "body": "Du har et nyt abonnement"
        }
      }
    ]
  }
}

Properties

Name Type Required Restrictions Description
notification Notification true none none

Notification

{
  "type": "NEW_SUBSCRIPTION",
  "country": "DK",
  "userId": "4242d747-d2cc-454d-857d-c4cab7fa2d11",
  "payload": [
    {
      "name": "SUBSCRIPTION",
      "params": {
        "notificationType": "NEW_SUBSCRIPTION",
        "notificationId": "ac729cac-d985-4c35-a5d5-edaf3ae7dfe2",
        "serviceId": "a7a3146f-973c-4821-b862-d94ae80b2690",
        "url": "string"
      }
    }
  ],
  "suggestedLocale": "da-dk",
  "texts": [
    {
      "en": {
        "title": "Subscriptions",
        "body": "You have a new subscription"
      },
      "da": {
        "title": "Abonnement",
        "body": "Du har et nyt abonnement"
      }
    }
  ]
}

Properties

Name Type Required Restrictions Description
type NotificationType true none * CANCELLATION_COMPLETED: Recurring payment has been cancelled.
* CANCELLATION_ABORTED: Cancellation for recurring payment failed.
* NEW_SUBSCRIPTION: A new subscription has occurred.
* CANCELLATION_MOREINFOREQUIRED: More information to complete cancellation is required.
* NEW_PAYMENT_CANCELLED_SUBSCRIPTION: A payment has been made to a cancelled subscription.
* PAYMENT_CHANGED: Payments for service has changed.
* USER_UPDATE_REQUIRED: User update required.
* NEW_PAYMENT: A new payment has been made on an existing service.
* BUDGET_CHANGED: Budget status has changed for user.
country string true none Two-letter country-code conforming to ISO 3166 alpha-2
userId string true none none
payload [NotificationParams] true none none
suggestedLocale string true none none
texts [NotificationText] true none none

NotificationParams

{
  "name": "SUBSCRIPTION",
  "params": {
    "notificationType": "NEW_SUBSCRIPTION",
    "notificationId": "ac729cac-d985-4c35-a5d5-edaf3ae7dfe2",
    "serviceId": "a7a3146f-973c-4821-b862-d94ae80b2690",
    "url": "string"
  }
}

Properties

Name Type Required Restrictions Description
name string true none none
params object true none none
ยป additionalProperties string false none none

NotificationType

"NEW_SUBSCRIPTION"

Properties

Name Type Required Restrictions Description
anonymous string false none * CANCELLATION_COMPLETED: Recurring payment has been cancelled.
* CANCELLATION_ABORTED: Cancellation for recurring payment failed.
* NEW_SUBSCRIPTION: A new subscription has occurred.
* CANCELLATION_MOREINFOREQUIRED: More information to complete cancellation is required.
* NEW_PAYMENT_CANCELLED_SUBSCRIPTION: A payment has been made to a cancelled subscription.
* PAYMENT_CHANGED: Payments for service has changed.
* USER_UPDATE_REQUIRED: User update required.
* NEW_PAYMENT: A new payment has been made on an existing service.
* BUDGET_CHANGED: Budget status has changed for user.

Enumerated Values

Property Value
anonymous CANCELLATION_COMPLETED
anonymous CANCELLATION_ABORTED
anonymous NEW_SUBSCRIPTION
anonymous CANCELLATION_MOREINFOREQUIRED
anonymous NEW_PAYMENT_CANCELLED_SUBSCRIPTION
anonymous PAYMENT_CHANGED
anonymous USER_UPDATE_REQUIRED
anonymous NEW_PAYMENT
anonymous BUDGET_CHANGED

NotificationText

{
  "en": {
    "title": "Subscriptions",
    "body": "You have a new subscription"
  },
  "da": {
    "title": "Abonnement",
    "body": "Du har et nyt abonnement"
  }
}

Properties

Name Type Required Restrictions Description
additionalProperties NotificationTranslation false none none

NotificationTranslation

{
  "title": "Subscriptions",
  "body": "You have a new subscription"
}

Properties

Name Type Required Restrictions Description
title string true none none
body string true none none