v1

latestOpenAPI 3.0.22026-07-1351821.6 KB
Subscribe to notifications

Subscribes to receive push notifications.

Use this API to subscribe to task notifications. See https://developer.basware.com/api/p2p/manual#PushNotifications for notification format which needs to be supported by the receiving endpoint.

Note: Basware API validates the receiving endpoint by sending a notification with taskType 'ConnectionTest', to which a 200 OK HTTP response needs to be returned.

post/v1/subscriptions

Request body

taskTypestring required

Task type for which notifications are sent. Supported values: 'AccountingDocuments', 'ExportedPurchaseRequisitions', 'ExportedPurchaseOrders', 'RequestStatus', 'ExportedContracts' , 'ExportedContractSpends'.

taskSubTypestring

Task subtype for which webhook notifications are sent. Supported values: 'WaitingForPrebook', 'WaitingForTransfer', 'WaitingForPrebookCancelation', 'WaitingToBeRemoved', 'WaitingToBeReturned', 'WaitingToBeCompleted', 'WaitingForExport', 'Error', 'Success', 'All'. Available values depend on taskType. If null, defaults to 'Error' for RequestStatus taskType and 'All' for other taskTypes.

subscriptionType'Webhook' | 'Polling' required
notificationWebhookURLstring uri required

URL where API posts push notifications when subscriptionType = 'Webhook' (then field is mandatory). This URL needs to implement the Basware's notification receival API specification.

webhookAuthenticationTokenstring required

Secret key used by API to sign sent push notifications so authenticity can be verified by customer. Mandatory when subscription type is 'Webhook'.

lastUpdatedstring date-time

Timestamp when this subscription has been last updated (set automatically by Basware API).

Example request

[
  {
    "taskType": "AccountingDocuments",
    "taskSubType": "All",
    "notificationWebhookURL": "https://bwnotificationapi.customer.com/accountingdocumentnotifications",
    "webhookAuthenticationToken": "ad65rujltr9093ijhdkutiyua09döijhsa76d8799w8pqugdfafjdhfkjhadls",
    "lastUpdated": "2021-08-04T08:39:13Z",
    "autoResponder": {
      "autoResponseMessage": "Updated coding details.",
      "fieldUpdateArray": [
        {
          "fieldId": "codingRows[2]/accountCode",
          "updateToValue": "02600"
        }
      ]
    }
  }
]

Response

Successful Response

taskTypestring required

Task type for which notifications are sent. Supported values: 'AccountingDocuments', 'ExportedPurchaseRequisitions', 'ExportedPurchaseOrders', 'RequestStatus', 'ExportedContracts' , 'ExportedContractSpends'.

taskSubTypestring

Task subtype for which webhook notifications are sent. Supported values: 'WaitingForPrebook', 'WaitingForTransfer', 'WaitingForPrebookCancelation', 'WaitingToBeRemoved', 'WaitingToBeReturned', 'WaitingToBeCompleted', 'WaitingForExport', 'Error', 'Success', 'All'. Available values depend on taskType. If null, defaults to 'Error' for RequestStatus taskType and 'All' for other taskTypes.

subscriptionType'Webhook' | 'Polling' required
notificationWebhookURLstring uri required

URL where API posts push notifications when subscriptionType = 'Webhook' (then field is mandatory). This URL needs to implement the Basware's notification receival API specification.

webhookAuthenticationTokenstring required

Secret key used by API to sign sent push notifications so authenticity can be verified by customer. Mandatory when subscription type is 'Webhook'.

lastUpdatedstring date-time

Timestamp when this subscription has been last updated (set automatically by Basware API).

Example response

[
  {
    "taskType": "AccountingDocuments",
    "taskSubType": "All",
    "notificationWebhookURL": "https://bwnotificationapi.customer.com/accountingdocumentnotifications",
    "webhookAuthenticationToken": "ad65rujltr9093ijhdkutiyua09döijhsa76d8799w8pqugdfafjdhfkjhadls",
    "lastUpdated": "2021-08-04T08:39:13Z",
    "autoResponder": {
      "autoResponseMessage": "Updated coding details.",
      "fieldUpdateArray": [
        {
          "fieldId": "codingRows[2]/accountCode",
          "updateToValue": "02600"
        }
      ]
    }
  }
]