Broadcasting API
Last updated
Last updated
The Broadcasting API enables you to send any block from the bot’s structure or set user attributes via an API call.
All queries to the Broadcasting API must be served via POST, with the content type application/json and need to be presented in this form:
<TOKEN> — A unique secret token obtained for each bot. You are able to find and reset the token in Configure tab of the dashboard at any time.
<USER_ID> — {{messenger user id}} attribute that you should get from a JSON plugin call prior to sending a message. {{messenger user id}} and {{fb_id}} are accepted as well.
<BOT_ID> — ID of the bot you want to send the message from.
<BLOCK_NAME> [optional] — URL-encoded name of the block you want to send to a user. You can also use <BLOCK_ID> — ID of the block you want to send to a user, instead.
<USER_ATTRIBUTE>=<VALUE> [optional] — Name and value of a user attribute you want to set up before rendering the block.
messaging_tag
— You can use 1 of the following tags: "CONFIRMED_EVENT_UPDATE"
" CONFIRMED_EVENT_UPDATE"
"POST_PURCHASE_UPDATE"
"ACCOUNT_UPDATE"
The response contains a JSON object, which always has a Boolean field success and may have an optional String field result with a human-readable description of the result. If success equals true, the request was successful. In the case of an unsuccessful request, success equals false and the error is explained in the result field. Note:
You can send up to 25 RPS per bot to the Broadcasting API.
All parameters starting with chatfuel_ are reserved and should not be used.