This integration involves using RapidPro for messaging reminders to clients either through campaigns or direct messages from OpenSRP. e.g When a pregnancy surveillance form is submitted and the woman involved has a phonenumber, a new contact is created in RapidPro for the woman and the woman enrolled in the Pregant Women group. Once the woman is added to the pregnant women group, she's enrolled into an ANC campaign whereby she receives SMS reminders through her mobile phone to remind her about ANC visits when due. This integration is supported by the functionality at org.opensrp.connector.rapidpro.RapidProService in the opensrp-connector module. The table below highlights the main methods in the class.
Method | Notes |
---|---|
sendMessage | This method sends messages through RapidPro to the specified contacts. The method has the following params:
Either of urns, contacts or groups is required since they contain the message recipient(s). This method makes a POST request against Rapidpro /api/v1/broadcasts.json end point and returns a JSON string with the sent message details e.g { "id": 1234, "urns": ["tel:+250788123123", "tel:+250788123124"], "contacts": ["09d23a05-47fe-11e4-bfe9-b8f6b119e9ab"] "groups": [], "text": "hello world", "created_on": "2013-03-02T17:28:12", "status": "Q" }
|
createContact | This method creates a contact in RapidPro and accepts a java.util.Map param. |
addField | |
deleteContact | |
NB: To be able to use RapidPro within OpenSRP update opensrp.properties the property rapidpro.url with your RapidPro server installation url, rapidpro.token with the your RapidPro REST API authentication token
Add Comment