All URIs are relative to https://api.mux.com
Method | HTTP request | Description |
---|---|---|
cancelDirectUpload | PUT /video/v1/uploads/{UPLOAD_ID}/cancel | Cancel a direct upload |
createDirectUpload | POST /video/v1/uploads | Create a new direct upload URL |
getDirectUpload | GET /video/v1/uploads/{UPLOAD_ID} | Retrieve a single direct upload's info |
listDirectUploads | GET /video/v1/uploads | List direct uploads |
UploadResponse cancelDirectUpload(UPLOAD_ID).execute();
Cancel a direct upload
Cancels a direct upload and marks it as cancelled. If a pending upload finishes after this request, no asset will be created. This request will only succeed if the upload is still in the `waiting` state.
// Import classes:
import com.mux.ApiClient;
import com.mux.ApiException;
import com.mux.Configuration;
import com.mux.auth.*;
import com.mux.models.*;
import com.mux.sdk.DirectUploadsApi;
public class Example {
public static void main(String[] args) {
ApiClient defaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("https://api.mux.com");
// Configure HTTP basic authorization: accessToken
HttpBasicAuth accessToken = (HttpBasicAuth) defaultClient.getAuthentication("accessToken");
accessToken.setUsername("YOUR USERNAME");
accessToken.setPassword("YOUR PASSWORD");
DirectUploadsApi apiInstance = new DirectUploadsApi(defaultClient);
String UPLOAD_ID = "abcd1234"; // String | ID of the Upload
try {
UploadResponse result = apiInstance.cancelDirectUpload(UPLOAD_ID)
.execute();
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling DirectUploadsApi#cancelDirectUpload");
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 |
---|---|---|---|
UPLOAD_ID | String | ID of the Upload |
- Content-Type: Not defined
- Accept: application/json
Status code | Description | Response headers |
---|---|---|
200 | OK | - |
403 | Cancellation no longer possible | - |
UploadResponse createDirectUpload(createUploadRequest).execute();
Create a new direct upload URL
Creates a new direct upload, through which video content can be uploaded for ingest to Mux.
// Import classes:
import com.mux.ApiClient;
import com.mux.ApiException;
import com.mux.Configuration;
import com.mux.auth.*;
import com.mux.models.*;
import com.mux.sdk.DirectUploadsApi;
public class Example {
public static void main(String[] args) {
ApiClient defaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("https://api.mux.com");
// Configure HTTP basic authorization: accessToken
HttpBasicAuth accessToken = (HttpBasicAuth) defaultClient.getAuthentication("accessToken");
accessToken.setUsername("YOUR USERNAME");
accessToken.setPassword("YOUR PASSWORD");
DirectUploadsApi apiInstance = new DirectUploadsApi(defaultClient);
CreateUploadRequest createUploadRequest = {"cors_origin":"https://example.com/","new_asset_settings":{"playback_policy":["public"]}}; // CreateUploadRequest |
try {
UploadResponse result = apiInstance.createDirectUpload(createUploadRequest)
.execute();
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling DirectUploadsApi#createDirectUpload");
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 |
---|---|---|---|
createUploadRequest | CreateUploadRequest |
- Content-Type: application/json
- Accept: application/json
Status code | Description | Response headers |
---|---|---|
201 | Created | - |
UploadResponse getDirectUpload(UPLOAD_ID).execute();
Retrieve a single direct upload's info
Fetches information about a single direct upload in the current environment.
// Import classes:
import com.mux.ApiClient;
import com.mux.ApiException;
import com.mux.Configuration;
import com.mux.auth.*;
import com.mux.models.*;
import com.mux.sdk.DirectUploadsApi;
public class Example {
public static void main(String[] args) {
ApiClient defaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("https://api.mux.com");
// Configure HTTP basic authorization: accessToken
HttpBasicAuth accessToken = (HttpBasicAuth) defaultClient.getAuthentication("accessToken");
accessToken.setUsername("YOUR USERNAME");
accessToken.setPassword("YOUR PASSWORD");
DirectUploadsApi apiInstance = new DirectUploadsApi(defaultClient);
String UPLOAD_ID = "abcd1234"; // String | ID of the Upload
try {
UploadResponse result = apiInstance.getDirectUpload(UPLOAD_ID)
.execute();
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling DirectUploadsApi#getDirectUpload");
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 |
---|---|---|---|
UPLOAD_ID | String | ID of the Upload |
- Content-Type: Not defined
- Accept: application/json
Status code | Description | Response headers |
---|---|---|
200 | OK | - |
ListUploadsResponse listDirectUploads().limit(limit).page(page).execute();
List direct uploads
Lists direct uploads in the current environment.
// Import classes:
import com.mux.ApiClient;
import com.mux.ApiException;
import com.mux.Configuration;
import com.mux.auth.*;
import com.mux.models.*;
import com.mux.sdk.DirectUploadsApi;
public class Example {
public static void main(String[] args) {
ApiClient defaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("https://api.mux.com");
// Configure HTTP basic authorization: accessToken
HttpBasicAuth accessToken = (HttpBasicAuth) defaultClient.getAuthentication("accessToken");
accessToken.setUsername("YOUR USERNAME");
accessToken.setPassword("YOUR PASSWORD");
DirectUploadsApi apiInstance = new DirectUploadsApi(defaultClient);
Integer limit = 25; // Integer | Number of items to include in the response
Integer page = 1; // Integer | Offset by this many pages, of the size of `limit`
try {
ListUploadsResponse result = apiInstance.listDirectUploads()
.limit(limit)
.page(page)
.execute();
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling DirectUploadsApi#listDirectUploads");
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 |
---|---|---|---|
limit | Integer | Number of items to include in the response | [optional] [default to 25] |
page | Integer | Offset by this many pages, of the size of `limit` | [optional] [default to 1] |
- Content-Type: Not defined
- Accept: application/json
Status code | Description | Response headers |
---|---|---|
200 | OK | - |