You can transfer contacts from your current CRM to Chatfuel. It’s useful when you want to sync your marketing activities with automated messaging.
For example, you can sync phone numbers from your CRM to Chatfuel and then automatically send a broadcast 🡽 to each new contact.
API request
Use this POST request to sync contacts from your CRM to Chatfuel.
htmlhttps://panel.chatfuel.com/api/contacts/{automation_id}/whatsapp/
You’ll need <automation_id> and API token. Both are required. This is what they look like:
Parameter | Example value |
{automation_id} | 62ed0d816esd77079f07db49 |
API token | u9A49DLBrABP2okJybkoYNjmwks26PnKhYP1hZMF1yZfKkIHXQ2zv5I41loZ1TKR |
How to get API token
1. Open
Settings
➜ API
.2. Click
Copy API key
to get your API token.How to get your automation_id
Get your
{automation_id}
from the address bar of your browser. Simply open your automation and copy the ID from the URL.
How to use your API token
Add your API token in the Authorization header of your request:
jsonAuthorization: Bearer {your_api_token}
Example:
plain textAuthorization: Bearer u9A49DLBrABP2okJybkoYNjmwks26PnKhYP1hZMF1yZfKkIHXQ2zv5I41loZ1TKR
Payload
This is what your payload structure looks like:
phones – List of phone numbers with country codes. Maximum 1,000 numbers per request.
contact_dataproperties – Properties that will be assigned to all imported contacts. All contacts in the request will receive the same properties.
json{ "phones": ["+1234567890", "+0987654321"], "contact_data": { "properties": { "pricingPlan": "business", "subscribed": "true" } } }
Here is an example payload that imports 3 contacts and assigns them business pricing plan, subscription status, and source tracking:
json{ "phones": ["+14154449977", "+15551234567", "+16047891234"], "contact_data": { "properties": { "pricingPlan": "business", "subscribed": "true", "source": "crm_import" } } }
How to trigger broadcasts
1. Open
AI & Automation
.2. Create a new WhatsApp flow.
3. Add
message upon trigger
broadcast.4. Add a property from your payload (e.g. subscribed). And set the Trigger to
After property is changed
.Done. Now, all the imported contacts with that property will be automatically added to the Message upon trigger.