question

anshul-goyal4434 avatar image
anshul-goyal4434 asked Tyler Liu commented

How do I setup RingCentral to send-sms and receive IVR call notifications?

Hi,

I am trying to use RingCentral APIs to send SMS messages and listen to IVR notifications.

I have been able to get auth-token from API explorer. But send-sms API is not working.

I have used "~+14136790083" and "~161055004" as accountId in RingCentral but I have been getting this error.


"errors": [ { "errorCode": "CMN-102", "message": "Resource for parameter [accountId] is not found", "parameterName": "accountId" }


Also, I have not been able to understand how exactly RingCentral IVR notifications work. I want to know where can I setup the IVR number for which if it is called my service will receive notifications.

Can someone please help me on send-sms and IVR notifications part.


Thanks,

Anshul


ivr
1 |3000

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

1 Answer

Tyler Liu avatar image
Tyler Liu answered Tyler Liu commented
"~+14136790083" and "~161055004" Seem like phone number instead of accountID.

Could you please post your code?
9 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.

anshul-goyal4434 avatar image anshul-goyal4434 commented ·
I am using API explorer to make send-sms calls here.  https://developer.ringcentral.com/api-explorer/latest/index.html#/!/Messages/sendSMS
0 Likes 0 ·
Tyler Liu avatar image Tyler Liu ♦ commented ·
Please try "~" as accountId.  "~" means the current account that is logged in.
0 Likes 0 ·
anshul-goyal4434 avatar image anshul-goyal4434 commented ·
I am getting "Authorization header is not specified" error.
http://pastebin.com/bW9X45fJ
0 Likes 0 ·
anshul-goyal4434 avatar image anshul-goyal4434 commented ·
Here is the ruby code for it.
require 'ringcentral_sdk'

to_number = '+17737175653'
from_number = '+14136790083'
client2 = RingCentralSdk::REST::Client.new do |config|
  config.server_url = ' https://platform.devtest.ringcentral.com'
  config.app_key = 'GBhRwO0qQV2boFMF4P3Vew'
  config.app_secret = 'ogtU88DzRJSBsgMzjhhumQdJHkLBZxQja0lbi7G6tb2Q'

  config.username = '+14136790083'
  config.extension = ''
  config.password = 'P@ssw0rd'
end

# Create SMS Message
response = client2.messages.sms.create(
  from: from_number,
  to: to_number,
  text: 'Hi there! test message from Anshul'
)
response.status
response.body


I am getting response : "messageStatus"=>"SendingFailed"


0 Likes 0 ·
Tyler Liu avatar image Tyler Liu ♦ commented ·
I am getting "Authorization header is not specified" error.

This is because you skipped the authorization step.  http://ringcentral-api-docs.readthedocs.io/en/latest/oauth/

You need to get a token first, then add it to your HTTP header: "Authorization: Bearer value-of-token"
0 Likes 0 ·
Show more comments

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