RingCentral Developers is a cloud communications platform which can be accessed via more than 70 APIs. The platform's main capabilities include technologies that enable:
- Voice
- SMS/MMS
- Fax
- Team Messaging
- Data and Configurations
- Video
- RingSense AI
- Webinar
- Business Analytics.
- RingCentral API Reference - an interactive reference for the RingCentral API that allows developers to make API calls with no code.
- Document - an interactive reference for the SDK code documentation.
If you are having difficulty using this SDK, or working with the RingCentral API, please visit our developer community forums for help and to get quick answers to your questions. If you wish to contact the RingCentral Developer Support team directly, please submit a help ticket from our developer website.
This SDK is tested against JDK 11 so we recommend using the same. Earlier versions such as Java 8 should work as well, please report issues if you encounter any.
repositories {
mavenCentral()
}
dependencies {
implementation 'com.ringcentral:ringcentral:[version]'
}
Don't forget to replace [version]
with expected version. You can find the latest versions
in Maven Central.
<dependency>
<groupId>com.ringcentral</groupId>
<artifactId>ringcentral</artifactId>
<version>[version]</version>
</dependency>
Don't forget to replace [version]
with expected version. You can find the latest versions
in Maven Central.
Download jar here and save it into your java classpath.
RestClient rc = new RestClient(clientId, clientSecret, server);
rc.authorize(jwtToken);
// do something with `rc`
rc.revoke();
For the server
parameter, there are two static final string variables in RestClient
:
public static final String PRODUCTION_SERVER = "https://platform.ringcentral.com";
Each app you build must first be registered in the RingCentral Developer Console. Upon doing so, you will receive a Client ID and Client Secret that together uniquely identify your application on our platform. A public app could be used by many companies while a private app can only be used by your current company.
Since 1.0 version, the SDK by default does NOT do auto token refresh.
This is because most of the time it's better to manage token lifecycle manually: rc.refresh()
.
For simple apps, token auto refresh could be beneficial. So we provide a sugar method: rc.autoRefresh()
.
This method will start a background timer to refresh token for you every 30 minutes.
You can customize the refresh period, for example, change it to every 50 minutes: rc.autoRefresh(1000 * 60 * 50)
.
You can find sample code for all the endpoints.
There is also lots of useful code for your reference in our test cases.
The logging is implemented according to Java Logging Overview
To enable printing log to the console:
RestClient.logger.setLevel(Level.FINE);
For more log output channels, please refer to Handlers .
Some sample code for binary content downloading may not work.
Because RingCentral is gradually migrating binary content to CDN such as media.ringcentral.com
.
For example, to download the attachment of a fax:
// `message` is the fax message object
byte[] content = rc.get<byte[]>(message.attachments[0].uri).bytes();
The following does NOT work:
// `message` is the fax message object
byte[] content = rc.restapi().account().extension().messageStore(message.id).content(message.attachments[0].id).get();
But not all binary content has been migrated to CDN. If the resource to download provides you with a CDN uri, use that CDN uri. If there is no CDN uri provided, construct the uri as the sample code shows.
Please refer to the RingCentral WebSocket SDK for Java project.
Please refer to the RingCentral PubNub SDK for Java project.
We have renamed all "glip" to "team-messaging/v1". For example:
rc.restapi().glip()...
becomes
rc.teamMessaging().v1()...