CHT Applications > Reference > app_settings.json > .sms
SMS Settings: Instructions and schema for defining SMS settings
As of v3.6.0, SMS messages can be sent and received using the Africa’s Talking service.
First generate a long unique key to use as the cht-api-key
.
Log on to the Africa’s Talking Dashboard and configure your callback URLs as follows.
https://<hostname>/api/v1/sms/africastalking/delivery-reports?key=<cht-api-key>
https://<hostname>/api/v1/sms/africastalking/incoming-messages?key=<cht-api-key>
Then generate an “API Key” (we’ll refer to this as the at-api-key
) and save this in your CHT Core configuration covered below.
The API keys should be treated as securely as a password as anyone with access to them will be able to send messages using your account. Therefore we store them in the CouchDB configuration.
To add the credentials to the admin config you need to either PUT the value using curl or similar:
curl -X PUT https://<user>:<pass>@<domain>/_node/couchdb@127.0.0.1/_config/medic-credentials/africastalking.com:incoming -d '"<cht-api-key>"'
curl -X PUT https://<user>:<pass>@<domain>/_node/couchdb@127.0.0.1/_config/medic-credentials/africastalking.com:outgoing -d '"<at-api-key>"'
couchdb@127.0.0.1
is the local node name, and may be different for you depending on your setup.You can also add it via Fauxton:
Add Option
Section
should be medic-credentials
, the Name
should be africastalking.com:incoming
or africastalking.com:outgoing
, and the value should be the relevant API key.Create
Update your app settings as follows.
{
"sms": {
"outgoing_service": "africas-talking",
"reply_to": "<africa's talking shortcode>",
"africas_talking": {
"username": "<africa's talking username>"
}
}
}
To test your integration, set your “username” to “sandbox”, log in to Africa’s Talking, and go to the Sandbox app.
SMS Settings: Instructions and schema for defining SMS settings
Trigger calls and SMS from within the form, or send an SMS once submitted.
Overview of the possible states of SMS messages
How to avoid messaging loops
Configuring shortcodes for SMS messaging
Was this page helpful?
Glad to hear it! Please tell us how we can improve.
Sorry to hear that. Please tell us how we can improve.