Skip to content

Bandwidth/java-sdk

Repository files navigation

bandwidth-sdk

Bandwidth

  • API version: 1.0.0
    • Generator version: 7.6.0

Bandwidth's Communication APIs

For more information, please visit https://dev.bandwidth.com

Automatically generated by the OpenAPI Generator

Requirements

Building the API client library requires:

  1. Java 1.8+
  2. Maven (3.8.3+)/Gradle (7.2+)

Installation

To install the API client library to your local Maven repository, simply execute:

mvn clean install

To deploy it to a remote Maven repository instead, configure the settings of the repository and execute:

mvn clean deploy

Refer to the OSSRH Guide for more information.

Maven users

Add this dependency to your project's POM:

<dependency>
  <groupId>com.bandwidth.sdk</groupId>
  <artifactId>bandwidth-sdk</artifactId>
  <version>10.1.0</version>
  <scope>compile</scope>
</dependency>

Gradle users

Add this dependency to your project's build file:

  repositories {
    mavenCentral()     // Needed if the 'bandwidth-sdk' jar has been published to maven central.
    mavenLocal()       // Needed if the 'bandwidth-sdk' jar has been published to the local maven repo.
  }

  dependencies {
     implementation "com.bandwidth.sdk:bandwidth-sdk:10.1.0"
  }

Others

At first generate the JAR by executing:

mvn clean package

Then manually install the following JARs:

  • target/bandwidth-sdk-10.1.0.jar
  • target/lib/*.jar

Getting Started

Please follow the installation instruction and execute the following Java code:

// Import classes:
import com.bandwidth.sdk.ApiClient;
import com.bandwidth.sdk.ApiException;
import com.bandwidth.sdk.Configuration;
import com.bandwidth.sdk.auth.*;
import com.bandwidth.sdk.models.*;
import com.bandwidth.sdk.api.CallsApi;

public class Example {
  public static void main(String[] args) {
    ApiClient defaultClient = Configuration.getDefaultApiClient();
    defaultClient.setBasePath("http://localhost");
    
    // Configure HTTP basic authorization: Basic
    HttpBasicAuth Basic = (HttpBasicAuth) defaultClient.getAuthentication("Basic");
    Basic.setUsername("YOUR USERNAME");
    Basic.setPassword("YOUR PASSWORD");

    CallsApi apiInstance = new CallsApi(defaultClient);
    String accountId = "9900000"; // String | Your Bandwidth Account ID.
    CreateCall createCall = new CreateCall(); // CreateCall | JSON object containing information to create an outbound call
    try {
      CreateCallResponse result = apiInstance.createCall(accountId, createCall);
      System.out.println(result);
    } catch (ApiException e) {
      System.err.println("Exception when calling CallsApi#createCall");
      System.err.println("Status code: " + e.getCode());
      System.err.println("Reason: " + e.getResponseBody());
      System.err.println("Response headers: " + e.getResponseHeaders());
      e.printStackTrace();
    }
  }
}

Documentation for API Endpoints

All URIs are relative to http://localhost

Class Method HTTP request Description
CallsApi createCall POST /accounts/{accountId}/calls Create Call
CallsApi getCallState GET /accounts/{accountId}/calls/{callId} Get Call State Information
CallsApi listCalls GET /accounts/{accountId}/calls Get Calls
CallsApi updateCall POST /accounts/{accountId}/calls/{callId} Update Call
CallsApi updateCallBxml PUT /accounts/{accountId}/calls/{callId}/bxml Update Call BXML
ConferencesApi downloadConferenceRecording GET /accounts/{accountId}/conferences/{conferenceId}/recordings/{recordingId}/media Download Conference Recording
ConferencesApi getConference GET /accounts/{accountId}/conferences/{conferenceId} Get Conference Information
ConferencesApi getConferenceMember GET /accounts/{accountId}/conferences/{conferenceId}/members/{memberId} Get Conference Member
ConferencesApi getConferenceRecording GET /accounts/{accountId}/conferences/{conferenceId}/recordings/{recordingId} Get Conference Recording Information
ConferencesApi listConferenceRecordings GET /accounts/{accountId}/conferences/{conferenceId}/recordings Get Conference Recordings
ConferencesApi listConferences GET /accounts/{accountId}/conferences Get Conferences
ConferencesApi updateConference POST /accounts/{accountId}/conferences/{conferenceId} Update Conference
ConferencesApi updateConferenceBxml PUT /accounts/{accountId}/conferences/{conferenceId}/bxml Update Conference BXML
ConferencesApi updateConferenceMember PUT /accounts/{accountId}/conferences/{conferenceId}/members/{memberId} Update Conference Member
MediaApi deleteMedia DELETE /users/{accountId}/media/{mediaId} Delete Media
MediaApi getMedia GET /users/{accountId}/media/{mediaId} Get Media
MediaApi listMedia GET /users/{accountId}/media List Media
MediaApi uploadMedia PUT /users/{accountId}/media/{mediaId} Upload Media
MessagesApi createMessage POST /users/{accountId}/messages Create Message
MessagesApi listMessages GET /users/{accountId}/messages List Messages
MfaApi generateMessagingCode POST /accounts/{accountId}/code/messaging Messaging Authentication Code
MfaApi generateVoiceCode POST /accounts/{accountId}/code/voice Voice Authentication Code
MfaApi verifyCode POST /accounts/{accountId}/code/verify Verify Authentication Code
PhoneNumberLookupApi createLookup POST /accounts/{accountId}/tnlookup Create Lookup
PhoneNumberLookupApi getLookupStatus GET /accounts/{accountId}/tnlookup/{requestId} Get Lookup Request Status
RecordingsApi deleteRecording DELETE /accounts/{accountId}/calls/{callId}/recordings/{recordingId} Delete Recording
RecordingsApi deleteRecordingMedia DELETE /accounts/{accountId}/calls/{callId}/recordings/{recordingId}/media Delete Recording Media
RecordingsApi deleteRecordingTranscription DELETE /accounts/{accountId}/calls/{callId}/recordings/{recordingId}/transcription Delete Transcription
RecordingsApi downloadCallRecording GET /accounts/{accountId}/calls/{callId}/recordings/{recordingId}/media Download Recording
RecordingsApi getCallRecording GET /accounts/{accountId}/calls/{callId}/recordings/{recordingId} Get Call Recording
RecordingsApi getRecordingTranscription GET /accounts/{accountId}/calls/{callId}/recordings/{recordingId}/transcription Get Transcription
RecordingsApi listAccountCallRecordings GET /accounts/{accountId}/recordings Get Call Recordings
RecordingsApi listCallRecordings GET /accounts/{accountId}/calls/{callId}/recordings List Call Recordings
RecordingsApi transcribeCallRecording POST /accounts/{accountId}/calls/{callId}/recordings/{recordingId}/transcription Create Transcription Request
RecordingsApi updateCallRecordingState PUT /accounts/{accountId}/calls/{callId}/recording Update Recording
StatisticsApi getStatistics GET /accounts/{accountId}/statistics Get Account Statistics
TranscriptionsApi deleteRealTimeTranscription DELETE /accounts/{accountId}/calls/{callId}/transcriptions/{transcriptionId} Delete a specific transcription
TranscriptionsApi getRealTimeTranscription GET /accounts/{accountId}/calls/{callId}/transcriptions/{transcriptionId} Retrieve a specific transcription
TranscriptionsApi listRealTimeTranscriptions GET /accounts/{accountId}/calls/{callId}/transcriptions Enumerate transcriptions made with StartTranscription

Documentation for Models

Documentation for Authorization

Authentication schemes defined for the API:

Basic

  • Type: HTTP basic authentication

Recommendation

It's recommended to create an instance of ApiClient per thread in a multithreaded environment to avoid any potential issues.

Author

letstalk@bandwidth.com