All URIs are relative to https://api.telnyx.com/v2
Method | HTTP request | Description |
---|---|---|
createBucket | PUT /{bucketName} | CreateBucket |
deleteBucket | DELETE /{bucketName} | DeleteBucket |
headBucket | HEAD /{bucketName} | HeadBucket |
listBuckets | GET / | ListBuckets |
createBucket(bucketName, createBucketRequest)
CreateBucket
Create a bucket.
// 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.BucketApi;
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");
BucketApi apiInstance = new BucketApi(defaultClient);
String bucketName = "mybucket"; // String | The name of the bucket.
CreateBucketRequest createBucketRequest = new CreateBucketRequest(); // CreateBucketRequest |
try {
apiInstance.createBucket(bucketName, createBucketRequest);
} catch (ApiException e) {
System.err.println("Exception when calling BucketApi#createBucket");
System.err.println("Status code: " + e.getCode());
System.err.println("Reason: " + e.getResponseBody());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}
Name | Type | Description | Notes |
---|---|---|---|
bucketName | String | The name of the bucket. | |
createBucketRequest | CreateBucketRequest | [optional] |
null (empty response body)
- Content-Type: text/xml
- Accept: text/xml
Status code | Description | Response headers |
---|---|---|
200 | Success | - |
409 | BucketAlreadyExists | - |
deleteBucket(bucketName)
DeleteBucket
Deletes a bucket. The bucket must be empty for it to be deleted.
// 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.BucketApi;
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");
BucketApi apiInstance = new BucketApi(defaultClient);
String bucketName = "bucketName_example"; // String | The name of the bucket.
try {
apiInstance.deleteBucket(bucketName);
} catch (ApiException e) {
System.err.println("Exception when calling BucketApi#deleteBucket");
System.err.println("Status code: " + e.getCode());
System.err.println("Reason: " + e.getResponseBody());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}
Name | Type | Description | Notes |
---|---|---|---|
bucketName | String | The name of the bucket. |
null (empty response body)
- Content-Type: Not defined
- Accept: Not defined
Status code | Description | Response headers |
---|---|---|
204 | Success | - |
headBucket(bucketName)
HeadBucket
Determines if a bucket exists and you have permission to access it.
// 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.BucketApi;
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");
BucketApi apiInstance = new BucketApi(defaultClient);
String bucketName = "bucketName_example"; // String | The name of the bucket.
try {
apiInstance.headBucket(bucketName);
} catch (ApiException e) {
System.err.println("Exception when calling BucketApi#headBucket");
System.err.println("Status code: " + e.getCode());
System.err.println("Reason: " + e.getResponseBody());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}
Name | Type | Description | Notes |
---|---|---|---|
bucketName | String | The name of the bucket. |
null (empty response body)
- Content-Type: Not defined
- Accept: Not defined
Status code | Description | Response headers |
---|---|---|
200 | Success | - |
404 | NoSuchBucket | - |
ListBucketsResponse listBuckets()
ListBuckets
List all Buckets.
// 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.BucketApi;
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");
BucketApi apiInstance = new BucketApi(defaultClient);
try {
ListBucketsResponse result = apiInstance.listBuckets();
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling BucketApi#listBuckets");
System.err.println("Status code: " + e.getCode());
System.err.println("Reason: " + e.getResponseBody());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}
This endpoint does not need any parameter.
- Content-Type: Not defined
- Accept: text/xml
Status code | Description | Response headers |
---|---|---|
200 | Success | - |