Installation
To install the stable release
You can use this SDK by adding it as a dependency in your dependency management tool. Alternatively, you can use the JAR file. If you’re using Maven, use this XML code to include the Plivo SDK as a dependency.To install a beta release
You can see the full list of Java SDK releases on GitHub. You can use a beta SDK by adding it as a dependency in your dependency management tool. Alternatively, you can use the JAR file. If you’re using Maven, use this XML code to include the Plivo SDK as a dependency.Note: If you’re already using Retrofit, exclude this SDK’s dependency to avoid version conflict.
Getting started
Authentication
To make API requests, you need to create a Plivo instance and provide it with authentication credentials, which you can find on the Overview page of the Plivo console. We recommend that you store your credentials in the PLIVO_AUTH_ID and the PLIVO_AUTH_TOKEN environment variables, to avoid the possibility of accidentally committing them to source control. If you do this, you can initialize the client with no arguments and it will automatically fetch them from the environment variables:The basics
The SDK uses consistent interfaces to create, retrieve, update, delete, and list resources. The pattern is:Examples
Send a message
Make a call
Generate Plivo XML
Log Level
We’ve introduced a customizable logging mechanism in the Java SDK that enables you to choose the level of logging in your development/production environment.Log-level | Description |
---|---|
NONE | No logs |
BASIC | Logs request and response line |
HEADER | Logs request and response line along with their headers |
BODY | Logs request and response line along with their headers and bodies |