RingCentral Legacy API Proxy
This is a proxy service that allows apps using RingCentral's legacy RPC APIs to use the new RingCentral REST APIs seamlessly. End-of-Life for the legacy APIs is targeted for the 10.2 release, August 9, 2018. Use of this proxy can enable your app to use the new REST APIs with the same interface as the legacy RPC APIs.
The following is a list of legacy API calls. The ones with checks are currently supported:
Note: a new query string parameter is provided, format=json
, which instructs the service to return the REST API JSON response. If this is not provided, the response is converted to a legacy API response.
TL;DR
Install this app with the following quick steps:
- Login to Developer Portal: https://developer.ringcentral.com
- Create an app with "Platform Type"
Server-only (No UI)
.
- Select permissions required:
RingOut
for RingOut call
; ReadAccounts
for RingOut list
and Faxes
for FaxOut
- Save sandbox
Client ID
, Client Secret
- Click
Deploy to Heroku
below. Use Sandbox Client ID and Client Secret with the server URL: https://platform.devtest.ringcentral.com .
- Run API calls until you can gradate your app.
- Click to graduate your app
- Update your Heroku environment variables or create a 2nd Heroku app
- Run in production
Caveats
- The RingCentral REST API is subject to Rate Limits:
https://developer.ringcentral.com/api-docs/latest/index.html#!#APIRateLimits.html
Contact us if your app is running into these limits.
Prerequisites
Create a RingCentral app at the developer portal: https://developer.ringcentral.com. Access is included with many RingCentral accoutns so just click 'Sign in' to continue.
Create an app with the following setting.
App Type
: Server-only (No UI)
Ensure that Password grant
is set.
Select the permissions you need. There are a total of three permissions for all legacy APIs, but you should just select the ones you need as you will need to exercise all the permissions to graduate your app.
Permission |
Required for |
RingOut |
RingOut call , status , cancel |
ReadAccounts |
RingOut list |
Faxes |
FaxOut |
Configuration
This application needs the following configuration variables:
Installation
Deploying to Heroku
$ heroku create
$ git push heroku master
$ heroku open
or
After you click the button above, you will need to enter the environment variables above into the Heroku web console.
Once this is up, you can make API calls by swapping service.ringcentral.com
for your Heroku hostname, e.g. myherokuapp.herokuapp.com
as follows:
https://<myHerokuApp>.herokuapp.com/ringout.asp?cmd=call&username=<myUsername>&password=<myPassword>&to=<myToNumber>&from=<myFromNumber>
Note: the app.json
specifies a free dyno which will sleep due to inactivity. If you wish to use Heroku dyno that does not sleeps, clone this repo and update your app.json
. Learn more about Heroku Dyno types here:
Running Locally
$ go get github.com/grokify/ringcentral-legacy-api-proxy
$ cd ringcentral-legacy-api-proxy
$ go build main.go
$ RINGCENTRAL_SERVER_URL=https://platform.devtest.ringcentral.com \
RINGCENTRAL_CLIENT_ID=<myClientId> \
RINGCENTRAL_CLIENT_SECRET=<myClientSecret> \
main
Example API Calls
RingOut call
$ curl -XGET 'http://localhost:8080/ringout.asp?Username=<myUsername>&Password=<myPassword>&Cmd=call&to=<toNumber>&from=<fromNumver>&Format=json'
RingOut list
$ curl -XGET 'http://localhost:8080/ringout.asp?Username=<myUsername>&Password=<myPassword>&Cmd=list&Format=json'
FaxOut
$ curl -XPOST 'http://localhost:8080/faxout.asp' \
-F 'Username=<myUsername>' \
-F 'Password=<myPassword>' \
-F 'Recipient=<recipient>' \
-F 'Coverpagetext=<coverPageText>' \
-F 'Resolution=High' \
-F 'Attachment=@test_file.pdf' \
-F 'Format=json'
Notes
Troubleshooting
The REST API has throttling built in so you should check for 429 throttling errors.
Maintenance
Rebuild vendor
directory with:
$ godep save ./...
More information on deploying Go on Heroku here: