API allows you to send any block or flow from via a POST API request. It also allows you to send blocks to contacts with specific properties.
Here's an example of a typical request:
javascripthttps://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:
javascripthttps://api.chatfuel.com/bots/612899e1a6ec6f5e0f2fe556/users/5949225915148689/send?chatfuel_token=jPvO73OSpKfQD9hwEb6EnrdgUwAHKQVEHHsNA25IbXEcVLA68myGXzjdXODaGhyS&chatfuel_block_id=63809fc68e17052f16c3ca01
Parameters and values
Required
Parameters:
chatfuel_token
- One of these routing parameters:
chatfuel_flow_name
chatfuel_block_name
chatfuel_block_id
URL values:
<BOT_ID>
<USER_ID>
Optional
You can add these to customize your request:
chatfuel_message_tag
- Allows sending messages outside the 24 hour window 🡽
<USER_ATTRIBUTE>=<VALUE>
- Sets custom user properties
List of available parameters and values
Parameter | Description | Type |
chatfuel_token | Unique token for your company | Required |
<BOT_ID> | Your company ID | Required |
<USER_ID> | ID of a contact you want to message | Required |
chatfuel_flow_name | Name of your flow | Required* |
chatfuel_block_name | Name of your block | Required* |
chatfuel_block_id | ID of your block or flow | Required* |
chatfuel_message_tag | Tag for sending messages ouside the 24 hour window 🡽 | Optional |
<USER ATTRIBUTE> | Name and value of a contact property (Example: customertype=new ) | Optional |
tags | List of tags to set for a contact (Example: tags=Helen,female,new_customer ).
New tags will replace existing ones. | Optional |
* You must include one of these three routing parameters in your request:
chatfuel_flow_name
, chatfuel_block_name
, or chatfuel_block_id
How to get Chatfuel token
- Go to
Settings
➜API
.
Copy API key
to copy your token.
If you need a new token, click
Reset
.How to get company ID
A company ID is a unique combination of numbers and letters. It looks like this: 612899e1a6ec6f5e0f2fe556. To get it:
- Open
AI & Automation
.
- Click on the address bar in your browser.
- Copy your company ID.
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.
- Open
Live chat
.
- Click on your name in the list.
- Find and copy either a user id or chatfuel user id.
How to get ID for block or flow
A block or a flow ID looks similar to a company ID: 61fbd2f0a2d3e66f2ed59de7.
- Open
AI & Automation
.
- Open your flow.
- Click on the address bar in your browser.
- Copy your flow ID.
For blocks:
- Choose your block.
- Copy the ID next to the flow ID.
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 use