304 error after transition to production

  • 1
  • Problem
  • Updated 3 years ago
  • In Progress
I see this issue in another thread and I don't know if I'm supposed to place at the bottom of it or a new thread.  I didn't see the issue resolved however.  I am having the same issue.  I graduated form development to production today.  I changed my URLs to the platform.ringcentral.com address.  I changed my key & secret codes to production values and immediately received a 304 error.  After reading your post on the previous thread, I checked with my RingCentral account and tried changing my credentials to the phone number, extension & password of the operator's extension to no avail.  I also tried changing them to my credentials(super admin), again to no avail.  I'm at a loss.
Thanks,
bob
Photo of Bob Thompson

Bob Thompson

  • 130 Points 100 badge 2x thumb

Posted 3 years ago

  • 1
Photo of AK

AK, Official Rep

  • 4,402 Points 4k badge 2x thumb
Hi Bob,

What is the API endpoint which is resulting in the HTTP 304 error code. 
Photo of Bob Thompson

Bob Thompson

  • 130 Points 100 badge 2x thumb
Thanks for the assistance.  The endpoint is: /restapi/v1.0/account/~/extension/~/sms
Photo of Anton Nikitin

Anton Nikitin, Official Rep

  • 2,914 Points 2k badge 2x thumb
Hi Bob,

basing on your post I expect that you have read https://devcommunity.ringcentral.com/ringcentraldev/topics/how-to-send-sms-from-the-main-company-num...

If you are still getting MSG-304 after making all these steps, please let us know what phone number you use to login and what number you choose to send SMS from.

Thanks,

Anton
Photo of Bob Thompson

Bob Thompson

  • 130 Points 100 badge 2x thumb
Anton,  

Still getting the error, I tried switching back to the development server and works fine.  Back to production and get the error.  I am logging in with number 18778897640 (operator) and sending with number 18883931083.

Thanks,
bob
Photo of Anton Nikitin

Anton Nikitin, Official Rep

  • 2,914 Points 2k badge 2x thumb
Oh, this is very simple: RingCentral does not currently support sending SMS from toll-free numbers. This limitation is primarily because inability of some carriers to route inbound SMS to toll free numbers.

I suspect that if you try any local company number (if you have one) it will work.

Anton  
Photo of Bob Thompson

Bob Thompson

  • 130 Points 100 badge 2x thumb
OK, I changed my send from number to 16788841809, one of our local numbers.  I am still getting my token logged in as our operator as required (18778897640),  I am still getting a 304 error.  Do I have to change my operator number to a local number as well?
Photo of Anton Nikitin

Anton Nikitin, Official Rep

  • 2,914 Points 2k badge 2x thumb
Bob, according to what I can see, 16788841809 is mapped to ext.124 while your operator extension is 113. Even if you are logged as an operator, you cannot send SMS from other users' direct numbers. In your particular scenario, to be able to send from 16788841809 you need:

- either authenticate as ext.124
- or unassign 16788841809 from ext.124 and make it additional company number 

Anton
Photo of Benjamin Dean

Benjamin Dean, Alum

  • 8,642 Points 5k badge 2x thumb
After you removed 6788841809 from extension 124, did you also assign that number as an additional company number as directed?
Photo of Bob Thompson

Bob Thompson

  • 130 Points 100 badge 2x thumb
Benjamin,I accidentally deleted the 6788841809 phone number so I added a new one to our pool for SMS only use.  The new number is 678-805-0066.  When adding I didn't add to an extension so only other option was to make it the auto-receptionist.  I tried the SMS program and authenticated with this new number, no extension and password and received the desired token.  I tried to send using same number and received the 403 error.
Photo of Benjamin Dean

Benjamin Dean, Alum

  • 8,642 Points 5k badge 2x thumb
I can see you have the correct permissions for your application in DPW, and looking in your account I can see you have that number assigned to the Auto-Receptionist, have assigned your extension (124) as the operator for the auto-receptionist. This means if you want to be able to send SMS using this number, you need to obtain an access_token (authenticate) as your user-extension (124).

An example of what the body of the POST request to /restapi/oauth/token is:

username=<ANY_COMPANY_NUMBER>&password=<124_EXTENSION_PASSWORD>&extension=124

The part you were missing is passing the 'extension' parameter.

Try that, and then use the response's access_token to test sending an SMS (making sure to set the "from" number to be 16788050066).

Let me know if this works as expected.
Photo of Bob Thompson

Bob Thompson

  • 130 Points 100 badge 2x thumb
Finally,

It works now.  Thank you Benjamin for all your help.

Cheers,
Bob
Photo of Benjamin Dean

Benjamin Dean, Alum

  • 8,642 Points 5k badge 2x thumb
My pleasure. Happy to be of service.