Skip to content

Latest commit

 

History

History
219 lines (159 loc) · 6.65 KB

CsvDownloadsApi.md

File metadata and controls

219 lines (159 loc) · 6.65 KB

CsvDownloadsApi

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

Method HTTP request Description
createCsvDownload POST /phone_numbers/csv_downloads Create a CSV download
getCsvDownload GET /phone_numbers/csv_downloads/{id} Retrieve a CSV download
listCsvDownloads GET /phone_numbers/csv_downloads List CSV downloads

createCsvDownload

CSVDownloadResponse createCsvDownload()

Create a CSV download

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.CsvDownloadsApi;

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");

        CsvDownloadsApi apiInstance = new CsvDownloadsApi(defaultClient);
        try {
            CSVDownloadResponse result = apiInstance.createCsvDownload();
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling CsvDownloadsApi#createCsvDownload");
            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

CSVDownloadResponse

Authorization

bearerAuth

HTTP request headers

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

HTTP response details

Status code Description Response headers
200 Successful response with details about a CSV download. -
0 Unexpected error -

getCsvDownload

CSVDownloadResponse getCsvDownload(id)

Retrieve a CSV download

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.CsvDownloadsApi;

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");

        CsvDownloadsApi apiInstance = new CsvDownloadsApi(defaultClient);
        String id = "id_example"; // String | Identifies the CSV download.
        try {
            CSVDownloadResponse result = apiInstance.getCsvDownload(id);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling CsvDownloadsApi#getCsvDownload");
            System.err.println("Status code: " + e.getCode());
            System.err.println("Reason: " + e.getResponseBody());
            System.err.println("Response headers: " + e.getResponseHeaders());
            e.printStackTrace();
        }
    }
}

Parameters

Name Type Description Notes
id String Identifies the CSV download.

Return type

CSVDownloadResponse

Authorization

bearerAuth

HTTP request headers

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

HTTP response details

Status code Description Response headers
200 Successful response with details about a CSV download. -
0 Unexpected error -

listCsvDownloads

ListCSVDownloadsResponse listCsvDownloads().pageNumber(pageNumber).pageSize(pageSize).execute();

List CSV downloads

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.CsvDownloadsApi;

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");

        CsvDownloadsApi apiInstance = new CsvDownloadsApi(defaultClient);
        Integer pageNumber = 1; // Integer | The page number to load
        Integer pageSize = 20; // Integer | The size of the page
        try {
            ListCSVDownloadsResponse result = api.listCsvDownloads()
                .pageNumber(pageNumber)
                .pageSize(pageSize)
                .execute();
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling CsvDownloadsApi#listCsvDownloads");
            System.err.println("Status code: " + e.getCode());
            System.err.println("Reason: " + e.getResponseBody());
            System.err.println("Response headers: " + e.getResponseHeaders());
            e.printStackTrace();
        }
    }
}

Parameters

Name Type Description Notes
pageNumber Integer The page number to load [optional] [default to 1]
pageSize Integer The size of the page [optional] [default to 20]

Return type

ListCSVDownloadsResponse

Authorization

bearerAuth

HTTP request headers

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

HTTP response details

Status code Description Response headers
200 Successful response with a list of CSV downloads. -
0 Unexpected error -