Skip to content

Latest commit

 

History

History
74 lines (52 loc) · 2.03 KB

BillingApi.md

File metadata and controls

74 lines (52 loc) · 2.03 KB

BillingApi

All URIs are relative to https://api.telnyx.com/v2

Method HTTP request Description
getUserBalance GET /balance Get user balance details

getUserBalance

GetUserBalance200Response getUserBalance()

Get user balance details

Example

// Import classes:
import com.telnyx.sdk.ApiClient;
import com.telnyx.sdk.ApiException;
import com.telnyx.sdk.Configuration;
import com.telnyx.sdk.auth.*;
import com.telnyx.sdk.model.*;
import com.telnyx.sdk.api.BillingApi;

public class Example {
    public static void main(String[] args) {
        ApiClient defaultClient = Configuration.getDefaultApiClient();
        defaultClient.setBasePath("https://api.telnyx.com/v2");
        
        // Configure HTTP bearer authorization: bearerAuth
        HttpBearerAuth bearerAuth = (HttpBearerAuth) defaultClient.getAuthentication("bearerAuth");
        bearerAuth.setBearerToken("BEARER TOKEN");

        BillingApi apiInstance = new BillingApi(defaultClient);
        try {
            GetUserBalance200Response result = apiInstance.getUserBalance();
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling BillingApi#getUserBalance");
            System.err.println("Status code: " + e.getCode());
            System.err.println("Reason: " + e.getResponseBody());
            System.err.println("Response headers: " + e.getResponseHeaders());
            e.printStackTrace();
        }
    }
}

Parameters

This endpoint does not need any parameter.

Return type

GetUserBalance200Response

Authorization

bearerAuth

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

HTTP response details

Status code Description Response headers
200 Get user balance details -
0 Unexpected error -