Skip to main content

Message History

Get history messages

Request

GET /api/messages/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
topicstringYestopic id
sizeintYessize
pageintYespage
timestampintYestimestamp milliseconds
web3mq_signaturestringYesuse ed25519 base64 encode signature see signing detail

signature signing rule

base64 encode signature

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

url query params

{
"userid": "your userid",
"web3mq_signature": "web3mq_signature",
"timestamp": 1656991509327,
"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 user id
-from_signintYesfrom signature
-topicstringYestopic
-message_statusobjectYesmessage status
-cipher_suitestringYescipher suite
-payload_typestringYespayload_type
-pyaloadstringYespayload base64 encode content
-timestampintYestimestamp

message status

  • received (server received)
  • delivered (target user received)
  • read (target user read)
{
"code": 0,
"msg": "ok",
"data": {
"total": 35,
"result": [
{
"cipher_suite": "NONE",
"from": "user:1ac51cff3495beac8f47927ddc719c2de3d08ee3b30f97c7ecd27b77",
"topic": "user:850b1e20abfce1e514659650834380f584e21c0b03fac89847fa86c6",
"from_sign": "fromSign",
"messageid": "f8661568f943eff85362075d4e2f15ae261cb169740f257f1a743cdc",
"payload_type": "text/plain; charset=utf-8",
"timestamp": 1656583297872,
"message_status": {
"status": "read",
"timestamp": 1656583392872
},
"payload": "aGVsbG8gd2ViM21x",
"version": 1
}
]
}
}