Skip to content

Latest commit

 

History

History
702 lines (536 loc) · 21.3 KB

SpacesApi.md

File metadata and controls

702 lines (536 loc) · 21.3 KB

Mux.Csharp.Sdk.Api.SpacesApi

All URIs are relative to https://api.mux.com

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

SpaceResponse CreateSpace (CreateSpaceRequest createSpaceRequest)

Create a space

Create a new space. Spaces are used to build real-time video applications.

Example

using System.Collections.Generic;
using System.Diagnostics;
using Mux.Csharp.Sdk.Api;
using Mux.Csharp.Sdk.Client;
using Mux.Csharp.Sdk.Model;

namespace Example
{
    public class CreateSpaceExample
    {
        public static void Main()
        {
            Configuration config = new Configuration();
            config.BasePath = "https://api.mux.com";
            // Configure HTTP basic authorization: accessToken
            config.Username = "YOUR_USERNAME";
            config.Password = "YOUR_PASSWORD";

            var apiInstance = new SpacesApi(config);
            var createSpaceRequest = new CreateSpaceRequest(); // CreateSpaceRequest | 

            try
            {
                // Create a space
                SpaceResponse result = apiInstance.CreateSpace(createSpaceRequest);
                Debug.WriteLine(result);
            }
            catch (ApiException  e)
            {
                Debug.Print("Exception when calling SpacesApi.CreateSpace: " + e.Message );
                Debug.Print("Status Code: "+ e.ErrorCode);
                Debug.Print(e.StackTrace);
            }
        }
    }
}

Parameters

Name Type Description Notes
createSpaceRequest CreateSpaceRequest

Return type

SpaceResponse

Authorization

accessToken

HTTP request headers

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

HTTP response details

Status code Description Response headers
201 Space Created -

[Back to top] [Back to API list] [Back to Model list] [Back to README]

CreateSpaceBroadcast

BroadcastResponse CreateSpaceBroadcast (string SPACE_ID, CreateBroadcastRequest createBroadcastRequest)

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.

Example

using System.Collections.Generic;
using System.Diagnostics;
using Mux.Csharp.Sdk.Api;
using Mux.Csharp.Sdk.Client;
using Mux.Csharp.Sdk.Model;

namespace Example
{
    public class CreateSpaceBroadcastExample
    {
        public static void Main()
        {
            Configuration config = new Configuration();
            config.BasePath = "https://api.mux.com";
            // Configure HTTP basic authorization: accessToken
            config.Username = "YOUR_USERNAME";
            config.Password = "YOUR_PASSWORD";

            var apiInstance = new SpacesApi(config);
            var SPACE_ID = "SPACE_ID_example";  // string | The space ID.
            var createBroadcastRequest = new CreateBroadcastRequest(); // CreateBroadcastRequest | 

            try
            {
                // Create a space broadcast
                BroadcastResponse result = apiInstance.CreateSpaceBroadcast(SPACE_ID, createBroadcastRequest);
                Debug.WriteLine(result);
            }
            catch (ApiException  e)
            {
                Debug.Print("Exception when calling SpacesApi.CreateSpaceBroadcast: " + e.Message );
                Debug.Print("Status Code: "+ e.ErrorCode);
                Debug.Print(e.StackTrace);
            }
        }
    }
}

Parameters

Name Type Description Notes
SPACE_ID string The space ID.
createBroadcastRequest CreateBroadcastRequest

Return type

BroadcastResponse

Authorization

accessToken

HTTP request headers

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

HTTP response details

Status code Description Response headers
201 Broadcast Created -

[Back to top] [Back to API list] [Back to Model list] [Back to README]

DeleteSpace

void DeleteSpace (string SPACE_ID)

Delete a space

Deletes a space. Spaces can only be deleted when idle.

Example

using System.Collections.Generic;
using System.Diagnostics;
using Mux.Csharp.Sdk.Api;
using Mux.Csharp.Sdk.Client;
using Mux.Csharp.Sdk.Model;

namespace Example
{
    public class DeleteSpaceExample
    {
        public static void Main()
        {
            Configuration config = new Configuration();
            config.BasePath = "https://api.mux.com";
            // Configure HTTP basic authorization: accessToken
            config.Username = "YOUR_USERNAME";
            config.Password = "YOUR_PASSWORD";

            var apiInstance = new SpacesApi(config);
            var SPACE_ID = "SPACE_ID_example";  // string | The space ID.

            try
            {
                // Delete a space
                apiInstance.DeleteSpace(SPACE_ID);
            }
            catch (ApiException  e)
            {
                Debug.Print("Exception when calling SpacesApi.DeleteSpace: " + e.Message );
                Debug.Print("Status Code: "+ e.ErrorCode);
                Debug.Print(e.StackTrace);
            }
        }
    }
}

Parameters

Name Type Description Notes
SPACE_ID string The space ID.

Return type

void (empty response body)

Authorization

accessToken

HTTP request headers

  • Content-Type: Not defined
  • Accept: Not defined

HTTP response details

Status code Description Response headers
204 No Content -

[Back to top] [Back to API list] [Back to Model list] [Back to README]

DeleteSpaceBroadcast

void DeleteSpaceBroadcast (string SPACE_ID, string BROADCAST_ID)

Delete a space broadcast

Deletes a single broadcast of a specific space. Broadcasts can only be deleted when idle.

Example

using System.Collections.Generic;
using System.Diagnostics;
using Mux.Csharp.Sdk.Api;
using Mux.Csharp.Sdk.Client;
using Mux.Csharp.Sdk.Model;

namespace Example
{
    public class DeleteSpaceBroadcastExample
    {
        public static void Main()
        {
            Configuration config = new Configuration();
            config.BasePath = "https://api.mux.com";
            // Configure HTTP basic authorization: accessToken
            config.Username = "YOUR_USERNAME";
            config.Password = "YOUR_PASSWORD";

            var apiInstance = new SpacesApi(config);
            var SPACE_ID = "SPACE_ID_example";  // string | The space ID.
            var BROADCAST_ID = "BROADCAST_ID_example";  // string | The broadcast ID.

            try
            {
                // Delete a space broadcast
                apiInstance.DeleteSpaceBroadcast(SPACE_ID, BROADCAST_ID);
            }
            catch (ApiException  e)
            {
                Debug.Print("Exception when calling SpacesApi.DeleteSpaceBroadcast: " + e.Message );
                Debug.Print("Status Code: "+ e.ErrorCode);
                Debug.Print(e.StackTrace);
            }
        }
    }
}

Parameters

Name Type Description Notes
SPACE_ID string The space ID.
BROADCAST_ID string The broadcast ID.

Return type

void (empty response body)

Authorization

accessToken

HTTP request headers

  • Content-Type: Not defined
  • Accept: Not defined

HTTP response details

Status code Description Response headers
204 No Content -

[Back to top] [Back to API list] [Back to Model list] [Back to README]

GetSpace

SpaceResponse GetSpace (string SPACE_ID)

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.

Example

using System.Collections.Generic;
using System.Diagnostics;
using Mux.Csharp.Sdk.Api;
using Mux.Csharp.Sdk.Client;
using Mux.Csharp.Sdk.Model;

namespace Example
{
    public class GetSpaceExample
    {
        public static void Main()
        {
            Configuration config = new Configuration();
            config.BasePath = "https://api.mux.com";
            // Configure HTTP basic authorization: accessToken
            config.Username = "YOUR_USERNAME";
            config.Password = "YOUR_PASSWORD";

            var apiInstance = new SpacesApi(config);
            var SPACE_ID = "SPACE_ID_example";  // string | The space ID.

            try
            {
                // Retrieve a space
                SpaceResponse result = apiInstance.GetSpace(SPACE_ID);
                Debug.WriteLine(result);
            }
            catch (ApiException  e)
            {
                Debug.Print("Exception when calling SpacesApi.GetSpace: " + e.Message );
                Debug.Print("Status Code: "+ e.ErrorCode);
                Debug.Print(e.StackTrace);
            }
        }
    }
}

Parameters

Name Type Description Notes
SPACE_ID string The space ID.

Return type

SpaceResponse

Authorization

accessToken

HTTP request headers

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

HTTP response details

Status code Description Response headers
200 OK -

[Back to top] [Back to API list] [Back to Model list] [Back to README]

GetSpaceBroadcast

BroadcastResponse GetSpaceBroadcast (string SPACE_ID, string BROADCAST_ID)

Retrieve space broadcast

Retrieves the details of a broadcast of a specific space.

Example

using System.Collections.Generic;
using System.Diagnostics;
using Mux.Csharp.Sdk.Api;
using Mux.Csharp.Sdk.Client;
using Mux.Csharp.Sdk.Model;

namespace Example
{
    public class GetSpaceBroadcastExample
    {
        public static void Main()
        {
            Configuration config = new Configuration();
            config.BasePath = "https://api.mux.com";
            // Configure HTTP basic authorization: accessToken
            config.Username = "YOUR_USERNAME";
            config.Password = "YOUR_PASSWORD";

            var apiInstance = new SpacesApi(config);
            var SPACE_ID = "SPACE_ID_example";  // string | The space ID.
            var BROADCAST_ID = "BROADCAST_ID_example";  // string | The broadcast ID.

            try
            {
                // Retrieve space broadcast
                BroadcastResponse result = apiInstance.GetSpaceBroadcast(SPACE_ID, BROADCAST_ID);
                Debug.WriteLine(result);
            }
            catch (ApiException  e)
            {
                Debug.Print("Exception when calling SpacesApi.GetSpaceBroadcast: " + e.Message );
                Debug.Print("Status Code: "+ e.ErrorCode);
                Debug.Print(e.StackTrace);
            }
        }
    }
}

Parameters

Name Type Description Notes
SPACE_ID string The space ID.
BROADCAST_ID string The broadcast ID.

Return type

BroadcastResponse

Authorization

accessToken

HTTP request headers

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

HTTP response details

Status code Description Response headers
200 OK -

[Back to top] [Back to API list] [Back to Model list] [Back to README]

ListSpaces

ListSpacesResponse ListSpaces (int? limit = null, int? page = null)

List spaces

List all spaces in the current environment.

Example

using System.Collections.Generic;
using System.Diagnostics;
using Mux.Csharp.Sdk.Api;
using Mux.Csharp.Sdk.Client;
using Mux.Csharp.Sdk.Model;

namespace Example
{
    public class ListSpacesExample
    {
        public static void Main()
        {
            Configuration config = new Configuration();
            config.BasePath = "https://api.mux.com";
            // Configure HTTP basic authorization: accessToken
            config.Username = "YOUR_USERNAME";
            config.Password = "YOUR_PASSWORD";

            var apiInstance = new SpacesApi(config);
            var limit = 25;  // int? | Number of items to include in the response (optional)  (default to 25)
            var page = 1;  // int? | Offset by this many pages, of the size of `limit` (optional)  (default to 1)

            try
            {
                // List spaces
                ListSpacesResponse result = apiInstance.ListSpaces(limit, page);
                Debug.WriteLine(result);
            }
            catch (ApiException  e)
            {
                Debug.Print("Exception when calling SpacesApi.ListSpaces: " + e.Message );
                Debug.Print("Status Code: "+ e.ErrorCode);
                Debug.Print(e.StackTrace);
            }
        }
    }
}

Parameters

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]

Return type

ListSpacesResponse

Authorization

accessToken

HTTP request headers

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

HTTP response details

Status code Description Response headers
200 OK -

[Back to top] [Back to API list] [Back to Model list] [Back to README]

StartSpaceBroadcast

StartSpaceBroadcastResponse StartSpaceBroadcast (string SPACE_ID, string BROADCAST_ID)

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).

Example

using System.Collections.Generic;
using System.Diagnostics;
using Mux.Csharp.Sdk.Api;
using Mux.Csharp.Sdk.Client;
using Mux.Csharp.Sdk.Model;

namespace Example
{
    public class StartSpaceBroadcastExample
    {
        public static void Main()
        {
            Configuration config = new Configuration();
            config.BasePath = "https://api.mux.com";
            // Configure HTTP basic authorization: accessToken
            config.Username = "YOUR_USERNAME";
            config.Password = "YOUR_PASSWORD";

            var apiInstance = new SpacesApi(config);
            var SPACE_ID = "SPACE_ID_example";  // string | The space ID.
            var BROADCAST_ID = "BROADCAST_ID_example";  // string | The broadcast ID.

            try
            {
                // Start a space broadcast
                StartSpaceBroadcastResponse result = apiInstance.StartSpaceBroadcast(SPACE_ID, BROADCAST_ID);
                Debug.WriteLine(result);
            }
            catch (ApiException  e)
            {
                Debug.Print("Exception when calling SpacesApi.StartSpaceBroadcast: " + e.Message );
                Debug.Print("Status Code: "+ e.ErrorCode);
                Debug.Print(e.StackTrace);
            }
        }
    }
}

Parameters

Name Type Description Notes
SPACE_ID string The space ID.
BROADCAST_ID string The broadcast ID.

Return type

StartSpaceBroadcastResponse

Authorization

accessToken

HTTP request headers

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

HTTP response details

Status code Description Response headers
200 OK -

[Back to top] [Back to API list] [Back to Model list] [Back to README]

StopSpaceBroadcast

StopSpaceBroadcastResponse StopSpaceBroadcast (string SPACE_ID, string BROADCAST_ID)

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.

Example

using System.Collections.Generic;
using System.Diagnostics;
using Mux.Csharp.Sdk.Api;
using Mux.Csharp.Sdk.Client;
using Mux.Csharp.Sdk.Model;

namespace Example
{
    public class StopSpaceBroadcastExample
    {
        public static void Main()
        {
            Configuration config = new Configuration();
            config.BasePath = "https://api.mux.com";
            // Configure HTTP basic authorization: accessToken
            config.Username = "YOUR_USERNAME";
            config.Password = "YOUR_PASSWORD";

            var apiInstance = new SpacesApi(config);
            var SPACE_ID = "SPACE_ID_example";  // string | The space ID.
            var BROADCAST_ID = "BROADCAST_ID_example";  // string | The broadcast ID.

            try
            {
                // Stop a space broadcast
                StopSpaceBroadcastResponse result = apiInstance.StopSpaceBroadcast(SPACE_ID, BROADCAST_ID);
                Debug.WriteLine(result);
            }
            catch (ApiException  e)
            {
                Debug.Print("Exception when calling SpacesApi.StopSpaceBroadcast: " + e.Message );
                Debug.Print("Status Code: "+ e.ErrorCode);
                Debug.Print(e.StackTrace);
            }
        }
    }
}

Parameters

Name Type Description Notes
SPACE_ID string The space ID.
BROADCAST_ID string The broadcast ID.

Return type

StopSpaceBroadcastResponse

Authorization

accessToken

HTTP request headers

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

HTTP response details

Status code Description Response headers
200 OK -

[Back to top] [Back to API list] [Back to Model list] [Back to README]