RingCentral Connection
Connect and manage the tenant's RingCentral account via OAuth Authorization Code flow.
/v1/rc/connect-tokenapp or adminGenerate a single-use token to start the OAuth flow.
Returns a connectUrl path. Prepend the API base URL and open it in a browser to start the RingCentral authorization flow.
curl -X POST https://smsgateway-api.onrender.com/v1/rc/connect-token \-H "Authorization: Bearer YOUR_API_KEY"
Success response
{"connectUrl": "/v1/rc/connect?token=abc123def456..."}
Error responses
{"error": "Too many requests"}
/v1/rc/connectNone (token in query)Start the OAuth flow. Redirects to RingCentral authorization page.
Open this URL in a browser. The gateway validates the token, then issues a 302 redirect to RingCentral's OAuth authorization page.
https://smsgateway-api.onrender.com/v1/rc/connect?token=abc123def456...
Error responses
{"error": "Missing token"}
{"error": "Invalid or expired token"}
/v1/rc/callbackNone (OAuth redirect)OAuth callback. Exchanges the authorization code for tokens.
This endpoint is called by RingCentral after the user authorizes the gateway. It exchanges the authorization code for access and refresh tokens, stores them encrypted, discovers the tenant's phone numbers, and creates a webhook subscription for inbound SMS.
By default, the callback returns an HTML page confirming success or failure. Add format=json to receive JSON instead.
Success response (JSON)
{"ok": true}
Error responses
{"error": "Missing code or state parameter"}
/v1/rc/statusapp or adminCheck whether the tenant has a connected RingCentral account.
curl https://smsgateway-api.onrender.com/v1/rc/status \-H "Authorization: Bearer YOUR_API_KEY"
Success response (connected)
{"connected": true,"expiresAt": "2026-04-01T12:00:00.000Z","rcAccountId": "000000000"}
Success response (not connected)
{"connected": false}
/v1/rc/disconnectapp or adminDisconnect the tenant's RingCentral account.
Removes the webhook subscription, clears cached phone numbers, deletes stored credentials, and evicts the RingCentral SDK instance. After disconnecting, SMS cannot be sent or received until a new account is connected.
curl -X POST https://smsgateway-api.onrender.com/v1/rc/disconnect \-H "Authorization: Bearer YOUR_API_KEY"
Success response
{"ok": true}
Related docs
- Connecting RingCentral Guide — Step-by-step OAuth walkthrough
- Quickstart — Connect and send your first SMS