Skip to main content

BroadcastMessage

Workflow#

  1. Backed by the $template_id and additional parameters, the backend system calls the 'BroadcastMessage' operation.
  2. BD review the broadcast message request
  3. Once the BD approve the broadcast message request, open service will forward the message to the users.

Refer to the documentation for all required APIs.

Requirements:

Binance APP version >= 2.82.0

SDK version >= 4.0.0

Preparation#

Please refer to Preparation Of Open Service

Backend#

BroadcastMessage#

Host: dip-cb.binanceapi.com

POST /mp-api/v1/apps/{appId}/message/broadcast

Parameters

ParameterDescription
appIdrequired The AppId of the mini program.
templateIdrequired The templateId of the template.
languagerequired The language of the message.
pathoptional Pages path when user clicks the message. By default, it is the path to the entry page.
parametersrequired Arrays of parameters to the template. Format is [{"name":string, "value":string}].
previewoption bool, The default is false. If it is true, it will only be sent to the users specified in experienceUids.
experienceUidsoption bool Array\<String> The default is an empty array, used to set the user collection for previewing broadcast messages. Supports up to 5 uids.

Note:

  1. You need to carry a JWT token in the X-Mp-Open-Api-Token header when you call this API. For generating the JWT token, please refer to Description of External Interface Signature Authentication Algorithm. 2 We support previewing broadcast messages. You only need to set the preview field to true, and specify the experience user uid set (up to 5) in experienceUids to preview the format of the message.

Request

​​{  "appId": "your-app-id-can-get-from-workspace",  "templateId": "1344****",  "language": "en",  "path": "pages/details/index?source=***",  "parameters": [       {           "name": "result",           "value": "success"       },       {           "name": "withdrawMoney",           "value": "100"       }   ],   "preview":true,   "experienceUids":["123"]}

Response

HTTP 200

{  "code": "000000",  "message": null,  "data": {    "statusCode": "000000"  },  "success": true}

Code

ErrorCodeRemark
000000Success
900001Invalid Parameter
900002JWT Authentication Failed
900003Unexpected Error
900231Rate Limit

statusCode

statusCodeRemark
000000Success
900240The user has refused to receive all messages from the mini-program
900241The user has declined to receive the message corresponding to the mini-program template
  • Workflow
  • Preparation
  • Backend
    • BroadcastMessage