Using Clickatell SMS Gateway might not currently work... here is the fix


We have been doing some tests lately regarding the Mobile configuration and if you are using Clickatell as your SMS Gateway you might have found out that it is currently not working while sending SMS.

This will get fixed in the near future, however, if you are suffering from this and you still need to send SMS out of your DHIS2 server here is the work around that involves modifying something on your Gateway settings via the API.

  1. Access with an admin account to your DHIS 2 server and go to mobile configuration, add a new Generic gateway (no Clickatell but generic) with the following values


  • Gateway name can be whatever you want
  • Message (content), recipient (to) and URL ( Template must be exactly like shown above
  • add a new value called apiKey and add the apiKey that you get from Clicaktell

Save and back!

  1. Now we mark this gateway as default by clicking on the icon

  2. That’s all the things that we need to do by using the DHIS 2 UI, now comes the API calls.

  3. Get the list of gateways from your server by performing the API call which will display one or two gateways like here:

There you will need to get the UID of the gateway that you have created, in this case: AktsSssO1M

  1. Perform an API call to only that gateway which will display the JSON values

This is the text that you need to copy and modify. Here I have already fixed but what it is important is to make sure that the useGet is set to true (in your server will say false )

  1. Perform an update on the gateway via an API call with your program of choice, I am doing it here with CURL in my terminal

jaime@WeatherLight:~$ curl -X PUT -H “Content-Type: application/json” -u admin:district “” -d ‘{“uid”:“AktsSssO1M”,“name”:“Clickatell as generic”,“urlTemplate”:"",“messageParameter”:“content”,“recipientParameter”:“to”,“useGet”:true,“parameters”:[{“header”:false,“key”:“apiKey”,“value”:" XXXXXXXXXXXXXXXXXXXXXXX ",“classified”:false}],“isDefault”:true}’

Note, if you get a response saying something like “a default gateway already exists” modify the last key/value to “isDefault”:false and then via the DHIS 2 Mobile configuration make it default gateway.

Once this is done you can go to the Send SMS in the Mobile configuration and test it


And on your logs you should see the following:

  • INFO 2020-04-02 10:15:50,997 [Level: INFO, category: SMS_SEND, time: Thu Apr 02 10:15:50 GMT 2020, message: Sending SMS] ( [taskScheduler-20])
  • INFO 2020-04-02 10:15:51,000 Sending SMS to [34659138936] ( [taskScheduler-20])
  • INFO 2020-04-02 10:15:51,257 SMS sent ( [taskScheduler-20])
  • INFO 2020-04-02 10:15:51,258 [Level: INFO, category: SMS_SEND, time: Thu Apr 02 10:15:51 GMT 2020, message: Message sending successful] ( [taskScheduler-20])
  • INFO 2020-04-02 10:15:51,259 ‘system-process’ create org.hisp.dhis.sms.outbound.OutboundSms ( [taskScheduler-20])
1 Like