Working with messages between contacts using code

Problem description:
We have developed an app that is integrated with RapidPro to send automated messages to clients. We would like the automated messages sent from RapidPro to clients to also appear in the Messages tab. We want them to appear as being sent from the community health volunteer (CHV) to the client. This so that the CHV is able to make sense out of the messaging history.

We explored the following ways of doing this through RapidPro webhooks:

  • POSTing to /api/sms and specifying “from” and “to” properties in the payload. This did not seem to work.
  • Creating an sms_message data record for the contact directly in CouchDB. This worked. However, we noted that since these automated messages will show up as new messages for the CHV, it would create spam and make it difficult to discern these automated messages from actual client interactions.

Where we need help:

  • Alternatives to achieving this that may be easier and less complicated
  • How to mark the sms_message data record as already read so that we avoid spamming the CHV. This in the case that there are no better ways of achieving what we need.
1 Like

Hi @danielmwakanema,

Welcome to the CHT Forum! It’s great to have you here.

sorry for the delay in response. Since, RapidPro is not a project we maintain so not sure but may be it will be more helpful to explore if there has been similar posts in community for RapidPro here to get more prompt response?

Hi @cliff and @kitsao I saw you have previously asked questions related to RapidPro. Do you have any suggestions?

hello @danielmwakanema

you could try

@(json(object(
"id", run.uuid,
"from", replace(urns.tel, "tel:", ""),
"content", "AUTOMATED UPDATE : Client joined NIGHT message group"
)))
2 Likes