Broadcasting API allows you to send any block or flow from your bot via a POST API request. It also allows you to send blocks to users with certain attributes.

Here’s an example of a typical request:

https://api.chatfuel.com/bots/<BOT_ID>/users/<USER_ID>/send?chatfuel_token=<TOKEN>&chatfuel_flow_name=<FLOW_NAME>&<USER_ATTRIBUTE_1>=<VALUE_1>&<USER_ATTRIBUTE_2>=<VALUE_2>

With all the data filled in, your request should look something like this:

https://api.chatfuel.com/bots/612899e1a6ec6f5e0f2fe556/users/5949225915148689/send?chatfuel_token=jPvO73OSpKfQD9hwEb6EnrdgUwAHKQVEHHsNA25IbXEcVLA68myGXzjdXODaGhyS&chatfuel_block_id=63809fc68e17052f16c3ca01

Parameters and values

There are two types of parameters: required and optional. There are also two required URL values. Make sure to include all of the required parameters and URL values in your requests. Choose to add or not to add optional parameters.

Required parameters

Every request must contain chatfuel_token and one of the following parameters: chatfuel_flow_name, chatfuel_block_name or chatfuel_block_id.

Required URL values

There are two required values you must include in the request URL: <BOT_ID> and <USER_ID>.

Optional parameters

There are two optional parameters: chatfuel_message_tag and <USER_ATTRIBUTE>=<VALUE>.

Available parameters and values

Parameter

Description

Type

chatfuel_token

A unique token given to each bot.

Required.

<BOT_ID>

ID of your bot.

Required.

<USER_ID>

ID of a user you want to send the message to.

Required.

chatfuel_flow_name

Name of your flow.

Required, if there’s no chatfuel_block_name or chatfuel_block_id parameter.

chatfuel_block_name

Name of your block.

Required, if there’s no chatfuel_flow_name or chatfuel_block_id parameter.

chatfuel_block_id

ID of your block or flow.

Required, if there’s no chatfuel_block_name or chatfuel_flow_name parameter.

chatfuel_message_tag

A tag that lets you send messages to a user outside of the 24h window. Full list of Message Tags.

Optional.

<USER ATTRIBUTE>

Name and value of a user attribute you want to set for a user. For example, <CUSTOMERTYPE>=<NEW>

Optional.

How to get Chatfuel token

  1. Go to Configure tab.

  2. Click on the token to copy it.

chatfuel-token-optimized.gif

How to get a bot ID

A bot ID is a unique combination of numbers and letters. It looks like this: 612899e1a6ec6f5e0f2fe556. To get a bot ID:

  1. Open Chatfuel dashboard.

  2. Click on the address bar in your browser.

  3. Copy your bot ID.

chatfuel-bot-id.gif

How to get a user ID

There are two types of IDs you can use for the <USER_ID> URL value: user id or chatfuel user id. The easiest way to get them is to look them up in the People tab.

  1. Open People tab.

  2. Click on your name in the list.

  3. Find and copy either a user id or chatfuel user id.

chatfuel-user-id-optimized.gif

How to get a block, flow ID

A block or a flow ID looks similar to a bot ID: 61fbd2f0a2d3e66f2ed59de7.

  1. Open your Flows or Blocks.

  2. Open your block or flow.

  3. Click on the address bar in your browser.

  4. Copy your block or flow ID.

chatfuel-flow-id.gif

Rules

📌 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.

Did this answer your question?