Fetch notifications overview
These APIs are useful for fetching list of all notification (inbox or spam) of a user in a paginated manner.
Notification list API
- js
// userAlice.notification.list(type, {options?})
const inboxNotifications = await userAlice.notification.list("INBOX");
Notification list parameters
Param | Type | Subtype | Default | Remarks |
---|---|---|---|---|
type | INBOX or SPAM | - | INBOX | A string representing the type of feed to retrieve. |
options | object | - | - | An object containing additional options for filtering and pagination. |
- | options.account | string | - | Account supports a number of address format including wallet addresses, chain agnostic wallet addresses, NFT addresses, etc |
- | options.channels | string[] | - | An array of channels to filter feeds by. |
- | options.page | number | 1 | A number representing the page of results to retrieve. |
- | options.limit | number | 10 | A number representing the maximum number of feeds to retrieve per page. |
- | options.raw | boolean | False | A boolean indicating whether to retrieve raw feed data. |
Note: Parameters
in this style
are mandatory.
Expected response
[
{
cta: "",
title: "test",
message: "test",
icon: "https://gateway.ipfs.io/ipfs/bafybeib76bmkscu6efwawi2tkltdgthwrpny2ok7lur7nltffgydiq7ruy/QmVaY4HQaorrMhKo1sHk7FM1B8Xi1JnT3DvJbG9Xv7VeLZ",
url: "https://google.com",
sid: "1922",
app: "Updated Name",
image: "",
blockchain: "ETH_TEST_GOERLI",
notification: { body: "test", title: "Updated Name - test" },
secret: "",
},
{
cta: "",
title: "test",
message: "test",
icon: "https://gateway.ipfs.io/ipfs/bafybeib76bmkscu6efwawi2tkltdgthwrpny2ok7lur7nltffgydiq7ruy/QmVaY4HQaorrMhKo1sHk7FM1B8Xi1JnT3DvJbG9Xv7VeLZ",
url: "https://google.com",
sid: "1435",
app: "Updated Name",
image: "",
blockchain: "ETH_TEST_GOERLI",
notification: { body: "test", title: "Updated Name - test" },
secret: "",
},
{
cta: "",
title: "test",
message: "test",
icon: "https://gateway.ipfs.io/ipfs/bafybeib76bmkscu6efwawi2tkltdgthwrpny2ok7lur7nltffgydiq7ruy/QmVaY4HQaorrMhKo1sHk7FM1B8Xi1JnT3DvJbG9Xv7VeLZ",
url: "https://google.com",
sid: "1432",
app: "Updated Name",
image: "",
blockchain: "ETH_TEST_GOERLI",
notification: { body: "test", title: "Updated Name - test" },
secret: "",
},
];