Pull Notifications

This page contains the details of pull notification, types, use cases, perspectives.

Pull Notifications

Pull notifications are provided with an API. These notifications can be retrieved by making a GET request. These notifications can have different types. Pull notification is different as this data is only retrieved when the device sends a request to the server, and then the server responds with the data. There are different scenarios where an entry is created for a pull notification. The notification also depends on who performs the tasks and how the account is shared between multiple users. Every notification has some unique type that represents what type of notification it is. Make a get request to the below endpoint to get all the pull notifications available under an account:

A sample request is given below for better understanding.

Card Issued Notification Response

[{
    "id": "123456",
    "time": "2019-02-13T14:50:51+00:00",
    "type": "CARD_ISSUED",
    "data": {
        "cardId": "12345678945",
        "performedByName": "Mary Jane",
        "tag": "Broke"
    }
}]

The previous response is received when a card is issued against an account. By looking at the type value of the notification object, you can uniquely identify what type of notification it is. For this one, you can show a notification text saying,

"A new card was issued to your AAZZUR shared account {accountTag}."

These notifications also depend on multiple factors, such as the previous notification will be displayed to all the users with the account shared.

Example Pull Notification Response

Account Image Updated

{
    "id": "123456",
    "time": "2019-02-13T14:50:51+00:00",
    "type": "ACCOUNT_IMAGE_UPDATED",
    "data": {
        "performedByName": "Peter Parker",
        "tag": "Account"
    }
}

Account Name Updated

{
    "id": "123456",
    "time": "2019-02-13T14:50:51+00:00",
    "type": "ACCOUNT_TAG_UPDATED",
    "data": {
        "performedByName": "Peter Parker",
        "oldTag": "Old Account",
        "newTag": "New Account"
    }
}

Account Sharing Accepted

{
    "id": "123456",
    "time": "2019-02-13T14:50:51+00:00",
    "type": "ACCOUNT_SHARING_ACCEPTED",
    "data": {
        "inviteeName": "Mitch Hasselhoff",
        "requestId": "123456789"
    }
}

Users Added to Shared Account

{
    "id": "123456",
    "time": "2019-02-13T14:50:51+00:00",
    "type": "ADDED_SHARED_ACCOUNT_USER",
    "data": {
        "addedUserName": "Peter Parker",
        "accountOwnerName": "Kylo Ren",
        "tag": "Account"
    }
}

Account Share Rejected

{
    "id": "123456",
    "time": "2019-02-13T14:50:51+00:00",
    "type": "ACCOUNT_SHARING_REJECTED",
    "data": {
        "inviteeName": "Peter Parker",
        "requestId": "123456789",
        "message": "No thanks"
    }
}

Account Share Requested

{
    "id": "123456",
    "time": "2019-02-13T14:50:51+00:00",
    "type": "ACCOUNT_SHARING_REQUESTED",
    "data": {
        "initiatorName": "Ben Solo",
        "message": "Join the dark side",
        "requestId": "123456789",
        "permissions": ["CARDS", "TRANSFERS"],
        "tag": "Vader"
    }
}

Account Unshared

{
    "id": "123456",
    "time": "2019-02-13T14:50:51+00:00",
    "type": "ACCOUNT_UNSHARED",
    "data": {
        "ownerName": "Peter Parker",
        "removedUserName": "Mary Jane",
        "tag": "Broke",
        "thisUserRemoved": true,
        "userLeft": false
    }
}

Pull Notification Perspective

As stated before, pull notifications depend on many things, which users will get the notification and so on. Suppose the account owner shares the account with another user. In that case, the second user should get the account-sharing notification, and the first user should not get any notification unless the second user accepts/declines the request.

Another use case is when the owner or other users pause a card while sharing their account. This scenario works in such a way that all the other account holders can be notified about these changes.

Last updated