All URIs are relative to https://api.mux.com, except if the operation defines another base path.
Method | HTTP request | Description |
---|---|---|
createSpace() | POST /video/v1/spaces | Create a space |
createSpaceBroadcast() | POST /video/v1/spaces/{SPACE_ID}/broadcasts | Create a space broadcast |
deleteSpace() | DELETE /video/v1/spaces/{SPACE_ID} | Delete a space |
deleteSpaceBroadcast() | DELETE /video/v1/spaces/{SPACE_ID}/broadcasts/{BROADCAST_ID} | Delete a space broadcast |
getSpace() | GET /video/v1/spaces/{SPACE_ID} | Retrieve a space |
getSpaceBroadcast() | GET /video/v1/spaces/{SPACE_ID}/broadcasts/{BROADCAST_ID} | Retrieve space broadcast |
listSpaces() | GET /video/v1/spaces | List spaces |
startSpaceBroadcast() | POST /video/v1/spaces/{SPACE_ID}/broadcasts/{BROADCAST_ID}/start | Start a space broadcast |
stopSpaceBroadcast() | POST /video/v1/spaces/{SPACE_ID}/broadcasts/{BROADCAST_ID}/stop | Stop a space broadcast |
createSpace($create_space_request): \MuxPhp\Models\SpaceResponse
Create a space
Create a new space. Spaces are used to build real-time video applications.
<?php
require_once(__DIR__ . '/vendor/autoload.php');
// Configure HTTP basic authorization: accessToken
$config = MuxPhp\Configuration::getDefaultConfiguration()
->setUsername('YOUR_USERNAME')
->setPassword('YOUR_PASSWORD');
$apiInstance = new MuxPhp\Api\SpacesApi(
// If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
// This is optional, `GuzzleHttp\Client` will be used as default.
new GuzzleHttp\Client(),
$config
);
// This API method wants a \MuxPhp\Models\CreateSpaceRequest
// as the second parameter. That being said, these API docs are
// auto-generated from our OpenAPI specification, which
// gives us the example parameter as a JSON string. In this example,
// we'll use json_decode() to turn it into an associative array, which
// is compatible with the model.
//
// In your own code you should use an associative array, or
// use a "new \MuxPhp\Models\CreateSpaceRequest" directly.
$create_space_request = json_decode('{"type":"server"}',true); // \MuxPhp\Models\CreateSpaceRequest
try {
$result = $apiInstance->createSpace($create_space_request);
print_r($result);
} catch (Exception $e) {
echo 'Exception when calling SpacesApi->createSpace: ', $e->getMessage(), PHP_EOL;
}
Name | Type | Description | Notes |
---|---|---|---|
create_space_request | \MuxPhp\Models\CreateSpaceRequest |
- Content-Type:
application/json
- Accept:
application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
createSpaceBroadcast($space_id, $create_broadcast_request): \MuxPhp\Models\BroadcastResponse
Create a space broadcast
Creates a new broadcast. Broadcasts are used to create composited versions of your space, which can be broadcast to live streams. Note: By default only a single broadcast destination can be specified. Contact Mux support if you need more.
<?php
require_once(__DIR__ . '/vendor/autoload.php');
// Configure HTTP basic authorization: accessToken
$config = MuxPhp\Configuration::getDefaultConfiguration()
->setUsername('YOUR_USERNAME')
->setPassword('YOUR_PASSWORD');
$apiInstance = new MuxPhp\Api\SpacesApi(
// If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
// This is optional, `GuzzleHttp\Client` will be used as default.
new GuzzleHttp\Client(),
$config
);
$space_id = 'space_id_example'; // string | The space ID.
// This API method wants a \MuxPhp\Models\CreateBroadcastRequest
// as the second parameter. That being said, these API docs are
// auto-generated from our OpenAPI specification, which
// gives us the example parameter as a JSON string. In this example,
// we'll use json_decode() to turn it into an associative array, which
// is compatible with the model.
//
// In your own code you should use an associative array, or
// use a "new \MuxPhp\Models\CreateBroadcastRequest" directly.
$create_broadcast_request = json_decode('{"live_stream_id":"GQ9025mPqzyjOy3kKQW006qKTqmULW9vFO"}',true); // \MuxPhp\Models\CreateBroadcastRequest
try {
$result = $apiInstance->createSpaceBroadcast($space_id, $create_broadcast_request);
print_r($result);
} catch (Exception $e) {
echo 'Exception when calling SpacesApi->createSpaceBroadcast: ', $e->getMessage(), PHP_EOL;
}
Name | Type | Description | Notes |
---|---|---|---|
space_id | string | The space ID. | |
create_broadcast_request | \MuxPhp\Models\CreateBroadcastRequest |
\MuxPhp\Models\BroadcastResponse
- Content-Type:
application/json
- Accept:
application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
deleteSpace($space_id)
Delete a space
Deletes a space. Spaces can only be deleted when idle
.
<?php
require_once(__DIR__ . '/vendor/autoload.php');
// Configure HTTP basic authorization: accessToken
$config = MuxPhp\Configuration::getDefaultConfiguration()
->setUsername('YOUR_USERNAME')
->setPassword('YOUR_PASSWORD');
$apiInstance = new MuxPhp\Api\SpacesApi(
// If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
// This is optional, `GuzzleHttp\Client` will be used as default.
new GuzzleHttp\Client(),
$config
);
$space_id = 'space_id_example'; // string | The space ID.
try {
$apiInstance->deleteSpace($space_id);
} catch (Exception $e) {
echo 'Exception when calling SpacesApi->deleteSpace: ', $e->getMessage(), PHP_EOL;
}
Name | Type | Description | Notes |
---|---|---|---|
space_id | string | The space ID. |
void (empty response body)
- Content-Type: Not defined
- Accept: Not defined
[Back to top] [Back to API list] [Back to Model list] [Back to README]
deleteSpaceBroadcast($space_id, $broadcast_id)
Delete a space broadcast
Deletes a single broadcast of a specific space. Broadcasts can only be deleted when idle
.
<?php
require_once(__DIR__ . '/vendor/autoload.php');
// Configure HTTP basic authorization: accessToken
$config = MuxPhp\Configuration::getDefaultConfiguration()
->setUsername('YOUR_USERNAME')
->setPassword('YOUR_PASSWORD');
$apiInstance = new MuxPhp\Api\SpacesApi(
// If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
// This is optional, `GuzzleHttp\Client` will be used as default.
new GuzzleHttp\Client(),
$config
);
$space_id = 'space_id_example'; // string | The space ID.
$broadcast_id = 'broadcast_id_example'; // string | The broadcast ID.
try {
$apiInstance->deleteSpaceBroadcast($space_id, $broadcast_id);
} catch (Exception $e) {
echo 'Exception when calling SpacesApi->deleteSpaceBroadcast: ', $e->getMessage(), PHP_EOL;
}
Name | Type | Description | Notes |
---|---|---|---|
space_id | string | The space ID. | |
broadcast_id | string | The broadcast ID. |
void (empty response body)
- Content-Type: Not defined
- Accept: Not defined
[Back to top] [Back to API list] [Back to Model list] [Back to README]
getSpace($space_id): \MuxPhp\Models\SpaceResponse
Retrieve a space
Retrieves the details of a space that has previously been created. Supply the unique space ID that was returned from your create space request, and Mux will return the information about the corresponding space. The same information is returned when creating a space.
<?php
require_once(__DIR__ . '/vendor/autoload.php');
// Configure HTTP basic authorization: accessToken
$config = MuxPhp\Configuration::getDefaultConfiguration()
->setUsername('YOUR_USERNAME')
->setPassword('YOUR_PASSWORD');
$apiInstance = new MuxPhp\Api\SpacesApi(
// If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
// This is optional, `GuzzleHttp\Client` will be used as default.
new GuzzleHttp\Client(),
$config
);
$space_id = 'space_id_example'; // string | The space ID.
try {
$result = $apiInstance->getSpace($space_id);
print_r($result);
} catch (Exception $e) {
echo 'Exception when calling SpacesApi->getSpace: ', $e->getMessage(), PHP_EOL;
}
Name | Type | Description | Notes |
---|---|---|---|
space_id | string | The space ID. |
- Content-Type: Not defined
- Accept:
application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
getSpaceBroadcast($space_id, $broadcast_id): \MuxPhp\Models\BroadcastResponse
Retrieve space broadcast
Retrieves the details of a broadcast of a specific space.
<?php
require_once(__DIR__ . '/vendor/autoload.php');
// Configure HTTP basic authorization: accessToken
$config = MuxPhp\Configuration::getDefaultConfiguration()
->setUsername('YOUR_USERNAME')
->setPassword('YOUR_PASSWORD');
$apiInstance = new MuxPhp\Api\SpacesApi(
// If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
// This is optional, `GuzzleHttp\Client` will be used as default.
new GuzzleHttp\Client(),
$config
);
$space_id = 'space_id_example'; // string | The space ID.
$broadcast_id = 'broadcast_id_example'; // string | The broadcast ID.
try {
$result = $apiInstance->getSpaceBroadcast($space_id, $broadcast_id);
print_r($result);
} catch (Exception $e) {
echo 'Exception when calling SpacesApi->getSpaceBroadcast: ', $e->getMessage(), PHP_EOL;
}
Name | Type | Description | Notes |
---|---|---|---|
space_id | string | The space ID. | |
broadcast_id | string | The broadcast ID. |
\MuxPhp\Models\BroadcastResponse
- Content-Type: Not defined
- Accept:
application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
listSpaces($limit, $page): \MuxPhp\Models\ListSpacesResponse
List spaces
List all spaces in the current environment.
<?php
require_once(__DIR__ . '/vendor/autoload.php');
// Configure HTTP basic authorization: accessToken
$config = MuxPhp\Configuration::getDefaultConfiguration()
->setUsername('YOUR_USERNAME')
->setPassword('YOUR_PASSWORD');
$apiInstance = new MuxPhp\Api\SpacesApi(
// If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
// This is optional, `GuzzleHttp\Client` will be used as default.
new GuzzleHttp\Client(),
$config
);
$limit = 25; // int | Number of items to include in the response
$page = 1; // int | Offset by this many pages, of the size of `limit`
try {
$result = $apiInstance->listSpaces($limit, $page);
print_r($result);
} catch (Exception $e) {
echo 'Exception when calling SpacesApi->listSpaces: ', $e->getMessage(), PHP_EOL;
}
Name | Type | Description | Notes |
---|---|---|---|
limit | int | Number of items to include in the response | [optional] [default to 25] |
page | int | Offset by this many pages, of the size of `limit` | [optional] [default to 1] |
\MuxPhp\Models\ListSpacesResponse
- Content-Type: Not defined
- Accept:
application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
startSpaceBroadcast($space_id, $broadcast_id): \MuxPhp\Models\StartSpaceBroadcastResponse
Start a space broadcast
Starts broadcasting a space to the associated destination. Broadcasts can only be started when the space is active
(when there are participants connected).
<?php
require_once(__DIR__ . '/vendor/autoload.php');
// Configure HTTP basic authorization: accessToken
$config = MuxPhp\Configuration::getDefaultConfiguration()
->setUsername('YOUR_USERNAME')
->setPassword('YOUR_PASSWORD');
$apiInstance = new MuxPhp\Api\SpacesApi(
// If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
// This is optional, `GuzzleHttp\Client` will be used as default.
new GuzzleHttp\Client(),
$config
);
$space_id = 'space_id_example'; // string | The space ID.
$broadcast_id = 'broadcast_id_example'; // string | The broadcast ID.
try {
$result = $apiInstance->startSpaceBroadcast($space_id, $broadcast_id);
print_r($result);
} catch (Exception $e) {
echo 'Exception when calling SpacesApi->startSpaceBroadcast: ', $e->getMessage(), PHP_EOL;
}
Name | Type | Description | Notes |
---|---|---|---|
space_id | string | The space ID. | |
broadcast_id | string | The broadcast ID. |
\MuxPhp\Models\StartSpaceBroadcastResponse
- Content-Type: Not defined
- Accept:
application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
stopSpaceBroadcast($space_id, $broadcast_id): \MuxPhp\Models\StopSpaceBroadcastResponse
Stop a space broadcast
Stops broadcasting a space, causing the destination live stream to become idle. This API also automatically calls complete
on the destination live stream. Broadcasts are also automatically stopped when a space becomes idle.
<?php
require_once(__DIR__ . '/vendor/autoload.php');
// Configure HTTP basic authorization: accessToken
$config = MuxPhp\Configuration::getDefaultConfiguration()
->setUsername('YOUR_USERNAME')
->setPassword('YOUR_PASSWORD');
$apiInstance = new MuxPhp\Api\SpacesApi(
// If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
// This is optional, `GuzzleHttp\Client` will be used as default.
new GuzzleHttp\Client(),
$config
);
$space_id = 'space_id_example'; // string | The space ID.
$broadcast_id = 'broadcast_id_example'; // string | The broadcast ID.
try {
$result = $apiInstance->stopSpaceBroadcast($space_id, $broadcast_id);
print_r($result);
} catch (Exception $e) {
echo 'Exception when calling SpacesApi->stopSpaceBroadcast: ', $e->getMessage(), PHP_EOL;
}
Name | Type | Description | Notes |
---|---|---|---|
space_id | string | The space ID. | |
broadcast_id | string | The broadcast ID. |
\MuxPhp\Models\StopSpaceBroadcastResponse
- Content-Type: Not defined
- Accept:
application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]