https://github.com/zachalam/chatfuel-node-api
Broadcast messages to your chatbot users with this unofficial chatfuel api wrapper.
https://github.com/zachalam/chatfuel-node-api
Last synced: 8 months ago
JSON representation
Broadcast messages to your chatbot users with this unofficial chatfuel api wrapper.
- Host: GitHub
- URL: https://github.com/zachalam/chatfuel-node-api
- Owner: zachalam
- Created: 2017-10-15T17:27:07.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2017-10-15T18:43:43.000Z (over 8 years ago)
- Last Synced: 2025-03-08T11:05:45.513Z (over 1 year ago)
- Language: JavaScript
- Size: 1.13 MB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Broadcast Chatfuel Messages (Node)
Broadcast messages to your chatbot users with this unofficial chatfuel api wrapper.
### Installing
```
npm install --save chatfuel-node-api
```
or globally..
```
npm install --g chatfuel-node-api
```
### How To Use
Follow these 3 easy steps to broadcast messages.
Include/Require chatfuel-node-api.
```
var Chatfuel = require("chatfuel-node-api");
```
Create new chatfuel instance.
```
var cf = new Chatfuel(,);
```
Broadcast your message.
```
cf.broadcast({
user_id: ,
block_id: ,
attributes: {var1: true, var2: false, var3: "message"}},
function(body) {
// what to do after..
}
});
```
### Putting it all Together
Here's a final working code snippet. See "how to use" for parameter values.
```
var Chatfuel = require("chatfuel-node-api");
var cf = new Chatfuel(
"mELtlMAHYqR0BvgEiMq8zVek3uYUK3OJMbtyrdNPTrQB9ndV0fM7lWTFZbM4MZvD",
"14c12219re312abgtfd12346q");
cf.broadcast({
user_id: 521412412512,
block_id: 2123,
attributes: {var1: true, var2: false, var3: "message"}},
function(body) {
// what to do after..
}
});
```