Skip to main content

Notification History

Get history Notification

GET /api/notification/history/

Request Headers

fieldRequiredheaders Descriptionexample
web3mq-request-pubkeyYesyour login keyapir's public key59daabd77706ba02a97c523513a2ceaed10e4275bd6
didkeyYesyour did_type + ":" + did_valueeth:0xa1b1233fdfde

Request Payload

Parameters in URLTypeRequiredParameters Description
useridstringYesuserid
topicstringNotopic
notice_typestringNonotice_type
sizeintYessize
pageintYespage
timestampintYestimestamp milliseconds
web3mq_signaturestringYesuse ed25519 base64 encode web3mq_signature see signing detail

web3mq_signature signing rule_

base64 encode web3mq_signature

if notice_type not empty

web3mq_signature = ed25519 private key signing(userid + notice_type + timestamp)

else if topic not empty

web3mq_signature = ed25519 private key signing(userid + topic + timestamp)

else

web3mq_signature = ed25519 private key signing(userid + timestamp)

url query params

  • notice_type
    • system.friend_request (Friend request notification type)
    • system.agree_friend_request (Agree friend request notification type)
    • system.group_invitation (Group invitation notification type)
    • subscription (subscription topic new message notification)
{
"userid": "your userid",
"web3mq_signature": "web3mq_signature",
"timestamp": 1656991509327,
"notice_type": "system.friend_request",
"size": 20,
"page": 1
}

Response

ParametersTypeAlways ReturnParameters Description
codeintYesresult code, 0 means success, other code see msg's contents
msgstringYesresult description
datadictYesreturn includes response info
-messageidstringYesmessageid
-fromstringYesmessage sender id
-from_signintYesfrom signature
-topicstringYestopic
-cipher_suitestringYescipher suite
-payload_typestringYespayload_type
-pyaloadstringYespayload base64 encode content
-timestampintYestimestamp

payload.type

  • system
    • (system notification include user agree your friend request etc.)
  • subscription
    • (subscription topic new message notification)
{
"code": 0,
"msg": "ok",
"data": {
"total": 35,
"result": [
{
"cipher_suite": "NONE",
"from": "user:1ac51cff3495beac8f47927ddc719c2de3d08ee3b30f97c7ecd27b77",
"topic": "user:850b1e20abfce1e514659650834380f584e21c0b03fac89847fa86c6",
"from_sign": "fromSign",
"messageid": "f8661568f943eff85362075d4e2f15ae261cb169740f257f1a743cdc",
"payload_type": "applicaton/json; charset=utf-8",
"timestamp": 1656583297872,
"payload": {
"title": "notification",
"content": "notification",
"type": "system"
},
"version": 1
}
]
}
}