[OLD] Send Message to Digital Passports Group
As a brand, you wish to send a dMessage to digital passports in a given group, so all your digital passport owners receive it.
Overview
Use cases
- Your brand wants to provide useful information about your product or the brand community around the product.
- Your brand wants to invite digital passport owners to exclusive events or online experiences.
- You wish to greet new owners in case of digital passport transfers.
Workflow
![](https://files.readme.io/f3bccae-PM_API_3_-_Send_Message.png)
Let's start 🚀
Each message sent spends 1 credit.
URL
To send a message to a complete productGroupId
, use /productManagement/productGroup/:productGroupId/sendMessage
.
POST - https://{{nmpUrl}}/productManagement/productGroup/:productGroupId/sendMessage
Body
Field | Type | Required | Description |
---|---|---|---|
campaignName | String | ❌ | Name of the campaign. |
content | Object | ✅ | Content of the message. |
filters | Object | ❌ | Filters to target message recipients. |
productIds | Object | ❌ | List of product IDs to send message to (if match wallet profile). It should not be used with a large array. |
tags | Array | ❌ | Tags associated with the target digital passports. |
tagRule | and ,or ,all | ❌ | If you search for one tag, leave the parameter empty. |
countries | Array | ❌ | ”USA”, “France”... Fetch the countries using the dedicated API. |
isCustodial | Boolean | ❌ | Whether the user has a custodial wallet or not. |
iswalletActiveSinceNumberOfDays | Number | ❌ | Number of days since wallet activity. |
active | Boolean | ❌ | Whether the user has been active last X days. |
uniqueOwner | Boolean | ❌ | Unique owner. |
walletActivity | active ,inactive ,all | ❌ | - active : Active end-users only.- inactive : Inactive end-users only.- all : All end-users. |
{
"campaignName": "name1",
"message": {
"title": "Title",
"content": "This is the message content"
},
"filters": {
"productIds": ["SN1"],
"tags": ["tag1"],
"tagRule": "all",
"countries": ["France", "USA"],
"iswalletActiveSinceNumberOfDays": 30,
"uniqueOwner": true,
"walletActivity": "active"
}
}
Return Payload
Field | Type | Description |
---|---|---|
success | Boolean | true : The request was a success. |
message | String | Message has been successfully sent to productId . |
approximativeNumberOfMessages | Number | Number of messages sent. |
{
"success": true,
"message": "The message campaign has been scheduled and will be sent soon.",
"approximativeNumberOfMessages": 1
}
Errors
Status Code | Success | Code | Error Message |
---|---|---|---|
400 | false | npm.productManager.product.message.incorrectPayload | Some parameters of your payload are incorrect. See details. |
400 | false | npm.productManager.product.message.notIssuer | You cannot send a message to NFT you have not created. |
400 | false | npm.productManager.product.message.blacklisted | You cannot send a message to NFT that does not accept incoming messages. |
404 | false | npm.productManager.product.message.product_group_Id_Not_Exists | ProductGroup ID does not exist. |
500 | false | npm.productManagement.product.UnknownError | An unknown error has occurred. |
{
"message": "productGroupId :productGroupId does not exists",
"code": "nmp.productManagement.PRODUCT_GROUP_ID_NOT_EXISTS"
}
Updated 3 months ago