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, Glip Team Messaging, Data and Configurations.
API Reference and APIs Explorer.
repositories {
jcenter()
}
dependencies {
compile 'com.ringcentral:ringcentral:[version]'
}
Don't forget to replace [version]
with expected version.
<repositories>
<repository>
<id>jcenter</id>
<url>https://jcenter.bintray.com/</url>
</repository>
</repositories>
<dependency>
<groupId>com.ringcentral</groupId>
<artifactId>ringcentral</artifactId>
<version>[version]</version>
</dependency>
Don't forget to replace [version]
with expected version.
Download jar here and save it into your java classpath.
RestClient rc = new RestClient(clientId, clientSecret, server);
rc.authorize(username, extension, password);
// do something with `rc`
rc.revoke();
For the server
parameter, there are two static final string variables in RestClient
:
public static final String SANDBOX_SERVER = "https://platform.devtest.ringcentral.com";
public static final String PRODUCTION_SERVER = "https://platform.ringcentral.com";
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.
Please refer to the RingCentral PubNub SDK for Java project.