Passer au contenu principal

rapidpro@0.5.4

Functions

execute(operations)Operation

Execute a sequence of operations. Wraps language-common/execute, and prepends initial state.

addContact(params, callback)Operation

Adds a new contact to RapidPro

upsertContact(params, callback)Operation

Upserts a contact to RapidPro by URN

startFlow(params, callback)Operation

Start a RapidPro flow for a number of contacts

sendBroadcast(params, callback)Operation

Sends a message to a list of contacts and/or URNs

execute(operations) ⇒ Operation

Execute a sequence of operations. Wraps language-common/execute, and prepends initial state.

Kind: global function

ParamTypeDescription
operationsOperationsOperations to be performed.

Example

execute(
create('foo'),
delete('bar')
)(state)

addContact(params, callback) ⇒ Operation

Adds a new contact to RapidPro

Kind: global function
Access: public

ParamTypeDescription
paramsobjectdata to create the new resource
callbackfunction(Optional) callback function

Example

addContact({
name: "Mamadou",
language: "ENG",
urns: ["tel:+250788123123"]
});

upsertContact(params, callback) ⇒ Operation

Upserts a contact to RapidPro by URN

Kind: global function
Access: public

ParamTypeDescription
paramsobjectdata to upsert a contact
callbackfunction(Optional) callback function

Example

upsertContact({
name: "Mamadou",
language: "ENG",
urns: ["tel:+250788123123"]
});

startFlow(params, callback) ⇒ Operation

Start a RapidPro flow for a number of contacts

Kind: global function
Access: public

ParamTypeDescription
paramsobjectdata to create the new resource
callbackfunction(Optional) callback function

Example

startFlow({
flow: "f5901b62-ba76-4003-9c62-72fdacc1b7b7",
restart_participants: false,
contacts: ["a052b00c-15b3-48e6-9771-edbaa277a353"]
});

sendBroadcast(params, callback) ⇒ Operation

Sends a message to a list of contacts and/or URNs

Kind: global function
Access: public

ParamTypeDescription
paramsobjectdata to create the new resource
callbackfunction(Optional) callback function

Example

sendBroadcast({
text: "Hello world",
urns: ["twitter:sirmixalot"],
contacts: ["a052b00c-15b3-48e6-9771-edbaa277a353"]
});