Notifications API
  • 14 Apr 2020
  • 2 Minutes To Read
  • Print
  • Share
  • Dark
    Light

Notifications API

  • Print
  • Share
  • Dark
    Light

URL

/api/notifications/messages/search

/api/notifications/messages

Description

Allows you to get the communications history via API and re-send failed notification messages via API.

Methods

POST


POST Search

Get the communications history by the specified filter

Parameters

Parameter Value
filterSelection The field on which the constraint will be applied. For custom fields the custom field encoded key must be provided.
filterElement The constraint operator. Available filter elements can be found below.
value The constraint value. Required for filter elements with one or two values.
secondValue The constraint second value. Required for filter elements with two values.
dataItemType The entity where the field on which to apply the constraint is located. If the field is located in the same entity with the entity being searched, this field is optional.
dataFieldType NATIVE(default)/CUSTOM for custom field searches

Available notification message filter values

Filter Selection Parameter Data Type
SENDER_KEY KEY
RECIPIENT_CLIENT_KEY KEY
RECIPIENT_GROUP_KEY KEY
RECIPIENT_USER_KEY KEY
ENCODED_KEY KEY
CREATION_DATE DATE_UTC
SENT_DATE DATE_UTC
STATE ENUM
FAILURE_REASON ENUM
DESTINATION STRING
TYPE ENUM
EVENT ENUM
WAITING_REASON ENUM
Please Note
The waiting reason will be displayed only for notifications that have the WAITING status. The possible values for the WAITING_REASON parameter are: READY_TO_BE_SENT, WAIT_FOR_CLOSE_CIRCUIT, or SENDING.

Filter Elements

Filter Element Number Of affected values Available for
EQUALS ONE_VALUE BIG_DECIMAL,BOOLEAN,LONG,MONEY,NUMBER,PERCENT,STRING,ENUM,KEY
MORE_THAN ONE_VALUE BIG_DECIMAL,NUMBER,MONEY
LESS_THAN ONE_VALUE BIG_DECIMAL,NUMBER,MONEY
BETWEEN TWO_VALUES BIG_DECIMAL,NUMBER,MONEY,DATE,DATE_UTC
ON ONE_VALUE DATE,DATE_UTC
AFTER ONE_VALUE DATE,DATE_UTC
BEFORE ONE_VALUE DATE,DATE_UTC
STARTS_WITH ONE_VALUE STRING
IN LIST ENUM,KEY
TODAY NO_VALUE DATE,DATE_UTC
THIS_WEEK NO_VALUE DATE,DATE_UTC
THIS_MONTH NO_VALUE DATE,DATE_UTC
THIS_YEAR NO_VALUE DATE,DATE_UTC
LAST_DAYS ONE_VALUE DATE,DATE_UTC
EMPTY NO_VALUE BIG_DECIMAL,LONG,MONEY,NUMBER,PERCENT,STRING,ENUM,KEY,DATE,DATE_UTC
NOT_EMPTY NO_VALUE BIG_DECIMAL,LONG,MONEY,NUMBER,PERCENT,STRING,ENUM,KEY,DATE,DATE_UTC

Usage examples

Get notifications sent when the loan account was created

POST /api/notifications/messages/search
{
   "filterConstraints":[
      {
         "filterSelection":"EVENT",
         "filterElement":"EQUALS",
         "value":"LOAN_CREATED"
      }
   ]
}

Get failed webhook notifications

POST /api/notifications/messages/search
{
   "filterConstraints":[
      {
         "filterSelection":"TYPE",
         "filterElement":"EQUALS",
         "value":"WEB_HOOK"
      },
      {
         "filterSelection":"STATE",
         "filterElement":"EQUALS",
         "value":"FAILED"
      }
   ]
}

Get all successful notifications sent to a particular user

POST /api/notifications/messages/search
{
   "filterConstraints":[
        { 
            "filterSelection":"RECIPIENT_USER_KEY",
            "filterElement":"EQUALS",
            "value":"40288011560e37a701560e3aef030483"
        },
        { 
            "filterSelection":"STATE",
            "filterElement":"EQUALS",
            "value":"SENT"
        }
   ]
}

Response

A 200 OK response will be issued with an array of notifications.

[
   {
      "encodedKey":"8a0991f14de54ed1014de768d4a40c18",
      "creationDate":"2015-06-12T10:55:16+0000",
      "sendDate":"2015-06-12T10:55:17+0000",
      "type":"WEB_HOOK",
      "state":"SENT",
      "destination":"http://requestbin.com/r0sdq1r0",
      "event":"LOAN_CREATED",
      "body":"Demo body content"
   },
   {
      "encodedKey":"8a09babc4d9d34b9014d9f35a9580530",
      "creationDate":"2015-05-29T10:26:43+0000",
      "sendDate":"2015-05-29T10:26:44+0000",
      "type":"WEB_HOOK",
      "state":"SENT",
      "destination":"https://example.com/webhook",
      "event":"LOAN_CREATED",
      "body":"Demo body content"
   }
]

POST Re-send failed notification messages

Re-send failed notification messages of any type (SMS/Email/WebHook) for the specified notification message encoded keys. It allows posting one notification or bulk notifications in the same API call

Parameters

Parameter Value
action The action type of this API call. Its value should be "resend". Required.
identifiers By this parameter you can specify an array of one or more encoded keys to re-send of failed notification messages. Duplicated encoded keys are not allowed. Required.
Please Note
The user requires the Resend Failed Messages permission in order to send the failed notifications.

Usage examples

Re-send one failed notification message

POST /api/notifications/messages
{
   "action":"resend",
   "identifiers":[
      "8a80808a5317de22015317de5b94034c"
   ]
}

Re-send in bulk more failed notification messages

POST /api/notifications/messages
{
   "action":"resend",
   "identifiers":[
      "8a80808a5317de22015317de5b94034c",
      "8a80806852f38c860152f38de0ad0019",
      "8a80806852f38c860152f38de0ad0023"
   ]
}

Response

A 200 OK response will be issued.

{
    "returnCode": 200,
    "returnStatus": "SUCCESS"
}

Ask the Mambu Community
If you have a question about how anything works or have come across something you haven't seen explained here, get in touch with our community of fellow users and Mambuvians where someone will lend a hand.
Ask a question about our REST APIs

* If you don't already have an account you will be prompted to create one when you first visit the site.

Was This Article Helpful?