Skip to main content
The official Java SDK for the Vobiz Voice API. Make calls, manage SIP trunks, handle CDR, record calls, configure phone numbers, and more - natively from your Java or JVM backend, with a fully typed builder API. Source code: vobiz-ai/Vobiz-Java-SDK

Installation

Add the dependency once it is published to Maven Central (coordinates ai.vobiz:vobiz-java):
// Gradle
implementation 'ai.vobiz:vobiz-java:1.0.0'
<!-- Maven -->
<dependency>
    <groupId>ai.vobiz</groupId>
    <artifactId>vobiz-java</artifactId>
    <version>1.0.0</version>
</dependency>
Or build from source:
git clone https://github.com/vobiz-ai/Vobiz-Java-SDK.git
cd Vobiz-Java-SDK
gradle build

Authentication

All API calls require your Auth ID and Auth Token, available in the Vobiz Console. Pass your Auth ID to .apiKey() and your Auth Token to .authToken() - the SDK sends them as the X-Auth-ID and X-Auth-Token headers.
import com.vobiz.api.VobizApiClient;

VobizApiClient client = VobizApiClient
    .builder()
    .apiKey(System.getenv("VOBIZ_AUTH_ID"))
    .authToken(System.getenv("VOBIZ_AUTH_TOKEN"))
    .build();

Quick start

Make an outbound call:
import com.vobiz.api.VobizApiClient;
import com.vobiz.api.resources.calls.requests.MakeCallRequest;

public class Example {
    public static void main(String[] args) {
        VobizApiClient client = VobizApiClient
            .builder()
            .apiKey(System.getenv("VOBIZ_AUTH_ID"))
            .authToken(System.getenv("VOBIZ_AUTH_TOKEN"))
            .build();

        client.calls().makeCall(
            "MA_XXXXXX",                       // your account Auth ID
            MakeCallRequest
                .builder()
                .from("14155551234")           // Vobiz-enabled number or SIP URI
                .to("+919876543210")           // destination in E.164 format
                .answerUrl("https://example.com/answer")  // webhook returning VobizXML
                .answerMethod("POST")
                .build()
        );
        System.out.println("Call initiated successfully!");
    }
}

VobizXML

The SDK handles REST interactions only. When a call is answered, Vobiz fetches VobizXML from your answerUrl webhook to control the call:
<Response>
  <Speak voice="WOMAN" language="en-US">Thank you for calling.</Speak>
</Response>

Resources