Sending Messages to Subscribers

Request Address: http://{url}/platform/api/v1/messages/create Request Method: POST

Parameters:

  • sender: String, the sender's NFT domain name bound to the project

  • recv_group: String, the recipient's group name

  • receivers: List of Strings, the list of recipients

  • type: Integer, message type, using 2 for message type in this case

  • subject: String, the subject of the message

  • content: String, the content of the message

  • belongs_to_id: Integer, the project ID of the sender

Request Example:

--location --request POST 'http://{url}/platform/api/v1/messages/create' \
--header 'client_id: 10425'
--header 'client_secret: xxxxxxxxxxxx'
--header 'Content-Type: application/json'
--data-raw '{
    "sender": "xxxx",
    "recv_group": "xxx",        // Recipient's group name
    "receivers": ["", "", ...]  // List of recipients
    "type": 2                   // Message type
    "subject": "xxx",           // Subject
    "content": "xxxxxxx"        // Content
    "belongs_to_id": 10010      // Project ID
}'

Correct Response:
{
    "code": 1,
    "data": {},
    "msg": "Process success",
    "success": true
}

Incorrect Response:
{
    "code": 0,
    "data": {},
    "msg": "Process failed",
    "success": false
}

Last updated