mokiService_getInbox
Info
This function requires the
Authorization
Header, you can read more about this header here.Fetch a list of messages in the users inbox
Parameters
inboxFilter
: object [Required] - Filter object for inbox datalimit
: number - Defaults to 20after
: messageId - Fetch messages after given MessageIDbefore
: messageId - Fetch messages before given MessageID
Returns
payload
: object [Required] - Payload as an objectaddress
: address - Address of inbox ownerdata
: array - Array of messages from inboxmessage
: object - Message objectid
: string - Message unique IDmessage
: string - Encrypted message as hexfrom
: address - Address of senderto
: address - Address of recipientsignature
: string - Message signature from sendersender_receipt
: hex - Receipt from sender service nodereceiver_receipt
: hex - Receipt from receiver service nodetimestamp
: number - Timestamp of messageend
: boolean - True if results reaches the end of the search
Example
Request
- curl
- javascript
curl https://mainnet.moki.network \
-X POST \
-H "Content-Type: application/json" \
-d '{"jsonrpc": "2.0", "method": "mokiService_getInbox", "params": [], "id": 1}'
import fetch from "node-fetch"
fetch("https://mainnet.moki.network", {
method: "POST",
headers: {
"Content-Type": "application/json",
},
body: JSON.stringify({
jsonrpc: "2.0",
method: "mokiService_getInbox",
params: [],
id: 1,
}),
})
.then((response) => response.json())
.then((data) => {
console.log(data)
})
.catch((error) => {
console.error(error)
})
Reponse
Example Response
{
"jsonrpc": "2.0",
"id": 1,
"result": [
{
"address": "0x22a4dc6353e087A5c37c7168bCF149e9342eB922",
"data": [
{
"message": "0e93eee849d168...",
"from": "0xd980f6b9ba3223711989639664ffb26c75ecc50b",
"to": "0x22a4dc6353e087a5c37c7168bcf149e9342eb922",
"signature": "0xb7edb74193d54...",
"sender_receipt": "0xe80e5e4ccd1...",
"receiver_receipt": "0x450e5e4ccd1...",
"timestamp": 1753944225115,
"id": "17539442251150027127416"
},
{
"message": "2863b7fa05d337...",
"from": "0x7085aa6e71f325ed88d04daba003020bfd9214ea",
"to": "0x22a4dc6353e087a5c37c7168bcf149e9342eb922",
"signature": "0xb7edb74193d54...",
"sender_receipt": "0xe80e5e4ccd1...",
"receiver_receipt": "0x450e5e4ccd1...",
"timestamp": 1753944245286,
"id": "17539442452862540956057"
}
],
"end": true
}
]
}