Generic http SMS Gateway for Inbound & Outbound

Hi all,

Please Is it possible to have ideas on how can be URL template when setting Generic http SMS Gateway in DHIS2 both for inbound and outbound sms?

Thank you

1 Like

Hi Hakim
Can you please re-phrase your question.

Zubair

···

On Wed, 6 Jun 2018, 8:15 am DJIBRIL Hakim, djib.hakim@gmail.com wrote:

Hi all,

Please Is it possible to have ideas on how can be URL template when setting Generic http SMS Gateway in DHIS2 both for inbound and outbound sms?

Thank you


Mailing list: https://launchpad.net/~dhis2-devs

Post to : dhis2-devs@lists.launchpad.net

Unsubscribe : https://launchpad.net/~dhis2-devs

More help : https://help.launchpad.net/ListHelp

Sorry Zubair

I want to setup a generic hhtp sms gateway in dhis2, but in documentation I can’t find exemple or use case doing that.

Some of sms national providers have differentes endpoint for sending or receving sms.

1.So my first question is have an example of URL template doing the both way task

2.if we have differentes endpoint , it is possible to setup 2 gateways and work with them?

  1. My provider ask us to provide our domain url exemple: http://mydomaine/test so they will triggered sms like this

http://mydomaine/test?id111&sc=21000&msisdn=221779998877&key=TEST&msg=messagetest

where

  • id: identifier of the message;
  • sc: short number used;
  • msisdn: telephone number of the subscriber who sent the message;
  • key: keyword used
  • msg: message content

How can we deal with that ?

Thank you

···

2018-06-06 6:24 GMT+00:00 Zubair Asghar Raja zubair@dhis2.org:

Hi Hakim
Can you please re-phrase your question.

Zubair

On Wed, 6 Jun 2018, 8:15 am DJIBRIL Hakim, djib.hakim@gmail.com wrote:

Hi all,

Please Is it possible to have ideas on how can be URL template when setting Generic http SMS Gateway in DHIS2 both for inbound and outbound sms?

Thank you


Mailing list: https://launchpad.net/~dhis2-devs

Post to : dhis2-devs@lists.launchpad.net

Unsubscribe : https://launchpad.net/~dhis2-devs

More help : https://help.launchpad.net/ListHelp

Ok Thank you for feedback

Just a clarification please

Where I am supposed to setup this link? in dhis2 or at the provider side ?

http://<DHIS2_URL>/api/sms/inbound?message=&sender=<SENDER ID/PHONE NUMBER>

If at the provider side, shall I need add credentials?

···

2018-06-06 6:32 GMT+00:00 Stephen Ocaya socaya@hispuganda.org:

Hi Hakim,

For Inbound into DHIS2 (from SMS Service provider), you can use this endpoint template

http://<DHIS2_URL>/api/sms/inbound?message=&sender=<SENDER ID/PHONE NUMBER>

and to set the OUTBOUND depending on your service Provider,

You specify the following:

Gateway Type: Generic HTTP Gateway

Gateway Name: put short name

Message Parameter: depends on your SMS provider e.g. text

recipient Parameter: depends on your SMS provider e.g. to

URL template: depends on your SMS provider e.g. http://sms.stephocay.com/sendsms

You can add custom other parameters e.g. for our SMS provider could be

e.g. from: STEPHEN

username:secretuser

password:password

etc.

Regards

Strategic Information Systems for Actions

Plot 36 Impala Avenue, Kololo

P.O. Box 4750, Kampala

On Wed, Jun 6, 2018 at 9:14 AM, DJIBRIL Hakim djib.hakim@gmail.com wrote:

Hi all,

Please Is it possible to have ideas on how can be URL template when setting Generic http SMS Gateway in DHIS2 both for inbound and outbound sms?

Thank you


Mailing list: https://launchpad.net/~dhis2-devs

Post to : dhis2-devs@lists.launchpad.net

Unsubscribe : https://launchpad.net/~dhis2-devs

More help : https://help.launchpad.net/ListHelp

yes, you will need to set this from the provider’s end point. and Yes you will need to authenticate using an existing dhis2 user account with a role that adds data and uses sms, DHIS2 supports basic authentication and their systems will need to cater for then authentication details in the header.

regards

···

On Wed, Jun 6, 2018 at 9:58 AM, DJIBRIL Hakim djib.hakim@gmail.com wrote:

Ok Thank you for feedback

Just a clarification please

Where I am supposed to setup this link? in dhis2 or at the provider side ?

http://<DHIS2_URL>/api/sms/inbound?message=&sender=<SENDER ID/PHONE NUMBER>

If at the provider side, shall I need add credentials?


Mailing list: https://launchpad.net/~dhis2-devs

Post to : dhis2-devs@lists.launchpad.net

Unsubscribe : https://launchpad.net/~dhis2-devs

More help : https://help.launchpad.net/ListHelp

–

2018-06-06 6:32 GMT+00:00 Stephen Ocaya socaya@hispuganda.org:

Hi Hakim,

For Inbound into DHIS2 (from SMS Service provider), you can use this endpoint template

http://<DHIS2_URL>/api/sms/inbound?message=&sender=<SENDER ID/PHONE NUMBER>

and to set the OUTBOUND depending on your service Provider,

You specify the following:

Gateway Type: Generic HTTP Gateway

Gateway Name: put short name

Message Parameter: depends on your SMS provider e.g. text

recipient Parameter: depends on your SMS provider e.g. to

URL template: depends on your SMS provider e.g. http://sms.stephocay.com/sendsms

You can add custom other parameters e.g. for our SMS provider could be

e.g. from: STEPHEN

username:secretuser

password:password

etc.

Regards

Strategic Information Systems for Actions

Plot 36 Impala Avenue, Kololo

P.O. Box 4750, Kampala

On Wed, Jun 6, 2018 at 9:14 AM, DJIBRIL Hakim djib.hakim@gmail.com wrote:

Hi all,

Please Is it possible to have ideas on how can be URL template when setting Generic http SMS Gateway in DHIS2 both for inbound and outbound sms?

Thank you


Mailing list: https://launchpad.net/~dhis2-devs

Post to : dhis2-devs@lists.launchpad.net

Unsubscribe : https://launchpad.net/~dhis2-devs

More help : https://help.launchpad.net/ListHelp

–

Stephen Ocaya

Tel: +256 393 217 892 | Mob: +256774558980

www.stephocay.com

SkypeID: stephocay

Thank you Stephen.!

···

2018-06-06 7:04 GMT+00:00 Ocaya Stephen stephocay@gmail.com:

yes, you will need to set this from the provider’s end point. and Yes you will need to authenticate using an existing dhis2 user account with a role that adds data and uses sms, DHIS2 supports basic authentication and their systems will need to cater for then authentication details in the header.

regards

On Wed, Jun 6, 2018 at 9:58 AM, DJIBRIL Hakim djib.hakim@gmail.com wrote:

Ok Thank you for feedback

Just a clarification please

Where I am supposed to setup this link? in dhis2 or at the provider side ?

http://<DHIS2_URL>/api/sms/inbound?message=&sender=<SENDER ID/PHONE NUMBER>

If at the provider side, shall I need add credentials?


Mailing list: https://launchpad.net/~dhis2-devs

Post to : dhis2-devs@lists.launchpad.net

Unsubscribe : https://launchpad.net/~dhis2-devs

More help : https://help.launchpad.net/ListHelp

–

Stephen Ocaya

Tel: +256 393 217 892 | Mob: +256774558980

www.stephocay.com

SkypeID: stephocay

–

2018-06-06 6:32 GMT+00:00 Stephen Ocaya socaya@hispuganda.org:

Hi Hakim,

For Inbound into DHIS2 (from SMS Service provider), you can use this endpoint template

http://<DHIS2_URL>/api/sms/inbound?message=&sender=<SENDER ID/PHONE NUMBER>

and to set the OUTBOUND depending on your service Provider,

You specify the following:

Gateway Type: Generic HTTP Gateway

Gateway Name: put short name

Message Parameter: depends on your SMS provider e.g. text

recipient Parameter: depends on your SMS provider e.g. to

URL template: depends on your SMS provider e.g. http://sms.stephocay.com/sendsms

You can add custom other parameters e.g. for our SMS provider could be

e.g. from: STEPHEN

username:secretuser

password:password

etc.

Regards

Strategic Information Systems for Actions

Plot 36 Impala Avenue, Kololo

P.O. Box 4750, Kampala

On Wed, Jun 6, 2018 at 9:14 AM, DJIBRIL Hakim djib.hakim@gmail.com wrote:

Hi all,

Please Is it possible to have ideas on how can be URL template when setting Generic http SMS Gateway in DHIS2 both for inbound and outbound sms?

Thank you


Mailing list: https://launchpad.net/~dhis2-devs

Post to : dhis2-devs@lists.launchpad.net

Unsubscribe : https://launchpad.net/~dhis2-devs

More help : https://help.launchpad.net/ListHelp

Hi again

I have choose this authorities but can’t post inbouding api with the user having this role. I got this error {“httpStatus”:“Conflict”,“httpStatusCode”:409,“status”:“ERROR”,“message”:“User not registered in the system”}.

But working fine if I have all in authorities. the originator number is well assigned to a user. I am using V2.28

the link I am posting myDhis2URL/api/sms/inbound?message=test&originator=2**********

image

​Do I miss something PLEASE ?

···

2018-06-06 7:51 GMT+00:00 DJIBRIL Hakim djib.hakim@gmail.com:

Thank you Stephen.!

2018-06-06 7:04 GMT+00:00 Ocaya Stephen stephocay@gmail.com:

yes, you will need to set this from the provider’s end point. and Yes you will need to authenticate using an existing dhis2 user account with a role that adds data and uses sms, DHIS2 supports basic authentication and their systems will need to cater for then authentication details in the header.

regards

On Wed, Jun 6, 2018 at 9:58 AM, DJIBRIL Hakim djib.hakim@gmail.com wrote:

Ok Thank you for feedback

Just a clarification please

Where I am supposed to setup this link? in dhis2 or at the provider side ?

http://<DHIS2_URL>/api/sms/inbound?message=&sender=<SENDER ID/PHONE NUMBER>

If at the provider side, shall I need add credentials?


Mailing list: https://launchpad.net/~dhis2-devs

Post to : dhis2-devs@lists.launchpad.net

Unsubscribe : https://launchpad.net/~dhis2-devs

More help : https://help.launchpad.net/ListHelp

–

Stephen Ocaya

Tel: +256 393 217 892 | Mob: +256774558980

www.stephocay.com

SkypeID: stephocay

–

2018-06-06 6:32 GMT+00:00 Stephen Ocaya socaya@hispuganda.org:

Hi Hakim,

For Inbound into DHIS2 (from SMS Service provider), you can use this endpoint template

http://<DHIS2_URL>/api/sms/inbound?message=&sender=<SENDER ID/PHONE NUMBER>

and to set the OUTBOUND depending on your service Provider,

You specify the following:

Gateway Type: Generic HTTP Gateway

Gateway Name: put short name

Message Parameter: depends on your SMS provider e.g. text

recipient Parameter: depends on your SMS provider e.g. to

URL template: depends on your SMS provider e.g. http://sms.stephocay.com/sendsms

You can add custom other parameters e.g. for our SMS provider could be

e.g. from: STEPHEN

username:secretuser

password:password

etc.

Regards

Strategic Information Systems for Actions

Plot 36 Impala Avenue, Kololo

P.O. Box 4750, Kampala

On Wed, Jun 6, 2018 at 9:14 AM, DJIBRIL Hakim djib.hakim@gmail.com wrote:

Hi all,

Please Is it possible to have ideas on how can be URL template when setting Generic http SMS Gateway in DHIS2 both for inbound and outbound sms?

Thank you


Mailing list: https://launchpad.net/~dhis2-devs

Post to : dhis2-devs@lists.launchpad.net

Unsubscribe : https://launchpad.net/~dhis2-devs

More help : https://help.launchpad.net/ListHelp

I am agree with you. that is what I done.

the fact is the user I am using to post this API Link, if he has authorities I have listed, I got error but IF he has ALL ( aka superuser) everything going well.

So do I miss some authorities. I am using version 2.28

image

···

2018-06-07 4:51 GMT+00:00 Stephen Ocaya socaya@hispuganda.org:

Hi, you need to register the phone number to a user account (phone attribute) attached to the orgunit you are reporting for.

1user account, 1 phone number to avoid conflicts of being attached to more than 1 orgUnit.

Also the phone shoule have country code e.g. Uganda is 256.

So the phone number should be 2567xxxxxxxx.

Otherwise, looks like everything is working perfectly for inbound.

Regards

On Thu, Jun 7, 2018, 07:34 DJIBRIL Hakim djib.hakim@gmail.com wrote:

Hi again

I have choose this authorities but can’t post inbouding api with the user having this role. I got this error {“httpStatus”:“Conflict”,“httpStatusCode”:409,“status”:“ERROR”,“message”:“User not registered in the system”}.

But working fine if I have all in authorities. the originator number is well assigned to a user. I am using V2.28

the link I am posting myDhis2URL/api/sms/inbound?message=test&originator=2**********

​Do I miss something PLEASE ?

Strategic Information Systems for Actions

Plot 36 Impala Avenue, Kololo

P.O. Box 4750, Kampala

2018-06-06 7:51 GMT+00:00 DJIBRIL Hakim djib.hakim@gmail.com:

Thank you Stephen.!

2018-06-06 7:04 GMT+00:00 Ocaya Stephen stephocay@gmail.com:

yes, you will need to set this from the provider’s end point. and Yes you will need to authenticate using an existing dhis2 user account with a role that adds data and uses sms, DHIS2 supports basic authentication and their systems will need to cater for then authentication details in the header.

regards

On Wed, Jun 6, 2018 at 9:58 AM, DJIBRIL Hakim djib.hakim@gmail.com wrote:

Ok Thank you for feedback

Just a clarification please

Where I am supposed to setup this link? in dhis2 or at the provider side ?

http://<DHIS2_URL>/api/sms/inbound?message=&sender=<SENDER ID/PHONE NUMBER>

If at the provider side, shall I need add credentials?


Mailing list: https://launchpad.net/~dhis2-devs

Post to : dhis2-devs@lists.launchpad.net

Unsubscribe : https://launchpad.net/~dhis2-devs

More help : https://help.launchpad.net/ListHelp

–

Stephen Ocaya

Tel: +256 393 217 892 | Mob: +256774558980

www.stephocay.com

SkypeID: stephocay

–

2018-06-06 6:32 GMT+00:00 Stephen Ocaya socaya@hispuganda.org:

Hi Hakim,

For Inbound into DHIS2 (from SMS Service provider), you can use this endpoint template

http://<DHIS2_URL>/api/sms/inbound?message=&sender=<SENDER ID/PHONE NUMBER>

and to set the OUTBOUND depending on your service Provider,

You specify the following:

Gateway Type: Generic HTTP Gateway

Gateway Name: put short name

Message Parameter: depends on your SMS provider e.g. text

recipient Parameter: depends on your SMS provider e.g. to

URL template: depends on your SMS provider e.g. http://sms.stephocay.com/sendsms

You can add custom other parameters e.g. for our SMS provider could be

e.g. from: STEPHEN

username:secretuser

password:password

etc.

Regards

Strategic Information Systems for Actions

Plot 36 Impala Avenue, Kololo

P.O. Box 4750, Kampala

On Wed, Jun 6, 2018 at 9:14 AM, DJIBRIL Hakim djib.hakim@gmail.com wrote:

Hi all,

Please Is it possible to have ideas on how can be URL template when setting Generic http SMS Gateway in DHIS2 both for inbound and outbound sms?

Thank you


Mailing list: https://launchpad.net/~dhis2-devs

Post to : dhis2-devs@lists.launchpad.net

Unsubscribe : https://launchpad.net/~dhis2-devs

More help : https://help.launchpad.net/ListHelp

Hi,

It looks the key authority you need for using the sms/incomingsms api endpoint is
F_MOBILE_SETTINGS

In recent versions that’s presumably the same as the “System” authority called “Set Mobile Settings”

Regards
calle

1 Like