2

I am using clickatell sms gateway to send SMS to the User in Java.

For that I have registered on clickatell and purchased Small Business API - Americas Regional Traffic to send sms to USA users. I have activated Two-Way Number . My Java code is looks like -

    String url = "http://api.clickatell.com/http/sendmsg?";
    List<NameValuePair> params = new LinkedList<NameValuePair>();
    params.add(new BasicNameValuePair("user", "user"));
    params.add(new BasicNameValuePair("password", "password"));
    params.add(new BasicNameValuePair("api_id", "XXXXX"));
    params.add(new BasicNameValuePair("to", "1XXXXXXXXXX"));
    params.add(new BasicNameValuePair("text", "Demo Message"));
    params.add(new BasicNameValuePair("from", "my-two-way-number"));
    params.add(new BasicNameValuePair("mo", "1"));

    String paramString = URLEncodedUtils.format(params, "utf-8");
    url += paramString;
    HttpGet get = new HttpGet(url);

    HttpResponse response = client.execute(get);

When I run this java code I get the api-message-id in response, I have checked the status of the this api-message-id on clickatell message report it shows Delivered to gateway, but the message was received on the Phone.

The phone number format I'm using is 1 for country code and rest 10 digits of phone number. When I try with other format it gives me error.

I am not understanding why I am not receiving SMS on my phone while it is showing Delivered to gateway

Deepu
  • 2,590
  • 19
  • 52
  • 74
  • 1
    Hussh finally I received SMS, actually for first SMS it takes time, for me it took 12-15 hours. But still the status is same though I received the message. Thanks all for your support – Deepu Aug 09 '13 at 06:52
  • 1
    Can we instantly get the remaining messages.? – Sajeev Feb 11 '14 at 18:02
  • @Saj It depends on your network coverage. For me sometimes I get sms instantly if coverage is good, sometimes it takes time if coverage is poor. – Deepu Feb 12 '14 at 05:31
  • For me the code gets executed and the credit has been reduced from the clickatell account. And the account showing 0 out of 6 messages successfully delivered. And my phone number format was 91xxxxxxxxxx. Can you mention issues with this..? – Sajeev Feb 12 '14 at 18:28
  • I have used this service for American region, You have to check it with Indian region and network operator. Also try to analyze the response code you are receiving. – Deepu Feb 13 '14 at 05:39
  • Thank you very much for your support. Finally I got the SMS . And the code has attached here http://tekadempiere.blogspot.in/2014/02/sending-sms-using-java-code-and.html – Sajeev Feb 15 '14 at 07:52

2 Answers2

2

If you have sent the sms to an Indian number:

As per TRAI regulations, you are only permitted to deliver promotional or commercial messages during normal office hours. Please refer to the following page for the full regulations

http://www.nccptrai.gov.in/nccpregistry/regulation1diccndiv.pdf.

Please refrain from sending messages after 9pm India local time.

I have contacted the customer care and came to know this information.

1

"Delivered to gateway" means Clickatell has handed it off to the gateway provider, and that the gateway provider will then try to deliver it to your handset. As soon as that has happened, the status will change to "Delivered to handset" or "Received by recipient" or someething similar.

Flexo
  • 87,323
  • 22
  • 191
  • 272
Arno
  • 1,253
  • 14
  • 21
  • 1
    I noticed that it can stay in "Delivered to gateway" for 20 minutes, after which it goes to "Received by recipient" and you are billed, even though the recipient didn't actually receive it. Great :( – w00t Mar 22 '16 at 15:43
  • I'm getting "Received by recipient" but the recipient not getting anything. – Muhammed Refaat Apr 30 '17 at 10:36
  • @w00t I think this is my case also, the recipient don't receive it. – Muhammed Refaat Apr 30 '17 at 10:37