News & Announcements User Community Developer Community

Welcome to the RingCentral Community

Please note the community is currently under maintenance and is read-only.

Search
Make sure to review our Terms of Use and Community Guidelines.
  Please note the community is currently under maintenance and is read-only.
Home » Developers
Send SMS - Error MSG-304
Tags: errors, sms and text messaging
Mar 17, 2016 at 3:50pm   •   22 replies  •  0 likes
travis-carona

I have my app working fine in Sandbox, but in production when trying to send a text, i recieve the following response:


body=>"{\r\n

\"errorCode\" : \"FeatureNotAvailable\",\r\n

\"message\" : \"Phone number doesn't belong to extension\",\r\n

\"errors\" : [ {\r\n

\"errorCode\" : \"MSG-304\",\r\n

\"message\" : \"Phone number doesn't belong to extension\"\r\n

} ]\r\n}", :url=>#<URI::HTTPS:0x007ffb5c0b65d0 URL:https://platform.ringcentral.com/restapi/v1.0/account/~/extension/~/sms>;,


I am trying to text a users cell phone number. We receive txts on our cells fine in sandbox mode

22 Answers
answered on Jun 16, 2022 at 1:19am  

Hi @Anton Nikitin. Greetings.

I am currently working on sandbox environment, and my phone number is associated to my account. But when I try to test sms api, it returns an error "Phone number doesn't belong to extension"

{ "to" : [{ "phoneNumber" : "+171xxxxxxxx " }], "from" : { "phoneNumber" : "+147xxxxxxxx}" }, "text" : "Test SMS message from Platform server" }


What's wrong?

Please let me know your thoughts.

Thanks.


 0
on Jun 17, 2022 at 9:56am   •  1 likes

Hi @NuCare Admin

I think, this issue may be that you are using your sandbox number in production environment. Please note that both environments are different.

Lets say your sandbox number is 772-XXX-YYYY

For Sandbox environment, you will use

1a. Sandbox URL: https://platform.devtest.ringcentral.com

1b. Sandbox Application credentials

1c. Sandbox User (Lets say extension 101 who owns this number 772-XXX-YYYY)

Now, when you graduate your application to production, you need to migrate to new production environment.

2a. Production URL: https://platform.ringcentral.com

2b. Production Application Credentials

2c. Production User (Let’s say extension 101 who owns new production number 566-AAA-BBBB) -> THIS IS NOT THE SAME SANDBOX NUMBER AS 1c

Looks like you are using 2a and 2b but with 1c (ie with sandbox number)

So to use SMS API’s in production, you need a production account which can be purchased from https://www.ringcentral.com/office/plansandpricing-b.html#mvp

Please note, you need to be on Premium or Ultimate account to be able to use Developer Platform APIs (i.e SMS APIs)

When you use your production user with a production number against production environment, everything will work.

Hope this clarifies, but in case the problem persists, I suggest you to open a direct ticket here: https://developers.ringcentral.com/support/create-case and we can look into your case more closely.

Regards

Gurpreet Singh

PM, Platform Products

on Jun 18, 2022 at 10:01am   •  0 likes

Thanks for your reply.

You said "I think, this issue may be that you are using your sandbox number in the Production environment. Please note that both environments are different. "


But I am working on a sandbox environment, and as I said, my phone number is connected to the sandbox account.

Please see this screenshot.

https://prnt.sc/U-WhTw7UqO-7

I used phone number of sandbox for SMS API, but it's not working.

I think you're confused now.

Please help me help me.

Thanks.

on Jun 21, 2022 at 12:23pm   •  0 likes

Hi @NuCare Admin can you please open a support ticket - https://developers.ringcentral.com/support/create-case and provide your App Client ID in there so we can closely look at it ?

Thanks!


answered on Mar 30, 2016 at 7:50pm  
If you indicate a company number (not direct extension number) as your "from" number, you must be logged in as a company operator to be allowed to send SMS from this number. By default, main system administrator extension is defined as a company operator, but it can be changed in RingCentral Service Web UI .  

 1
answered on May 2, 2019 at 11:35am  
If you are logged in to the app in production as this account user, then yes.

 0
on Jun 16, 2022 at 7:02am   •  0 likes

Hi @Anton Nikitin. Greetings.

I am currently working on sandbox environment, and my phone number is associated to my account. But when I try to test sms api, it returns an error "Phone number doesn't belong to extension"

{ "to" : [{ "phoneNumber" : "+171xxxxxxxx " }], "from" : { "phoneNumber" : "+147xxxxxxxx}" }, "text" : "Test SMS message from Platform server" }


What's wrong?

Please let me know your thoughts.

Thanks.

answered on May 2, 2019 at 3:55am  
Hi, Anton Nikitin
I working on app: Should I define as "from number" the number from here: https://prnt.sc/njgern ?

 0
answered on Feb 7, 2019 at 2:38am  
Dave,

The phone number you use to send a message from (+18035096800) must belong to authenticated user.

 0
answered on Feb 7, 2019 at 1:38am  
HI, I am having a similar issue,

This is my header and request string.

curl --request POST \ --url 'https://platform.ringcentral.com/restapi/v1.0/account/~/extension/~/sms' \ --header 'accept: application/json' \ --header 'authorization: Bearer SUFEMDFQMDdQQVMwMHxBQUMxaXFvRnNqRjRQSE5yc1pCSTdacldhNjJLZl9wbHRHd3c3Z3R6eHZUZXRmNzFRMmJZOTlRRFdyTnU4a0dDb2N0NF9QWWRPMEVYNENYQjd4dmJsWHJobm5GOTQ4Zi1PTFRIczcycTVONm13em0xVDVFbTd3YkZXRGtIalZ1Qzk1R3Z5cnhkdTRFLVdQLVVtcVBsbzNtTmpTbG43LVpsM3BSb0dZR19MVlo5bGhoU1ZXNEYwVG9taHY3cjI0RVA3UnBoOXpZR1RqSDlLWDJuSFFHSlJjMnF8SHVZRXVRfEEwcDA1RzQ4S3JsaG5CcFViUEJ4SkF8QUE' \ --header 'content-type: application/json' \ --data '{"from":{"phoneNumber":"+18035096800"},"to":[{"phoneNumber":"(378) 400-1234"}],"text":"testing"}'


This is the response i recieve.
The error code is 304
{ "errorCode": "FeatureNotAvailable", "message": "Phone number doesn't belong to extension", "errors": [ { "errorCode": "MSG-304", "message": "Phone number doesn't belong to extension" } ] }

 0
answered on Mar 23, 2016 at 2:36pm  
Could you send me the request headers and body you're using privately to: benjamin.dean@ringcentral.com please?

I'd like to run some tests myself please.

 0
answered on Mar 23, 2016 at 2:27pm  
That is correct

 0
answered on Mar 23, 2016 at 2:07pm  
And the "from" number is a number associated with the respective production RingCentral account?

 0
answered on Mar 23, 2016 at 11:37am  
No problem, i think i just got you confused by saying that it was working in staging.  To answer you questions
  1. The app has been graduated
  2. we are using production url
  3. correct keys
  4. I am not sure what you mean by review in conext of production account, but if that means that you can take a look at my account specifically, I am beginning to think that the problem may lie in an account specific spot.  It's just weird that we are perfectly fine in staging.
Thanks again for getting back!

 0
answered on Mar 23, 2016 at 10:31am  
Sorry about that, thought you had things working the way you needed.

In production:
  1. Has your app/integration been graduated to production?
  2. Are you using the production API Base URL: https://platform.ringcentral.com/ ?
  3. Are you using production API keys (if you have production access)?
  4. Do I need to re-review this in the context of your production account?
Thanks for helping to isolate the answers.

 0
answered on Mar 21, 2016 at 1:33pm  
I received an email that this case was closed, is there a way to reopen it please?

 0
answered on Mar 21, 2016 at 12:46pm  
It is still not working

 0
answered on Mar 21, 2016 at 12:44pm  
?? that was my error

it works in the sandbox but not production ...that was there production error

 0
answered on Mar 21, 2016 at 12:42pm  
Awesome, thanks for sharing your success.

 0
on Jun 16, 2022 at 7:03am   •  0 likes

Hi . Greetings.

I am currently working on sandbox environment, and my phone number is associated to my account. But when I try to test sms api, it returns an error "Phone number doesn't belong to extension"

{ "to" : [{ "phoneNumber" : "+171xxxxxxxx " }], "from" : { "phoneNumber" : "+147xxxxxxxx}" }, "text" : "Test SMS message from Platform server" }


What's wrong?

Please let me know your thoughts.

Thanks.

answered on Mar 21, 2016 at 12:35pm  
also, incase it helps, this does work in the sandbox

the headers:


conn.headers['Authorization'] = "Bearer #{token["access_token"]}"    
conn.headers['Content-Type'] = "application/json"

The Body: 

conn.post '/restapi/v1.0/account/~/extension/~/sms', {      to: [{phoneNumber: 512XXXXXXX}],
      from: {phoneNumber: 'mainRingcentralNumber'},
      text: message
    }.to_json

the response/error:

<Faraday::Response:0x007fac88eb5a00 @env={:method=>:post, :body=>"{\r\n  \"errorCode\" : \"FeatureNotAvailable\",\r\n  \"message\" : \"Phone number doesn't belong to extension\",\r\n  \"errors\" : [ {\r\n    \"errorCode\" : \"MSG-304\",\r\n    \"message\" : \"Phone number doesn't belong to extension\"\r\n  } ]\r\n}", :url=>#<URI::HTTPS:0x007fac846bc438 URL:https://platform.ringcentral.com/restapi/v1.0/account/~/extension/~/sms>;, :request_headers=>{"User-Agent"=>"Faraday v0.8.9", "Authorization"=>"Bearer U0pDMDFQMDdQQVMwNXxBQUF5cjVEZURodDZhSWx2cGFYUlhsREJCdkd6Yzk5d0JEd3ZraExzNm5yNGl0YUt5bG5fRE5QX0Rtd0JobXl4MG16Qm9DRy04NzZPaDNPV3FzbEwwTUtuNHVYM3ZWR2xWd052cjZSYUdsbW93bmpXd3pyRkt3aFJrZTBGaEVGeDJVZ3xZNHl2WGd8YkdUYVhKZEpucGlYQnF0QndBRUs5UQ", "Content-Type"=>"application/json"}, :parallel_manager=>nil, :request=>{:proxy=>nil}, :ssl=>{}, :status=>403, :response_headers=>{"server"=>"nginx/1.8.0", "date"=>"Mon, 21 Mar 2016 19:32:46 GMT", "content-type"=>"application/json;charset=UTF-8", "content-length"=>"218", "connection"=>"close", "rcrequestid"=>"b06f05f4-ef9b-11e5-af18-005056973311", "routingkey"=>"SJC01P07PAS05", "x-loadmetric"=>"7", "x-error-id"=>"2da5f246-03f3-481a-8dd3-14a4df00e683", "x-rate-limit-group"=>"medium", "x-rate-limit-limit"=>"40", "x-rate-limit-remaining"=>"39", "x-rate-limit-window"=>"60", "content-language"=>"en-US"}, :response=>#<Faraday::Response:0x007fac88eb5a00 ...>}, @on_complete_callbacks=[]> => {"errorCode"=>"FeatureNotAvailable", "message"=>"Phone number doesn't belong to extension", "errors"=>[{"errorCode"=>"MSG-304", "message"=>"Phone number doesn't belong to extension"}]}

 1
answered on Mar 21, 2016 at 12:30pm  
Yes, that should work as expected. If not, please provide the headers and error message please.

 0
on Jun 16, 2022 at 7:03am   •  0 likes

Hi . Greetings.

I am currently working on sandbox environment, and my phone number is associated to my account. But when I try to test sms api, it returns an error "Phone number doesn't belong to extension"

{ "to" : [{ "phoneNumber" : "+171xxxxxxxx " }], "from" : { "phoneNumber" : "+147xxxxxxxx}" }, "text" : "Test SMS message from Platform server" }


What's wrong?

Please let me know your thoughts.

Thanks.

answered on Mar 21, 2016 at 12:19pm  
Sorry, it wasn't clear from the example. recipients is a Caller info object  and looks like this [{phoneNumber: '512XXXXXXX'}]

so 

recipients = [{phoneNumber: '512XXXXXXX'}]
res = conn.post '/restapi/v1.0/account/~/extension/~/sms', {      to: recipients,
      from: {phoneNumber: 'mainRingcentralNumber'},
      text: message
    }.to_json

 0
answered on Mar 21, 2016 at 11:17am  
The "to" property must contain a Caller-Info object that has a phoneNumber property similar to your "from" property.

Check the, developer guide here for more information: https://developers.ringcentral.com/api-docs/latest/index.html#!#RefCreateSMSMessage

 0
on Jun 16, 2022 at 7:03am   •  0 likes

Hi . Greetings.

I am currently working on sandbox environment, and my phone number is associated to my account. But when I try to test sms api, it returns an error "Phone number doesn't belong to extension"

{ "to" : [{ "phoneNumber" : "+171xxxxxxxx " }], "from" : { "phoneNumber" : "+147xxxxxxxx}" }, "text" : "Test SMS message from Platform server" }


What's wrong?

Please let me know your thoughts.

Thanks.

answered on Mar 18, 2016 at 4:44pm  
Hey Ben, 

I am using the following as my request headers/body :

conn.headers['Authorization'] = "Bearer #{token["access_token"]}"   
conn.headers['Content-Type'] = "application/json"

and the body

res = conn.post '/restapi/v1.0/account/~/extension/~/sms', {      to: recipients,
      from: {phoneNumber: 'mainRingcentralNumber'},
      text: message
    }.to_json


in the above, recipients is a local phone number and message is just a string message
the from number is 5128272252 and we are using extension 101; we got those from the user accound credentials page on the ringcentral dev dashboard

 0
answered on Mar 17, 2016 at 5:40pm  
What is the from number you're using please and is it part of your production RingCentral account for the user you've authenticated in the session?

Could you provide the request headers and body you're using please?

 0
on Jun 16, 2022 at 7:03am   •  0 likes

Hi . Greetings.

I am currently working on sandbox environment, and my phone number is associated to my account. But when I try to test sms api, it returns an error "Phone number doesn't belong to extension"

{ "to" : [{ "phoneNumber" : "+171xxxxxxxx " }], "from" : { "phoneNumber" : "+147xxxxxxxx}" }, "text" : "Test SMS message from Platform server" }


What's wrong?

Please let me know your thoughts.

Thanks.



A new Community is coming to RingCentral!

Posts are currently read-only as we transition into our new platform.

We thank you for your patience
during this downtime.

Try Workflow Builder

Did you know you can easily automate tasks like responding to SMS, team messages, and more? Plus it's included with RingCentral Video and RingEX plans!

Try RingCentral Workflow Builder

PRODUCTS
RingEX
Message
Video
Phone
OPEN ECOSYSTEM
Developer Platform
APIs
Integrated Apps
App Gallery
Developer support
Games and rewards

RESOURCES
Resource center
Blog
Product Releases
Accessibility
QUICK LINKS
App Download
RingCentral App login
Admin Portal Login
Contact Sales
© 1999-2024 RingCentral, Inc. All rights reserved. Legal Privacy Notice Site Map Contact Us