All URIs are relative to https://api.telnyx.com/v2
Method | HTTP request | Description |
---|---|---|
createMediaStorage | POST /media | Upload media |
deleteMediaStorage | DELETE /media/{media_name} | Deletes stored media |
downloadMedia | GET /media/{media_name}/download | Download stored media |
getMediaStorage | GET /media/{media_name} | Retrieve stored media |
listMediaStorage | GET /media | List uploaded media |
updateMediaStorage | PUT /media/{media_name} | Update stored media |
MediaResourceResponse createMediaStorage(uploadMediaRequest)
Upload media
Upload media file to Telnyx so it can be used with other Telnyx services
// 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.MediaStorageApiApi;
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");
MediaStorageApiApi apiInstance = new MediaStorageApiApi(defaultClient);
UploadMediaRequest uploadMediaRequest = new UploadMediaRequest(); // UploadMediaRequest | Upload media request
try {
MediaResourceResponse result = apiInstance.createMediaStorage(uploadMediaRequest);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling MediaStorageApiApi#createMediaStorage");
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 |
---|---|---|---|
uploadMediaRequest | UploadMediaRequest | Upload media request |
- Content-Type: application/json, multipart/form-data
- Accept: application/json
Status code | Description | Response headers |
---|---|---|
201 | A response describing a media resource | - |
0 | Unexpected error | - |
deleteMediaStorage(mediaName)
Deletes stored media
Deletes a stored media file.
// 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.MediaStorageApiApi;
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");
MediaStorageApiApi apiInstance = new MediaStorageApiApi(defaultClient);
String mediaName = "mediaName_example"; // String | Uniquely identifies a media resource.
try {
apiInstance.deleteMediaStorage(mediaName);
} catch (ApiException e) {
System.err.println("Exception when calling MediaStorageApiApi#deleteMediaStorage");
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 |
---|---|---|---|
mediaName | String | Uniquely identifies a media resource. |
null (empty response body)
- Content-Type: Not defined
- Accept: application/json
Status code | Description | Response headers |
---|---|---|
204 | The media was deleted successfully. | - |
0 | Unexpected error | - |
File downloadMedia(mediaName)
Download stored media
Downloads a stored media file.
// 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.MediaStorageApiApi;
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");
MediaStorageApiApi apiInstance = new MediaStorageApiApi(defaultClient);
String mediaName = "mediaName_example"; // String | Uniquely identifies a media resource.
try {
File result = apiInstance.downloadMedia(mediaName);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling MediaStorageApiApi#downloadMedia");
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 |
---|---|---|---|
mediaName | String | Uniquely identifies a media resource. |
- Content-Type: Not defined
- Accept: /, application/json
Status code | Description | Response headers |
---|---|---|
200 | A response describing a media resource | - |
0 | Unexpected error | - |
MediaResourceResponse getMediaStorage(mediaName)
Retrieve stored media
Returns the information about a stored media file.
// 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.MediaStorageApiApi;
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");
MediaStorageApiApi apiInstance = new MediaStorageApiApi(defaultClient);
String mediaName = "mediaName_example"; // String | Uniquely identifies a media resource.
try {
MediaResourceResponse result = apiInstance.getMediaStorage(mediaName);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling MediaStorageApiApi#getMediaStorage");
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 |
---|---|---|---|
mediaName | String | Uniquely identifies a media resource. |
- Content-Type: Not defined
- Accept: application/json
Status code | Description | Response headers |
---|---|---|
200 | A response describing a media resource | - |
0 | Unexpected error | - |
ListOfMediaResourcesResponse listMediaStorage(filterContentType)
List uploaded media
Returns a list of stored media files.
// 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.MediaStorageApiApi;
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");
MediaStorageApiApi apiInstance = new MediaStorageApiApi(defaultClient);
String filterContentType = "application_xml"; // String | Filters files by given content types
try {
ListOfMediaResourcesResponse result = apiInstance.listMediaStorage(filterContentType);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling MediaStorageApiApi#listMediaStorage");
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 |
---|---|---|---|
filterContentType | String | Filters files by given content types | [optional] |
- Content-Type: Not defined
- Accept: application/json
Status code | Description | Response headers |
---|---|---|
200 | A response with a list of media resources | - |
0 | Unexpected error | - |
MediaResourceResponse updateMediaStorage(mediaName, updateMediaRequest)
Update stored media
Updates a stored media file.
// 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.MediaStorageApiApi;
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");
MediaStorageApiApi apiInstance = new MediaStorageApiApi(defaultClient);
String mediaName = "mediaName_example"; // String | Uniquely identifies a media resource.
UpdateMediaRequest updateMediaRequest = new UpdateMediaRequest(); // UpdateMediaRequest | Update media request
try {
MediaResourceResponse result = apiInstance.updateMediaStorage(mediaName, updateMediaRequest);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling MediaStorageApiApi#updateMediaStorage");
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 |
---|---|---|---|
mediaName | String | Uniquely identifies a media resource. | |
updateMediaRequest | UpdateMediaRequest | Update media request |
- Content-Type: application/json, multipart/form-data
- Accept: application/json
Status code | Description | Response headers |
---|---|---|
200 | A response describing a media resource | - |
0 | Unexpected error | - |