The Plivo Java helper simplifies the process of making PLIVO API Calls and generating PLIVO XML.
See Plivo Documentation for more information.
Use this if you have issues with conflicting jars in your project. See the pom.xml for the list of dependencies you will need to include.
To generate the final release,
mvn install -Dmaven.test.skip=true
Note: The parameter -Dmaven.test.skip=true will skip all test and generate the release.
Create Stubs for Eclipse
mvn eclipse:eclipse
Create stubs for idea
mvn idea:idea
RestAPI restAPI = new RestAPI("<AUTH_ID>", "<AUTH_TOKEN>", "v1");
LinkedHashMap<String, String> params = new LinkedHashMap<String, String>();
params.put("from", "xxxxxxxxxx");
params.put("to", "xxxxxxxxxx");
params.put("answer_url", "http://server/url/answer.xml");
Call response;
try {
response = restAPI.makeCall(params);
System.out.println(response.apiId);
}
catch (PlivoException e) {
System.out.println(e.getMessage());
}