Add Message

Last Updated on : 2022-01-24 10:16:39

Send a new message to the specified recipients.

API address

POST: /v1.0/sdf/notifications/messages

Request parameter

Description of body

Parameter nameTypeINRequiredDescription
message_categoryString trueThe message category. Valid values:
  • PLATFORM: platform.
  • MICRO_APP: micro-application.
message_typeString trueThe message type. Valid values:
  • 1: device alerts.
  • 3: device offline.
  • 4: user role change.
message_sub_typeString trueThe custom message sub-type. Valid values:
  • 30 to 49: sub-types of device alerts.
  • 50 to 69: sub-types of system notifications.
  • 70 to 89: sub-types of business messages.
recipient_idsList trueThe list of recipient IDs. Maximum value: 50.
send_modesList trueThe sending mode. It cannot be the same as send_type.

Description of send_modes

Parameter nameTypeINRequiredDescription
send_typeString trueThe sending type. Valid values:
  • WEB_PUSH: web push.
message_contentString trueThe message content, limited to 500 characters.
message_titleString trueThe message title, limited to 100 characters.

Return parameter

Parameter nameTypeDescription
resultBooleanThe response result. Valid values:
  • true: success.
  • false: failure.

Request example

POST: /v1.0/sdf/notifications/messages

Return example

{
    "result": true,
    "t": 1637563727813,
    "success": true
}

Error code

For more information, see error code.