In 2.31.9, when configuring the SMS gateway the following parameters were available: Message Parameter=content and Recipient Parameter=to_number. In 2.34.3 to the latest version of DHIS2 doesn’t have those parameters. Please what is the way of configuring SMS gateway on 2.34.3? Because it is saying sent but I am not receiving the SMS on my phone. I am getting this error on the SMS gateway log:
URL template includes the gateway but the rest of the parameters should be included in the configuration template, in the previous version there was the message parameter here you have to encode that like (message=${text}) and receiver=${recipients}. here is the link for the API SMS configuration.
embed the parameters in Configuration template like provider you did.
configuration Template: content=${text}&to_number=${recipients}&provider=rapidpro&secret=secret
don’t include any key-value pair as a parameter embed them in the query string.
Hi Majtaba,
I already did as you suggested:
configuration Template: content=${text}&to_number=${recipients}&provider=rapidpro&secret=secret but the SMS is still FAILED. On the SMS gateway I
Did you put whatever is expected in the provider=providerExpectedName and secret=whateverIsTheSecret. are you able to check what hits their server like what parameters are missing.
Dear Mujtaba,
I change the secret to my secret. I can’t see any parameter on the SMS server; it only send out an information about json which was attached on the previous message and DHIS2 under view send message it FAILED
Finally, find the solution for 2.34.3
Gateway Name: ANY_NAME
URL Template: https://SMS_GATEWAY_LINK?content={text}&to_number={recipients}&provider=provider_name&secret=XXXXXX
configurationTemplate: This should be blank
contentType: text/plain
So in our new versions, are we supposed to pass our API Keys, Passwords, Secrets, etc directly into the query string of the configurationTemplate instead of using the parameters and “sendURLParameters” checkbox?
I could not get the parameters to pass into the query string.
Why don’t you try to use APPLICATION_JSON instead of FORM_URL_ENCODED? You’ll change somethings but I don’t think you’ll face difficulty with variables once you use the parameters in that format. Have you seen this sample JSON payload? SMS - DHIS2 Documentation
Yes, I saw the payload, my service provider expects a GET request with this format https://portal.websprix.com/sendsms.php?id=myid&pass=*****&to=09122807836&txt=hrt
so, back to FORM_URL_ENCODED, but what am I doing wrong with the variable ? anything you see wrong?
On the UI, the message and recipient fields are blank: