https://github.com/voximplant/apiclient-java
Voximplant Management API Java client library
https://github.com/voximplant/apiclient-java
management-api voximplant
Last synced: 12 days ago
JSON representation
Voximplant Management API Java client library
- Host: GitHub
- URL: https://github.com/voximplant/apiclient-java
- Owner: voximplant
- License: apache-2.0
- Created: 2020-08-31T08:35:37.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2025-04-21T12:10:13.000Z (29 days ago)
- Last Synced: 2025-05-08T22:57:09.317Z (12 days ago)
- Topics: management-api, voximplant
- Language: Java
- Homepage:
- Size: 1.06 MB
- Stars: 3
- Watchers: 9
- Forks: 4
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Voximplant API client library
#### Version 2.1.0
## Prerequisites
In order to use the Voximplant Java SDK, you need the following:
1. A developer account. If you don't have one, [sign up here](https://voximplant.com/sign-up/).
1. A private API key. There are 2 options to obtain it:
1. Either generate it in the [Voximplant Control panel](https://manage.voximplant.com/settings/service_accounts)
1. Or call the [CreateKey](https://voximplant.com/docs/references/httpapi/managing_role_system#createkey) HTTP API
method with the
specified [authentication parameters](https://voximplant.com/docs/references/httpapi/auth_parameters). You'll
receive a response with the __result__ field in it. Save the __result__ value in a file (since we don't store the
keys, save it securely on your side).
1. JDK 8 and above## How to use
Setup a `maven` dependency for your project:
```xml
com.voximplant
apiclient
2.1.0```
Next, specify the path to the JSON service account file in the constructor.
```java
VoximplantAPIClient api=new VoximplantAPIClient("/path/to/credentials.json");
```## Examples
### Get a call history item
```java
VoximplantAPIClient api=new VoximplantAPIClient("/path/to/credentials.json");SimpleDateFormat df=new SimpleDateFormat("yyyy-MM-dd");
GetCallHistoryResponse callHistory=api.getCallHistory(new GetCallHistoryRequest()
.setFromDate(df.parse("2020-09-01"))
.setToDate(df.parse("2020-10-01"))
.setCount(1));CallSessionInfoType[]callSessions=callHistory.getResult();
if(callSessions.length==1){
CallSessionInfoType result=callSessions[0];
}
```### Send an SMS
```java
VoximplantAPIClient api=new VoximplantAPIClient("/path/to/credentials.json");SendSmsMessageResponse sendSmsMessageResponse=api.sendSmsMessage(new SendSmsMessageRequest()
.setSource("447443332211")
.setDestination("447443332212")
.setSmsBody("Test message"));if(sendSmsMessageResponse.hasResult()){
long result=sendSmsMessageResponse.getResult();
}else{
throw new IllegalArgumentException(sendSmsMessageResponse.getError().getMsg());
}
```