rapidpro@1.0.8
Functionsβ
- addContact(params, callback)
- sendBroadcast(params, callback)
- startFlow(params, callback)
- upsertContact(params, callback)
addContactβ
addContact(params, callback) β Operation
Adds a new contact to RapidPro
Kind: global function
Access: public
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
Kind: global function
Access: public
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
Kind: global function
Access: public
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
Kind: global function
Access: public
Param | Type | Description |
---|---|---|
params | object | data to upsert a contact |
callback | function | (Optional) callback function |
Example
upsertContact({
name: "Mamadou",
language: "ENG",
urns: ["tel:+250788123123"]
});