Send Message to Digital Passport
Communicate with a digital passport owner through decentralized messages.
Before you begin
As a brand, you want to send a message to your hoodie owner. To do so, you will communicate through the associated digital passport.
Use case examples:
- 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.
- To send a message to a digital passport for which you are not the issuer, your brand must have whitelisted wallet address. Different options:
- Your customers have already accepted of your event.
- If your brand has been explicitly whitelisted by another.
- When you send messages to an digital passport ID list, if your customers have more than one token, they will receive this message based on the number of tokens they have.
- Each message sent per digital passport spends 1 credit.
Let's start 🚀
Send a decentralized message
Step 1. Write your message to fill in the Json Schema. In that case:
[
{
"certificateId": 123456789000,
"content": {
"$schema": "https://cert.arianee.org/version1/ArianeeMessage-i18n.json",
"title": "Expand your collection with the Puppy collection!",
"content":"Are you a big fan of our other four-legged friends? Are you a cat or dog lover? Both? Just in time, we are launching the Puppy collection on our store with a wide range of colours!",
"pictures":
[{"mediaType":
"picture",
"type":"product",
"url":"https://documentation.arianee.com/pub/1670419418865-1632234657561-ROSE_BLEU_EMERAUDE_PURPLE.jpeg"
}]
}
}
]
Step 2. To create and store a message on the RPC server, use the api/createAndStoreMessage
.
The API is authenticated with the user rights required →
messageSend
Input | Mandatory | Type | Description |
---|---|---|---|
certificateId | ✅ | String | Recipient digital passport identification number. |
content | ✅ | Object | Collection of the message content. |
Result: Congrats! You just sent your message. The digital passport owner has received a notification and can get access to the message in the wallet.
{
"message": "Not yet in blockchain => transaction saved in transaction manager",
"type": "transactionManager",
"nonce": 140071,
"chainId": 77,
"from": "0x57F5111A7e997a7Ba63CC8976C92decbd86C1B08",
"data": "0x9452d6000000000000000000000000000000000000000000000000000000000024a5ba810000000000000000000000000000000000000000000000000000000000b09a8e35120f07fa4c5a2de333a50c9ef9fad68b4c93e0b117dabc73ec997d8248de60000000000000000000000000a79b29ad7e0196c95b87f4663ded82fbf2e3add8",
"to": "0x5360DbFF3546b920431A20268D2B5DFf8bF9b4dD",
"gasLimit": 500000,
"gasPrice": "48000000000",
"value": "0x00",
"readableTransaction": {
"contractName": "store",
"from": "0x57F5111A7e997a7Ba63CC8976C92decbd86C1B08",
"to": "0x5360DbFF3546b920431A20268D2B5DFf8bF9b4dD",
"constant": false,
"inputs": [
{
"name": "_messageId",
"type": "uint256"
},
{
"name": "_tokenId",
"type": "uint256"
},
{
"name": "_imprint",
"type": "bytes32"
},
{
"name": "_providerBrand",
"type": "address"
}
],
"name": "createMessage",
"outputs": [],
"payable": false,
"stateMutability": "nonpayable",
"type": "function",
"signature": "0x9452d600",
"arguments": [
{
"value": 614840961,
"name": "_messageId"
},
{
"value": 11573902,
"name": "_tokenId"
},
{
"value": "0x35120f07fa4c5a2de333a50c9ef9fad68b4c93e0b117dabc73ec997d8248de60",
"name": "_imprint"
},
{
"value": "0xA79B29AD7e0196C95B87f4663ded82Fbf2E3ADD8",
"name": "_providerBrand"
}
]
},
"contentImprint": "0x35120f07fa4c5a2de333a50c9ef9fad68b4c93e0b117dabc73ec997d8248de60",
"messageId": 614840961
}
Message in Arianee's wallet app
Check if a message is read/unread
Use the api/isMessageRead
with the messageId
in your request body.
[
"614840961"
]
Result: Boolean return.
true
- Message read.false
- message unread.
Updated 2 months ago