### Start Recording (JavaScript Fetch) Source: https://developer.digitalsamba.com/ Initiate a recording for a room using the Fetch API in JavaScript. This example sends a POST request to the start recording endpoint. ```javascript const url = new URL( "https://api.digitalsamba.com/api/v1/rooms/a853d608-e6cf-48eb-a3c9-7d089bbc09b0/recordings/start" ); const headers = { "Authorization": "Bearer {DEVELOPER_KEY}", "Content-Type": "application/json", "Accept": "application/json", }; fetch(url, { method: "POST", headers, }).then(response => response.json()); ``` -------------------------------- ### Start Recording (cURL) Source: https://developer.digitalsamba.com/ A cURL command to start a recording for a given room. This example demonstrates the POST request with required headers. ```bash curl --request POST \ "https://api.digitalsamba.com/api/v1/rooms/a853d608-e6cf-48eb-a3c9-7d089bbc09b0/recordings/start" \ --header "Authorization: Bearer {DEVELOPER_KEY}" \ --header "Content-Type: application/json" \ --header "Accept: application/json" ``` -------------------------------- ### Get Started Sessions by Participant UUIDs (cURL) Source: https://developer.digitalsamba.com/ Use this cURL command to make a GET request for started sessions data. Ensure you replace {DEVELOPER_KEY} with your actual API key. The command includes query parameters for pagination and required headers. ```bash curl --request GET \ --get "https://api.digitalsamba.com/api/v1/statistics/participants/started-sessions?limit=20&offset=0" \ --header "Authorization: Bearer {DEVELOPER_KEY}" \ --header "Content-Type: application/json" \ --header "Accept: application/json" ``` -------------------------------- ### Start Live Answer with PHP Guzzle Source: https://developer.digitalsamba.com/ Use this snippet to start a live answer in a room. Ensure you have the Guzzle HTTP client installed and replace placeholders with your actual developer key and room/question IDs. ```php $client = new \GuzzleHttp\Client(); $url = 'https://api.digitalsamba.com/api/v1/rooms/a853d608-e6cf-48eb-a3c9-7d089bbc09b0/questions/16719c1b-cc82-4dfe-9f6f-40d9093fa695/live-answers/start'; $response = $client->post( $url, [ 'headers' => [ 'Authorization' => 'Bearer {DEVELOPER_KEY}', 'Content-Type' => 'application/json', 'Accept' => 'application/json', ], 'json' => [ 'participant' => ['id' => '5b9ca00e-656e-43cc-ba2c-7dcaae63daa9', 'name' => 'John Doe', 'external_id' => 'ABCDEF123'], ], ] ); $body = $response->getBody(); print_r(json_decode((string) $body)); ``` -------------------------------- ### Get Started Sessions by Participant UUIDs (PHP) Source: https://developer.digitalsamba.com/ Use this snippet with Guzzle to fetch started sessions data. Ensure you have the Guzzle HTTP client installed. Replace {DEVELOPER_KEY} with your actual API key. ```php $client = new \GuzzleHttp\Client(); $url = 'https://api.digitalsamba.com/api/v1/statistics/participants/started-sessions'; $response = $client->get( $url, [ 'headers' => [ 'Authorization' => 'Bearer {DEVELOPER_KEY}', 'Content-Type' => 'application/json', 'Accept' => 'application/json', ], 'query' => [ 'limit' => '20', 'offset' => '0', ], ] ); $body = $response->getBody(); print_r(json_decode((string) $body)); ``` -------------------------------- ### Get Libraries with cURL Source: https://developer.digitalsamba.com/ Use cURL to make a GET request for libraries. This command-line example demonstrates setting query parameters and headers for authentication and content negotiation. ```bash curl --request GET \ --get "https://api.digitalsamba.com/api/v1/libraries?limit=20&offset=0&order=asc" \ --header "Authorization: Bearer {DEVELOPER_KEY}" \ --header "Content-Type: application/json" \ --header "Accept: application/json" ``` -------------------------------- ### Start Restreamer (cURL) Source: https://developer.digitalsamba.com/ A cURL command to start a restreamer. This example shows how to send a JSON payload with stream details and authentication headers. ```Shell curl --request POST \ "https://api.digitalsamba.com/api/v1/rooms/a853d608-e6cf-48eb-a3c9-7d089bbc09b0/restreamers/start" \ --header "Authorization: Bearer {DEVELOPER_KEY}" \ --header "Content-Type: application/json" \ --header "Accept: application/json" \ --data "{ \"type\": \"vimeo\", \"stream_key\": \"53858671-c5e0-441a-9e33-e5d7f7f1861e\" }" ``` -------------------------------- ### Get Session Summary with Guzzle Source: https://developer.digitalsamba.com/ Use this PHP Guzzle HTTP client example to make a request to the session summary endpoint. Ensure you have the Guzzle library installed and replace {DEVELOPER_KEY} with your actual key. ```php $client = new \GuzzleHttp\Client(); $url = 'https://api.digitalsamba.com/api/v1/sessions/a853d608-e6cf-48eb-a3c9-7d089bbc09b0/summary'; $response = $client->get( $url, [ 'headers' => [ 'Authorization' => 'Bearer {DEVELOPER_KEY}', 'Content-Type' => 'application/json', 'Accept' => 'application/json', ], ] ); $body = $response->getBody(); print_r(json_decode((string) $body)); ``` -------------------------------- ### Get Started Sessions by Participant UUIDs (JavaScript) Source: https://developer.digitalsamba.com/ This JavaScript snippet uses the fetch API to retrieve started sessions data. It constructs the URL with query parameters and sets the necessary headers. Replace {DEVELOPER_KEY} with your actual API key. ```javascript const url = new URL( "https://api.digitalsamba.com/api/v1/statistics/participants/started-sessions" ); const params = { "limit": "20", "offset": "0", }; Object.keys(params) .forEach(key => url.searchParams.append(key, params[key])); const headers = { "Authorization": "Bearer {DEVELOPER_KEY}", "Content-Type": "application/json", "Accept": "application/json", }; fetch(url, { method: "GET", headers, }).then(response => response.json()); ``` -------------------------------- ### Get Available Roles (JavaScript) Source: https://developer.digitalsamba.com/ This JavaScript example demonstrates how to fetch roles using the Fetch API. It constructs the URL with query parameters and sets the necessary headers, including your developer key. ```javascript const url = new URL( "https://api.digitalsamba.com/api/v1/roles" ); const params = { "limit": "20", "offset": "0", "order": "asc", }; Object.keys(params) .forEach(key => url.searchParams.append(key, params[key])); const headers = { "Authorization": "Bearer {DEVELOPER_KEY}", "Content-Type": "application/json", "Accept": "application/json", }; fetch(url, { method: "GET", headers, }).then(response => response.json()); ``` -------------------------------- ### Get Quizzes for a Room (JavaScript Fetch) Source: https://developer.digitalsamba.com/ Fetches available quizzes for a room using the Fetch API in JavaScript. This example constructs the URL with query parameters and sets necessary headers. ```javascript const url = new URL( "https://api.digitalsamba.com/api/v1/rooms/a853d608-e6cf-48eb-a3c9-7d089bbc09b0/quizzes" ); const params = { "limit": "20", "offset": "0", "order": "asc", }; Object.keys(params) .forEach(key => url.searchParams.append(key, params[key])); const headers = { "Authorization": "Bearer {DEVELOPER_KEY}", "Content-Type": "application/json", "Accept": "application/json", }; fetch(url, { method: "GET", headers, }).then(response => response.json()); ``` -------------------------------- ### Start Live Answer with JavaScript Fetch API Source: https://developer.digitalsamba.com/ Initiate a live answer using the Fetch API in JavaScript. This example demonstrates setting up the URL, headers, and request body for the POST request. Replace placeholders as needed. ```javascript const url = new URL( "https://api.digitalsamba.com/api/v1/rooms/a853d608-e6cf-48eb-a3c9-7d089bbc09b0/questions/16719c1b-cc82-4dfe-9f6f-40d9093fa695/live-answers/start" ); const headers = { "Authorization": "Bearer {DEVELOPER_KEY}", "Content-Type": "application/json", "Accept": "application/json", }; let body = { "participant": { "id": "5b9ca00e-656e-43cc-ba2c-7dcaae63daa9", "name": "John Doe", "external_id": "ABCDEF123" } }; fetch(url, { method: "POST", headers, body: JSON.stringify(body), }).then(response => response.json()); ``` -------------------------------- ### Get Poll Results (PHP) Source: https://developer.digitalsamba.com/ Use this PHP Guzzle client example to fetch poll results. Ensure you have the Guzzle HTTP client installed and replace placeholders with your actual developer key and resource IDs. ```php $client = new \GuzzleHttp\Client(); $url = 'https://api.digitalsamba.com/api/v1/rooms/a853d608-e6cf-48eb-a3c9-7d089bbc09b0/polls/a853d608-e6cf-48eb-a3c9-7d089bbc09b0/results'; $response = $client->get( $url, [ 'headers' => [ 'Authorization' => 'Bearer {DEVELOPER_KEY}', 'Content-Type' => 'application/json', 'Accept' => 'application/json', ], 'query' => [ 'session_id' => '5ce6fda5-d42b-4110-8796-177e571a7407', ], ] ); $body = $response->getBody(); print_r(json_decode((string) $body)); ``` -------------------------------- ### PHP Example for Room Creation Source: https://developer.digitalsamba.com/ This PHP code snippet demonstrates how to set various URL parameters when creating a room. It includes settings for QA, participant features, consent messages, and session configurations. ```php $response = $client->request('POST', '/api/v1/rooms', [ 'json' => [ 'qa_default_filter' => 'all', 'upvote_qa_enabled' => true, 'shared_notes_enabled' => true, 'polls_enabled' => true, 'consent_message_enabled' => true, 'consent_message_type' => 'generic', 'consent_message' => 'By joining, you consent to the processing of your personal data in accordance with our [link https://www.digitalsamba.com/redirect/privacy-policy]Privacy Policy[/link].', 'checkbox_message' => 'Don’t show this again.', 'layout_mode_on_join' => 'tiled', 'max_participants' => 100, 'max_broadcasters' => 100, 'session_length' => 90, 'html_title' => 'My room', 'lobby_message' => 'You are in the session lobby', 'lobby_sound_enabled' => false, 'content_library_enabled' => true, 'default_content_library' => 'room', 'library_id' => '15bf7fba-7de2-4dbf-877c-62103cc274c4', 'transcription_enabled' => false, 'transcription_auto_start_enabled' => true, 'captions_enabled' => false, 'captions_language' => 'en', 'whip_enabled' => false, 'telephony_enabled' => false, 'telephony_phone_number' => '+1 234 567 890.', 'telephony_pin_dtmf' => '123W1www2', 'watermark_enabled' => false, 'watermark_text' => 'Confidential', 'expires_at' => '2024-09-05 12:30:00', ], ]); $body = $response->getBody(); print_r(json_decode((string) $body)); ``` -------------------------------- ### Start Recording Source: https://developer.digitalsamba.com/rest-api/openapi.yaml Initiates the recording process for a specified room. ```APIDOC ## POST /api/v1/rooms/{room}/recordings/start ### Description Starts the recording for a specified room. ### Method POST ### Endpoint /api/v1/rooms/{room}/recordings/start ### Parameters #### Path Parameters - **room** (string) - Required - The UUID of the room or room friendly URL. ### Response #### Success Response (200) - The response indicates success, typically with an HTTP 200 OK status. ### Response Example { "example": "HTTP/1.1 200 OK" } ``` -------------------------------- ### Get Started Sessions Statistics Source: https://developer.digitalsamba.com/ Retrieves statistics for started sessions within a specified period. Supports filtering by date range and pagination. ```APIDOC ## GET api/v1/statistics/participants/started-sessions ### Description Get room statistics by period. ### Method GET ### Endpoint api/v1/statistics/participants/started-sessions ### Headers - **Authorization** (string) - Required - Example: `Bearer {DEVELOPER_KEY}` - **Content-Type** (string) - Optional - Example: `application/json` - **Accept** (string) - Optional - Example: `application/json` ### Query Parameters - **date_start** (string) - Optional - Period start date. Must be a valid date in the format Y-m-d. - **date_end** (string) - Optional - Period end date. Must be a valid date in the format Y-m-d. - **limit** (integer) - Optional - Limit the number of returned records. Used for pagination. Maximum and default is 100. Example: `20` - **offset** (integer) - Optional - The offset of the first item returned in the records collection. Used for pagination. Example: `0` ### Request Example ```http GET /api/v1/statistics/participants/started-sessions?date_start=2024-02-27&date_end=2024-03-27&limit=20&offset=0 HTTP/1.1 Host: api.digitalsamba.com Authorization: Bearer {DEVELOPER_KEY} Content-Type: application/json Accept: application/json ``` ### Response #### Success Response (200) - **room_id** (string) - Description - **room_external_id** (string) - Description - **room_description** (string) - Description - **room_friendly_url** (string) - Description - **room_privacy** (string) - Description - **room_source** (string) - Description - **room_max_participants** (integer) - Description - **room_is_deleted** (boolean) - Description - **participation_minutes** (integer) - Description - **desktop_participation_minutes** (integer) - Description - **mobile_participation_minutes** (integer) - Description - **tablet_participation_minutes** (integer) - Description - **smarttv_participation_minutes** (integer) - Description - **broadcasted_minutes** (integer) - Description - **subscribed_minutes** (integer) - Description - **screen_broadcasted_minutes** (integer) - Description - **screen_subscribed_minutes** (integer) - Description - **live_participants** (integer) - Description - **active_participants** (integer) - Description - **desktop_participants** (integer) - Description - **mobile_participants** (integer) - Description - **tablet_participants** (integer) - Description - **smarttv_participants** (integer) - Description - **sessions** (integer) - Description - **max_concurrent_participants** (integer) - Description - **transcription_minutes** (integer) - Description - **e2ee_minutes** (integer) - Description - **recorded_minutes** (integer) - Description - **stored_recorded_minutes** (integer) - Description - **whiteboard_minutes** (integer) - Description - **captions_minutes** (integer) - Description - **active_roles** (integer) - Description - **breakout_minutes** (integer) - Description - **presentation_minutes** (integer) - Description - **public_chat_posts** (integer) - Description - **questions** (integer) - Description - **answers** (integer) - Description - **polls** (integer) - Description - **summaries** (integer) - Description - **date_start** (string) - Description - **date_end** (string) - Description #### Response Example (200) ```json { "room_id": "13a5aa53-f4da-470b-bfd0-63dd9e5dd81d", "room_external_id": "EXTID123", "room_description": "Some public room", "room_friendly_url": "MyPublicRoom", "room_privacy": "public", "room_source": "api", "room_max_participants": 100, "room_is_deleted": false, "participation_minutes": 422, "desktop_participation_minutes": 222, "mobile_participation_minutes": 100, "tablet_participation_minutes": 75, "smarttv_participation_minutes": 25, "broadcasted_minutes": 10, "subscribed_minutes": 10, "screen_broadcasted_minutes": 5, "screen_subscribed_minutes": 5, "live_participants": 0, "active_participants": 10, "desktop_participants": 5, "mobile_participants": 2, "tablet_participants": 2, "smarttv_participants": 1, "sessions": 11, "max_concurrent_participants": 5, "transcription_minutes": 52, "e2ee_minutes": 30, "recorded_minutes": 40, "stored_recorded_minutes": 748, "whiteboard_minutes": 4, "captions_minutes": 10, "active_roles": 2, "breakout_minutes": 4, "presentation_minutes": 0, "public_chat_posts": 2, "questions": 12, "answers": 10, "polls": 2, "summaries": 5, "date_start": "2024-02-27", "date_end": "2024-03-27" } ``` ``` -------------------------------- ### Start Live Answer with cURL Source: https://developer.digitalsamba.com/ This cURL command shows how to start a live answer via the API. It includes the necessary HTTP method, URL, headers, and JSON payload. Remember to replace `{DEVELOPER_KEY}` with your actual key. ```bash curl --request POST \ "https://api.digitalsamba.com/api/v1/rooms/a853d608-e6cf-48eb-a3c9-7d089bbc09b0/questions/16719c1b-cc82-4dfe-9f6f-40d9093fa695/live-answers/start" \ --header "Authorization: Bearer {DEVELOPER_KEY}" \ --header "Content-Type: application/json" \ --header "Accept: application/json" \ --data "{ \"participant\": { \ \"id\": \"5b9ca00e-656e-43cc-ba2c-7dcaae63daa9\", \ \"name\": \"John Doe\", \ \"external_id\": \"ABCDEF123\" \ } }" ``` -------------------------------- ### Start Recording (PHP Guzzle) Source: https://developer.digitalsamba.com/ This PHP snippet uses Guzzle to initiate a recording for a specific room. Ensure the room ID is correctly provided. ```php $client = new \GuzzleHttp\Client(); $url = 'https://api.digitalsamba.com/api/v1/rooms/a853d608-e6cf-48eb-a3c9-7d089bbc09b0/recordings/start'; $response = $client->post( $url, [ 'headers' => [ 'Authorization' => 'Bearer {DEVELOPER_KEY}', 'Content-Type' => 'application/json', 'Accept' => 'application/json', ], ] ); $body = $response->getBody(); print_r(json_decode((string) $body)); ``` -------------------------------- ### Create Room using cURL Source: https://developer.digitalsamba.com/ This example shows how to create a new room using cURL. It includes headers for authorization and content type, and a JSON payload with various room settings. ```bash curl --request POST \ "https:\/\/api.digitalsamba.com\/api\/v1\/rooms" \ --header "Authorization: Bearer {DEVELOPER_KEY}" \ --header "Content-Type: application/json" \ --header "Accept: application/json" \ --data "{ \"description\": \"My public room description.\", \"friendly_url\": \"MyPublicRoom\", \"privacy\": \"public\", \"external_id\": \"myExtID123\", \"default_role\": \"moderator\", \"roles\": [ \"moderator\" ], \"webhooks\": [ \"c83c7b87-b9b8-444d-a749-7076fe58fdb8\" ], \"tags\": [ \"Tag1\", \"Tag2\" ], \"is_locked\": false, \"is_audio_only\": false, \"topbar_enabled\": true, \"pip_enabled\": true, \"auto_pip_enabled\": true, \"toolbar_enabled\": true, \"toolbar_position\": \"bottom\", \"toolbar_color\": \"#000000\", \"primary_color\": \"#3771E0\", \"background_color\": \"#000000\", \"palette_mode\": \"light\", \"language\": \"en\", \"languages\": [ \"en\", \"es-ES\" ], \"language_selection_enabled\": true, \"room_reactions_enabled\": true, \"audio_on_join_enabled\": true, \"video_on_join_enabled\": true, \"hd_video_on_join_enabled\": false, \"hd_video_quality\": \"720_2.5\", \"audio_quality\": \"32\", \"audio_autogain_enabled\": true, \"audio_noise_suppression_enabled\": true, \"audio_echo_cancellation_enabled\": true, \"mute_sound_enabled\": false, \"participants_list_enabled\": true, \"pin_enabled\": true, \"full_screen_enabled\": true, \"minimize_own_tile_enabled\": true, \"minimize_own_tile_on_join_enabled\": false, \"broadcaster_tile_visibility\": \"all\", \"end_session_enabled\": true, \"leave_session_enabled\": true, \"rejoin_session_enabled\": true, \"connection_message_enabled\": true, \"connection_quality_indicator_enabled\": false, \"video_fit_mode_enabled\": true, \"pin_panels_enabled\": false, \"breakout_rooms_enabled\": false, "expires_at": "2024-09-05 12:30:00" } ``` -------------------------------- ### Create Web App File (JavaScript) Source: https://developer.digitalsamba.com/ This JavaScript snippet demonstrates how to create a new web app file using the Fetch API. It includes setting up the URL, headers, and request body. Replace `{DEVELOPER_KEY}` with your actual API key. ```javascript const url = new URL( "https://api.digitalsamba.com/api/v1/libraries/corrupti/webapps" ); const headers = { "Authorization": "Bearer {DEVELOPER_KEY}", "Content-Type": "application/json", "Accept": "application/json", }; let body = { "url": "https:\/\/www.youtube.com\/embed\/sGV83rWzsdT", "name": "My YouTube video", "folder_id": "5ce6fda5-d42b-4110-8796-177e571a7407", "initiator_id": "4e617b08-98c1-390f-96c8-4607a1dfde3e" }; fetch(url, { method: "POST", headers, body: JSON.stringify(body), }).then(response => response.json()); ``` -------------------------------- ### Get Session Statistics (PHP) Source: https://developer.digitalsamba.com/ Use this snippet to retrieve session statistics via a GET request using the Guzzle HTTP client in PHP. Ensure you have the Guzzle library installed. ```php $client = new \GuzzleHttp\Client(); $url = 'https://api.digitalsamba.com/api/v1/sessions/aut/statistics'; $response = $client->get( $url, [ 'headers' => [ 'Authorization' => 'Bearer {DEVELOPER_KEY}', 'Content-Type' => 'application/json', 'Accept' => 'application/json', ], ] ); $body = $response->getBody(); print_r(json_decode((string) $body)); ``` -------------------------------- ### Get Started Sessions by Participant UUIDs Source: https://developer.digitalsamba.com/rest-api/openapi.yaml Retrieves a paginated list of sessions started by participants, identified by their UUIDs. This endpoint is useful for tracking individual participant activity over specified date ranges. ```APIDOC ## GET /api/v1/statistics/participants/started-sessions ### Description Get started sessions by participant UUIDs. Paginated. ### Method GET ### Endpoint /api/v1/statistics/participants/started-sessions ### Parameters #### Query Parameters - **date_start** (string) - Optional - Period start date. Must be a valid date in the format Y-m-d. - **date_end** (string) - Optional - Period end date. Must be a valid date in the format Y-m-d. - **limit** (integer) - Optional - Limit the number of returned records. Used for pagination. Maximum and default is 100. - **offset** (integer) - Optional - The offset of the first item returned in the records collection. Used for pagination. ### Request Example None ### Response #### Success Response (200) (Response schema not explicitly defined in source, but implies a list of started sessions) #### Response Example (Response example not explicitly defined in source) ``` -------------------------------- ### Create Library with Fetch API (JavaScript) Source: https://developer.digitalsamba.com/ This JavaScript snippet demonstrates creating a new library using the Fetch API. It includes setting the URL, headers, and the JSON request body. Replace `{DEVELOPER_KEY}` with your valid developer key. ```javascript const url = new URL( "https://api.digitalsamba.com/api/v1/libraries" ); const headers = { "Authorization": "Bearer {DEVELOPER_KEY}", "Content-Type": "application/json", "Accept": "application/json", }; let body = { "name": "My photos", "external_id": "EXTID123" }; fetch(url, { method: "POST", headers, body: JSON.stringify(body), }).then(response => response.json()); ``` -------------------------------- ### Get Quiz Data with PHP Guzzle Source: https://developer.digitalsamba.com/ Use this snippet to retrieve quiz data by making a GET request to the API. Ensure you have the Guzzle HTTP client installed and replace `{DEVELOPER_KEY}` with your actual key. ```php $client = new \GuzzleHttp\Client(); $url = 'https://api.digitalsamba.com/api/v1/rooms/a853d608-e6cf-48eb-a3c9-7d089bbc09b0/quizzes/16719c1b-cc82-4dfe-9f6f-40d9093fa695'; $response = $client->get( $url, [ 'headers' => [ 'Authorization' => 'Bearer {DEVELOPER_KEY}', 'Content-Type' => 'application/json', 'Accept' => 'application/json', ], ] ); $body = $response->getBody(); print_r(json_decode((string) $body)); ``` -------------------------------- ### Get Participant Statistics with Guzzle (PHP) Source: https://developer.digitalsamba.com/ Use this snippet with the Guzzle HTTP client in PHP to make a GET request for participant statistics. Ensure you have the Guzzle library installed and replace {DEVELOPER_KEY} with your actual API key. ```php $client = new \GuzzleHttp\Client(); $url = 'https://api.digitalsamba.com/api/v1/participants/totam/statistics'; $response = $client->get( $url, [ 'headers' => [ 'Authorization' => 'Bearer {DEVELOPER_KEY}', 'Content-Type' => 'application/json', 'Accept' => 'application/json', ], ] ); $body = $response->getBody(); print_r(json_decode((string) $body)); ``` -------------------------------- ### Start Restreaming Source: https://developer.digitalsamba.com/ Initiates restreaming for a specified room. You can configure the restreaming provider by type (e.g., 'vimeo', 'youtube') or by providing a custom server URL. A stream key is always required. ```api POST api/v1/rooms/{room}/restreamers/start Headers: Authorization: Bearer {DEVELOPER_KEY} Content-Type: application/json Accept: application/json URL Parameters: room: string (The UUID of the room or room friendly URL. Example: a853d608-e6cf-48eb-a3c9-7d089bbc09b0) Body Parameters: type: string (optional, Restreaming provider. Must be in ['vimeo', 'youtube', 'cloudflare']. Type shouldn't be passed when server_url is provided.) server_url: string (optional, URL of custom restream server. URL shouldn't be passed when type is provided, example: rtmps://rtmp-global.cloud.vimeo.com/live.) stream_key: string (Unique authentication token for your restreaming. Example: 53858671-c5e0-441a-9e33-e5d7f7f1861e) ``` -------------------------------- ### Get Room Statistics (PHP Guzzle) Source: https://developer.digitalsamba.com/ Use this snippet to retrieve room statistics via a GET request using the Guzzle HTTP client in PHP. Ensure you have Guzzle installed and replace `{DEVELOPER_KEY}` with your actual key. ```php $client = new \GuzzleHttp\Client(); $url = 'https://api.digitalsamba.com/api/v1/rooms/ww-/statistics/current'; $response = $client->get( $url, [ 'headers' => [ 'Authorization' => 'Bearer {DEVELOPER_KEY}', 'Content-Type' => 'application/json', 'Accept' => 'application/json', ], ] ); $body = $response->getBody(); print_r(json_decode((string) $body)); ``` -------------------------------- ### Get Session Summary with Fetch API Source: https://developer.digitalsamba.com/ This JavaScript example demonstrates how to fetch session summary data using the Fetch API. It includes setting up the URL and headers for the request. Replace {DEVELOPER_KEY} with your valid developer key. ```javascript const url = new URL( "https://api.digitalsamba.com/api/v1/sessions/a853d608-e6cf-48eb-a3c9-7d089bbc09b0/summary" ); const headers = { "Authorization": "Bearer {DEVELOPER_KEY}", "Content-Type": "application/json", "Accept": "application/json", }; fetch(url, { method: "GET", headers, }).then(response => response.json()); ``` -------------------------------- ### Create Web App File (cURL) Source: https://developer.digitalsamba.com/ This cURL command shows how to create a new web app file. It includes the necessary POST request, headers, and data payload. Remember to replace `{DEVELOPER_KEY}` with your actual API key. ```bash curl --request POST \ "https://api.digitalsamba.com/api/v1/libraries/corrupti/webapps" \ --header "Authorization: Bearer {DEVELOPER_KEY}" \ --header "Content-Type: application/json" \ --header "Accept: application/json" \ --data "{ \"url\": \"https:\/\/www.youtube.com\/embed\/sGV83rWzsdT\", \"name\": \"My YouTube video\", \"folder_id\": \"5ce6fda5-d42b-4110-8796-177e571a7407\", \"initiator_id\": \"4e617b08-98c1-390f-96c8-4607a1dfde3e\" }" ``` -------------------------------- ### Get Poll using Guzzle (PHP) Source: https://developer.digitalsamba.com/ Use this snippet with the Guzzle HTTP client in PHP to make a GET request to retrieve a poll. Ensure you have Guzzle installed and replace placeholders with your actual developer key and room/poll IDs. ```php $client = new \GuzzleHttp\Client(); $url = 'https://api.digitalsamba.com/api/v1/rooms/a853d608-e6cf-48eb-a3c9-7d089bbc09b0/polls/16719c1b-cc82-4dfe-9f6f-40d9093fa695'; $response = $client->get( $url, [ 'headers' => [ 'Authorization' => 'Bearer {DEVELOPER_KEY}', 'Content-Type' => 'application/json', 'Accept' => 'application/json', ], ] ); $body = $response->getBody(); print_r(json_decode((string) $body)); ``` -------------------------------- ### Create Library Folder using cURL Source: https://developer.digitalsamba.com/ Use this cURL command to create a new library folder. Ensure to replace `{DEVELOPER_KEY}` with your actual key and provide the correct `parent_id`. ```bash curl --request POST \ "https://api.digitalsamba.com/api/v1/libraries/error/folders" \ --header "Authorization: Bearer {DEVELOPER_KEY}" \ --header "Content-Type: application/json" \ --header "Accept: application/json" \ --data "{ \"name\": \"My photos\", \"parent_id\": \"5ce6fda5-d42b-4110-8796-177e571a7407\" }" ``` -------------------------------- ### Get Quiz Results with cURL Source: https://developer.digitalsamba.com/ A command-line example using cURL to fetch quiz results. This command includes the GET request, URL with query parameters, and essential headers for authorization and content negotiation. Remember to replace placeholders with your specific values. ```bash curl --request GET \ --get "https://api.digitalsamba.com/api/v1/rooms/a853d608-e6cf-48eb-a3c9-7d089bbc09b0/quizzes/a853d608-e6cf-48eb-a3c9-7d089bbc09b0/results?session_id=5ce6fda5-d42b-4110-8796-177e571a7407" \ --header "Authorization: Bearer {DEVELOPER_KEY}" \ --header "Content-Type: application/json" \ --header "Accept: application/json" ``` -------------------------------- ### Cancel Live Answer (PHP) Source: https://developer.digitalsamba.com/ Use this PHP Guzzle client example to cancel a live answer. Ensure you have the Guzzle HTTP client installed. ```php $client = new \GuzzleHttp\Client(); $url = 'https://api.digitalsamba.com/api/v1/rooms/a853d608-e6cf-48eb-a3c9-7d089bbc09b0/questions/16719c1b-cc82-4dfe-9f6f-40d9093fa695/live-answers/cancel'; $response = $client->post( $url, [ 'headers' => [ 'Authorization' => 'Bearer {DEVELOPER_KEY}', 'Content-Type' => 'application/json', 'Accept' => 'application/json', ], 'json' => [ 'participant' => ['id' => '5b9ca00e-656e-43cc-ba2c-7dcaae63daa9', 'name' => 'John Doe', 'external_id' => 'ABCDEF123'], ], ] ); $body = $response->getBody(); print_r(json_decode((string) $body)); ``` -------------------------------- ### Get Room Statistics Source: https://developer.digitalsamba.com/ Retrieves statistics for a specified room. You can filter the results by providing start and end dates, and select specific metrics to be included in the response. ```APIDOC ## GET api/v1/rooms/{room}/statistics ### Description Retrieves statistics for a specified room. You can filter the results by providing start and end dates, and select specific metrics to be included in the response. ### Method GET ### Endpoint /api/v1/rooms/{room}/statistics ### Parameters #### Path Parameters - **room** (string) - Required - The room identifier. #### Query Parameters - **date_start** (string) - Optional - Period start date. Must be a valid date in the format Y-m-d. - **date_end** (string) - Optional - Period end date. Must be a valid date in the format Y-m-d. - **metrics** (string) - Optional - Metrics to include in the result dataset, separated by commas (e.g., participation_minutes,broadcasted_minutes,subscribed_minutes). ### Request Example ```http GET /api/v1/rooms/ww-/statistics?date_start=2024-02-27&date_end=2024-03-27&metrics=participation_minutes,broadcasted_minutes ``` ### Response #### Success Response (200) - **room_id** (string) - The unique identifier of the room. - **room_external_id** (string) - The external identifier of the room. - **room_description** (string) - A description of the room. - **room_friendly_url** (string) - The friendly URL for the room. - **room_privacy** (string) - The privacy setting of the room (e.g., "public"). - **room_source** (string) - The source of the room (e.g., "api"). - **room_max_participants** (integer) - The maximum number of participants allowed in the room. - **room_is_deleted** (boolean) - Indicates if the room has been deleted. - **participation_minutes** (integer) - Total minutes of participation in the room. - **desktop_participation_minutes** (integer) - Minutes of participation from desktop devices. - **mobile_participation_minutes** (integer) - Minutes of participation from mobile devices. - **tablet_participation_minutes** (integer) - Minutes of participation from tablet devices. - **smarttv_participation_minutes** (integer) - Minutes of participation from smart TVs. - **broadcasted_minutes** (integer) - Total minutes the room was broadcasted. - **subscribed_minutes** (integer) - Total minutes users were subscribed to the room. - **screen_broadcasted_minutes** (integer) - Minutes of screen broadcasting. - **screen_subscribed_minutes** (integer) - Minutes of screen subscription. - **live_participants** (integer) - Number of participants currently live in the room. - **active_participants** (integer) - Number of active participants. - **desktop_participants** (integer) - Number of active participants from desktop devices. - **mobile_participants** (integer) - Number of active participants from mobile devices. - **tablet_participants** (integer) - Number of active participants from tablet devices. - **smarttv_participants** (integer) - Number of active participants from smart TVs. - **sessions** (integer) - The total number of sessions. - **max_concurrent_participants** (integer) - Maximum concurrent participants in a session. - **transcription_minutes** (integer) - Minutes of transcription. - **e2ee_minutes** (integer) - Minutes of end-to-end encryption. - **recorded_minutes** (integer) - Minutes recorded. - **stored_recorded_minutes** (integer) - Minutes of stored recordings. - **whiteboard_minutes** (integer) - Minutes the whiteboard was used. - **captions_minutes** (integer) - Minutes captions were used. - **active_roles** (integer) - Number of active roles. - **breakout_minutes** (integer) - Minutes spent in breakout rooms. - **presentation_minutes** (integer) - Minutes of presentation. - **public_chat_posts** (integer) - Number of public chat posts. - **questions** (integer) - Number of questions asked. - **answers** (integer) - Number of answers provided. - **polls** (integer) - Number of polls conducted. - **summaries** (integer) - Number of summaries generated. - **date_start** (string) - The start date for the statistics period. - **date_end** (string) - The end date for the statistics period. #### Response Example ```json { "room_id": "13a5aa53-f4da-470b-bfd0-63dd9e5dd81d", "room_external_id": "EXTID123", "room_description": "Some public room", "room_friendly_url": "MyPublicRoom", "room_privacy": "public", "room_source": "api", "room_max_participants": 100, "room_is_deleted": false, "participation_minutes": 422, "desktop_participation_minutes": 222, "mobile_participation_minutes": 100, "tablet_participation_minutes": 75, "smarttv_participation_minutes": 25, "broadcasted_minutes": 10, "subscribed_minutes": 10, "screen_broadcasted_minutes": 5, "screen_subscribed_minutes": 5, "live_participants": 0, "active_participants": 10, "desktop_participants": 5, "mobile_participants": 2, "tablet_participants": 2, "smarttv_participants": 1, "sessions": 11, "max_concurrent_participants": 5, "transcription_minutes": 52, "e2ee_minutes": 30, "recorded_minutes": 40, "stored_recorded_minutes": 748, "whiteboard_minutes": 4, "captions_minutes": 10, "active_roles": 2, "breakout_minutes": 4, "presentation_minutes": 0, "public_chat_posts": 2, "questions": 12, "answers": 10, "polls": 2, "summaries": 5, "date_start": "2024-02-27", "date_end": "2024-03-27" } ``` ``` -------------------------------- ### Create Whiteboard using JavaScript Fetch API Source: https://developer.digitalsamba.com/ This JavaScript snippet demonstrates how to create a new whiteboard using the Fetch API. It includes setting up the URL, headers, and request body. ```javascript const url = new URL( "https://api.digitalsamba.com/api/v1/libraries/voluptas/whiteboards" ); const headers = { "Authorization": "Bearer {DEVELOPER_KEY}", "Content-Type": "application/json", "Accept": "application/json", }; let body = { "private": false, "folder_id": "5ce6fda5-d42b-4110-8796-177e571a7407", "storage": "doloribus" }; fetch(url, { method: "POST", headers, body: JSON.stringify(body), }).then(response => response.json()); ``` -------------------------------- ### Get Chat Messages (cURL) Source: https://developer.digitalsamba.com/ Example using cURL to retrieve chat messages from a room. Includes necessary headers and query parameters for authentication and filtering. ```bash curl --request GET \ --get "https://api.digitalsamba.com/api/v1/rooms/a853d608-e6cf-48eb-a3c9-7d089bbc09b0/chat?session_id=16719c1b-cc82-4dfe-9f6f-40d9093fa695&limit=20&offset=0&order=asc" \ --header "Authorization: Bearer {DEVELOPER_KEY}" \ --header "Content-Type: application/json" \ --header "Accept: application/json" ``` -------------------------------- ### Start a live answer Source: https://developer.digitalsamba.com/rest-api/openapi.yaml Initiates a live answer session for a question in a room. This is likely the first step in a real-time Q&A interaction. ```APIDOC ## POST /api/v1/rooms/{room}/questions/{question}/live-answers/start ### Description Starts a live answer session for a given question in a room. ### Method POST ### Endpoint /api/v1/rooms/{room}/questions/{question}/live-answers/start ### Parameters #### Path Parameters - **room** (string) - Required - The UUID of the room or room friendly URL. - **question** (string) - Required - The UUID of the question. ### Response #### Success Response (200) This endpoint does not explicitly define a success response schema in the provided documentation. Typically, a success response would indicate the live session has started, possibly returning session details. #### Error Response No specific error responses are detailed in the provided documentation for this endpoint. ```