question

cfhe-reception1779 avatar image
cfhe-reception1779 asked cfhe-reception1779 commented

I have a very simple VBA program that works perfectly in sandbox,gives Status: 403: Forbidden "FeatureNotAvailabl in production version

I have a very simple SMS program that works within the sandbox, but when I change the URLs (all predefined strings), Phone Number I get a valid access token but Status: 403: Forbidden "FeatureNotAvailabl. I've made sure everything is exactly the same as in the sandbox. It's all in VBA and there are only 3 places to change (Take out devtest from the URL for access token and posting of an SMS and the phone number of the account).

developer sandbox
1 |3000

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

cfhe-reception1779 avatar image
cfhe-reception1779 answered
By the way, the full error message is 
{
  "errorCode" : "FeatureNotAvailable",
  "message" : "Phone number doesn't belong to extension",
  "errors" : [ {
    "errorCode" : "MSG-304",
    "message" : "Phone number doesn't belong to extension"
  } ]

This is the main company number and I have 2 more Ring Central accounts setup exactly like this and they both work fine.
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
When you sent the SMS, you specified a "from" number, which doesn't belong to the user authorized. Which means you cannot send SMS on behalf of others (number).

Could you please confirm? If you still cannot make it work, could you please post the VBA code here?


1 |3000

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

cfhe-reception1779 avatar image
cfhe-reception1779 answered cfhe-reception1779 commented
The "FROM" number is the main company number which is not associated with an extension other than the reception group. This is the exact same code for the other two locations. The access token is granted but the error is MSG-304. Here are some variables defined elsewhere:

RingCentralSMSURI = " https://platform.ringcentral.com/restapi/v1.0/account/~/extension/~/sms";
RingCentralTokenURI = " https://platform.ringcentral.com/restapi/oauth/token";
RingCentralFaxURI = "https://platform.ringcentral.com/restapi/v1.0/account/~/extension/~/fax";

The sToPhone is my personal Cell phone used for testing. normally it is defined in a loop elsewhere which then calls SendSMS



Public Function http_SendSMS(sToPhone As String, sMsg As String) As String

    Dim httpRequest As New MSXML2.XMLHTTP
sToPhone = "+18183103382"
    httpRequest.Open "POST", RingCentralSMSURI, False
   
    httpRequest.setRequestHeader "Authorization", Access_Token 'http_GetAccessToken()
    httpRequest.setRequestHeader "Accept", "application/json"
    httpRequest.setRequestHeader "Content-Length", "323"
    httpRequest.setRequestHeader "Content-Type", "application/json"
   
    httpRequest.Send _
"{" & _
        """to"": [{""phoneNumber"": """ & sToPhone & """}]," & _
        """from"": {""phoneNumber"": ""+15624271700""}," & _
        """text"": """ & sMsg & """" & _
        "}"
   
    Debug.Print "Status: "; CStr(httpRequest.Status); ": "; httpRequest.statusText
'    Debug.Print httpRequest.responseText
    ConvID = Mid(httpRequest.responseText, InStr(1, httpRequest.responseText, """conversationid""") + 19, 19)
    MsgID = Mid(httpRequest.responseText, InStr(1, httpRequest.responseText, """id""") + 7, 12)
    Debug.Print ConvID
End Function



Thank you
5 comments
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 ·
Could you please change the from number to the one which is associated with your authorized extension?  You said the code works in sandbox then it should have no issue. But you should update the from number accordingly in order to make it work in production. 
0 Likes 0 ·
cfhe-reception1779 avatar image cfhe-reception1779 commented ·
I did 3 changes from the sandbox version. I took .devtest out of the the two URL, and I changed the phone number to the main company number.
This is exactly what I did in both previous versions for Orchard Medical Center and Center for Family Health and Education. I dont believe the problem is from my end.
0 Likes 0 ·
ak avatar image ak commented ·

Please note that you would not be able to use the API features in Production if you have a 'Free Tier Developer Account'

You could email the developer support team or submit a support ticket with the Account ( Main company number details ) and we shall assist with you at the earliest.

0 Likes 0 ·
ak avatar image ak commented ·
We received your case, but I would think a read on the below article would solve the issue:
https://devcommunity.ringcentral.com/ringcentraldev/topics/send-sms-error-msg-304

Per the article:

" 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."  
0 Likes 0 ·
cfhe-reception1779 avatar image cfhe-reception1779 commented ·
I am logged in as the company operator. The same login that allows me to get into the administrator portal. The strange thing to me is that this works on my other two accounts but not on this one.
0 Likes 0 ·

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