rapidpro@1.1.5
- addContact(params, callback)
- sendBroadcast(params, callback)
- startFlow(params, callback)
- upsertContact(params, callback)
Functions
addContact
addContact(params, callback) ⇒ Operation
Adds a new contact to RapidPro
Param | Type | Description |
---|---|---|
params | object | data to create the new resource |
callback | function | (Optional) callback function |
Example
addContact({
name: "Mamadou",
language: "ENG",
urns: ["tel:+250788123123"]
});
sendBroadcast
sendBroadcast(params, callback) ⇒ Operation
Sends a message to a list of contacts and/or URNs
Param | Type | Description |
---|---|---|
params | object | data to create the new resource |
callback | function | (Optional) callback function |
Example
sendBroadcast({
text: "Hello world",
urns: ["twitter:sirmixalot"],
contacts: ["a052b00c-15b3-48e6-9771-edbaa277a353"]
});
startFlow
startFlow(params, callback) ⇒ Operation
Start a RapidPro flow for a number of contacts
Param | Type | Description |
---|---|---|
params | object | data to create the new resource |
callback | function | (Optional) callback function |
Example
startFlow({
flow: "f5901b62-ba76-4003-9c62-72fdacc1b7b7",
restart_participants: false,
contacts: ["a052b00c-15b3-48e6-9771-edbaa277a353"]
});
upsertContact
upsertContact(params, callback) ⇒ Operation
Upserts a contact to RapidPro by URN
Param | Type | Description |
---|---|---|
params | object | data to upsert a contact |
callback | function | (Optional) callback function |
Example
upsertContact({
name: "Mamadou",
language: "ENG",
urns: ["tel:+250788123123"]
});