400 bad request on send SMS

  • 1
  • Problem
  • Updated 1 year ago
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 = {            <br>                    "from": {<br>                            "phoneNumber": "+1000000000"<br>                    },<br>                    "to": [{<br>                            "phoneNumber": $phone<br>                    }],<br>                    "text": $message    };<br>          platform.post('/account/~/extension/~/sms',$json_data<br>          ).then(function(response) {<br>              console.log(response.json()); <br>              //alert('Success: ' + response.json().id);<br>          })<br>          .catch(function(e) {<br>              //alert('Error: ' + e.message);<br>          });&nbsp;<br>    }


Please let me know how to resolve this issue??

Thank you!
Photo of AIRS INC

AIRS INC

  • 230 Points 100 badge 2x thumb

Posted 1 year ago

  • 1
Photo of Tyler Long

Tyler Long, Official Rep

  • 8,492 Points 5k badge 2x thumb
What is the error message?   `e.message`
Photo of AIRS INC

AIRS INC

  • 230 Points 100 badge 2x thumb
I'm trying to send sms on wrong number that time I get 400 bad request.
Photo of AIRS INC

AIRS INC

  • 230 Points 100 badge 2x thumb
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.
Photo of Tyler Long

Tyler Long, Official Rep

  • 8,492 Points 5k badge 2x thumb
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
Photo of Tyler Long

Tyler Long, Official Rep

  • 8,492 Points 5k badge 2x thumb
Here is the link to customer support: https://success.ringcentral.com/RCContactSupp
(Edited)