question

airs-inc6788 avatar image
airs-inc6788 asked Anirban Sen Chowdhary 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!


topic-default
1 |1000

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 |1000

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 |1000

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 |1000

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 |1000

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://success.ringcentral.com/RCContactSupp
0 Likes 0 ·
Anirban Sen Chowdhary avatar image
Anirban Sen Chowdhary 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 |1000

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

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

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