question

airs-inc6788 avatar image
airs-inc6788 asked Anirban answered

400 bad request on send SMS


Hi Support


I'm using javascript SDK for send SMS feature and app is under development mode. I'm getting 400 bad request when I post request for Send SMS. Here is my code

function send_sms($phone,$message){        
          $json_data = {            
                    "from": {
                  
                            "phoneNumber": "+1000000000"
                    },
                    "to": [{
                  
                            "phoneNumber": $phone
                    }],
                    "text": $message    };
          platform.post('/account/~/extension/~/sms',$json_data
          ).then(function(response) {
                  
              console.log(response.json()); 
              //alert('Success: ' + response.json().id);
          })
          .catch(function(e) {
                  
              //alert('Error: ' + e.message);
          }); 
    }



Please let me know how to resolve this issue??


Thank you!



sdk
1 |3000

Up to 8 attachments (including images) can be used with a maximum of 1.0 MiB each and 10.0 MiB total.

Tyler Liu avatar image
Tyler Liu answered
What is the error message?   'e.message'
1 |3000

Up to 8 attachments (including images) can be used with a maximum of 1.0 MiB each and 10.0 MiB total.

airs-inc6788 avatar image
airs-inc6788 answered
I'm trying to send sms on wrong number that time I get 400 bad request.
1 |3000

Up to 8 attachments (including images) can be used with a maximum of 1.0 MiB each and 10.0 MiB total.

airs-inc6788 avatar image
airs-inc6788 answered
Hi Tyler

I tried to send sms on right number then everything is ok. but when I get any error message like "International number not supported", etc then request became 400 bad. 


Thank you.
1 |3000

Up to 8 attachments (including images) can be used with a maximum of 1.0 MiB each and 10.0 MiB total.

Tyler Liu avatar image
Tyler Liu answered Tyler Liu commented
Hi AIRS,

It doesn't seem like a technical issue. The error message is clear: "International number not supported". Which means your account doesn't support sending message to international numbers.

You can contact the customer support to upgrade/configure your account if you are already a paid customer.

This devcommunity forum is for technical issues only so I am afraid that I cannot help your further.

Tyler
1 comment
1 |3000

Up to 8 attachments (including images) can be used with a maximum of 1.0 MiB each and 10.0 MiB total.

Tyler Liu avatar image Tyler Liu ♦ commented ·

Here is the link to customer support:https://support.ringcentral.com/contact-support.html

0 Likes 0 ·
Anirban avatar image
Anirban answered

As it's already showing International number not supported error it's clear that you account doesn't have that privilege and you need to upgrade. If you can involve Dev support team regarding you account upgrade, you issue will be resolved

1 |3000

Up to 8 attachments (including images) can be used with a maximum of 1.0 MiB each and 10.0 MiB total.

Developer sandbox tools

Using the RingCentral Phone for Desktop, you can dial or receive test calls, send and receive test SMS or Fax messages in your sandbox environment.

Download RingCentral Phone for Desktop:

Tip: switch to the "sandbox mode" before logging in the app:

  • On MacOS: press "fn + command + f2" keys
  • On Windows: press "Ctrl + F2" keys