### Get All Viewers (cURL) Source: https://developer.ui.com/protect/v7.1.42/get-v1viewers Example cURL command to retrieve all viewer information. Ensure you replace `{consoleId}` with your console's ID and `` with your actual API key. This example requires UniFi Connector with firmware version 5.0.3 or higher. ```bash curl -L -g "https://api.ui.com/v1/connector/consoles/{consoleId}/proxy/protect/integration/v1/viewers" \ -H "Accept: application/json" \ -H "X-API-Key: " ``` -------------------------------- ### Ansible Example Source: https://developer.ui.com/protect/v7.1.42/get-v1ulp-usersid Example Ansible playbook to get UniFi Identity user details. Ensure UniFi Connector firmware is version 5.0.3 or later. ```yaml - name: Get UniFi Identity User Details hosts: localhost connection: local vars: console_id: "" user_id: "" api_key: "" tasks: - name: Call the API to get user details community.general.unifi_connector_api: method: GET path: "/protect/integration/v1/ulp-users/{{ user_id }}" console_id: "{{ console_id }}" api_key: "{{ api_key }}" register: user_details - name: Print user details debug: var: user_details.json ``` -------------------------------- ### Get All Lights (cURL) Source: https://developer.ui.com/protect/v7.1.42/get-v1lights Example cURL command to retrieve detailed information about all lights. Ensure you are using UniFi Connector with firmware version 5.0.3 or later. ```bash curl -L -g "https://api.ui.com/v1/connector/consoles/{consoleId}/proxy/protect/integration/v1/lights" \ -H "Accept: application/json" \ -H "X-API-Key: " ``` -------------------------------- ### cURL Example Source: https://developer.ui.com/protect/v7.1.42/get-v1usersid Example of how to call the Get user details API using cURL. Ensure you replace placeholders like {consoleId}, {id}, and with your actual values. ```shell curl -L -g "https://api.ui.com/v1/connector/consoles/{consoleId}/proxy/protect/integration/v1/users/{id}" \ -H "Accept: application/json" \ -H "X-API-Key: " ``` -------------------------------- ### Get All Cameras (cURL) Source: https://developer.ui.com/protect/v7.1.42/get-v1cameras Use this cURL command to retrieve all camera details. Ensure you replace `{consoleId}` with your console's ID and `` with your actual API key. This example requires UniFi Connector with firmware version 5.0.3 or later. ```bash curl -L -g "https://api.ui.com/v1/connector/consoles/{consoleId}/proxy/protect/integration/v1/cameras" \ -H "Accept: application/json" \ -H "X-API-Key: " ``` -------------------------------- ### Get Live View Details (cURL) Source: https://developer.ui.com/protect/v7.1.42/get-v1liveviewsid Example cURL command to retrieve live view details. Ensure you replace `{consoleId}` and `{id}` with your specific values and provide a valid API key. ```shell curl -L -g "https://api.ui.com/v1/connector/consoles/{consoleId}/proxy/protect/integration/v1/liveviews/{id}" \ -H "Accept: application/json" \ -H "X-API-Key: " ``` -------------------------------- ### cURL Example for Get Device Asset Files Source: https://developer.ui.com/protect/v7.1.46/get-v1filesfiletype Use this cURL command to retrieve a list of device asset files. Ensure your UniFi Connector firmware version is 5.0.3 or later. Replace placeholders like {consoleId}, {fileType}, and with your specific values. ```shell curl -L -g "https://api.ui.com/v1/connector/consoles/{consoleId}/proxy/protect/integration/v1/files/{fileType}" \ -H "Accept: application/json" \ -H "X-API-Key: " ``` -------------------------------- ### Python Example Source: https://developer.ui.com/protect/v7.1.42/get-v1ulp-usersid Example Python code to retrieve user details. This example requires UniFi Connector firmware version 5.0.3 or later. ```python import requests url = f"https://api.ui.com/v1/connector/consoles/{consoleId}/proxy/protect/integration/v1/ulp-users/{id}" headers = { 'Accept': 'application/json', 'X-API-Key': '' } response = requests.get(url, headers=headers) if response.status_code == 200: print(response.json()) else: print(f"Error: {response.status_code}") ``` -------------------------------- ### Node.js Example Source: https://developer.ui.com/protect/v7.1.42/get-v1ulp-usersid Example Node.js code to fetch user details. This uses the UniFi Connector and requires firmware version 5.0.3 or later. ```javascript const url = `https://api.ui.com/v1/connector/consoles/${consoleId}/proxy/protect/integration/v1/ulp-users/${id}`; const headers = { 'Accept': 'application/json', 'X-API-Key': '' }; fetch(url, { method: 'GET', headers: headers }) .then(response => response.json()) .then(data => console.log(data)) .catch(error => console.error('Error:', error)); ``` -------------------------------- ### Install Python Dependencies Source: https://developer.ui.com/protect/v7.1.42/quick_start.ansible Install the required Python packages, httpx and urllib3, using pip. ```bash pip install httpx urllib3 ``` -------------------------------- ### Get Light Details using cURL Source: https://developer.ui.com/protect/v7.1.42/get-v1lightsid Use this cURL command to make a request to the UniFi API to get details for a specific light. Ensure you replace placeholders like {consoleId}, {id}, and with your actual values. This example requires UniFi Connector and firmware version 5.0.3 or later. ```bash curl -L -g "https://api.ui.com/v1/connector/consoles/{consoleId}/proxy/protect/integration/v1/lights/{id}" \ -H "Accept: application/json" \ -H "X-API-Key: " ``` -------------------------------- ### Get Viewer Details using cURL Source: https://developer.ui.com/protect/v7.1.42/get-v1viewersid Use this cURL command to retrieve detailed information about a specific viewer. Ensure you replace placeholders like {consoleId}, {id}, and with your actual values. This example requires UniFi Connector and firmware version 5.0.3 or higher. ```shell curl -L -g "https://api.ui.com/v1/connector/consoles/{consoleId}/proxy/protect/integration/v1/viewers/{id}" \ -H "Accept: application/json" \ -H "X-API-Key: " ``` -------------------------------- ### Install Ansible Collection Source: https://developer.ui.com/protect/v7.1.42/quick_start.ansible Download and install the ubiquiti.unifi_api Ansible collection using curl and ansible-galaxy. ```bash curl -L -o ubiquiti-unifi_api-latest.tar.gz https://apidoc-cdn.ui.com/ansible-module/ubiquiti-unifi_api-latest.tar.gzansible-galaxy collection install ubiquiti-unifi_api-latest.tar.gz ``` -------------------------------- ### Get Camera Details using cURL Source: https://developer.ui.com/protect/v7.1.42/get-v1camerasid Example of how to retrieve detailed information for a specific camera using cURL. This call requires the UniFi Connector and a firmware version of 5.0.3 or later. ```bash curl -L -g "https://api.ui.com/v1/connector/consoles/{consoleId}/proxy/protect/integration/v1/cameras/{id}" \ -H "Accept: application/json" \ -H "X-API-Key: " ``` -------------------------------- ### Get All Speakers (cURL) Source: https://developer.ui.com/protect/v7.1.42/get-v1speakers Use this cURL command to retrieve all speaker information. Ensure you replace `{consoleId}` with your console's ID and `` with your actual API key. This example requires UniFi Connector and firmware version 5.0.3 or later. ```bash curl -L -g "https://api.ui.com/v1/connector/consoles/{consoleId}/proxy/protect/integration/v1/speakers" \ -H "Accept: application/json" \ -H "X-API-Key: " ``` -------------------------------- ### Get All Users (cURL) Source: https://developer.ui.com/protect/v7.1.42/get-v1users Use this cURL command to retrieve all Protect users. Ensure you replace `{consoleId}` with your console ID and `` with your actual API key. This example requires UniFi Connector and FW version 5.0.3 or later. ```bash curl -L -g "https://api.ui.com/v1/connector/consoles/{consoleId}/proxy/protect/integration/v1/users" \ -H "Accept: application/json" \ -H "X-API-Key: " ``` -------------------------------- ### Call to Get Device Asset Files (cURL) Source: https://developer.ui.com/protect/v7.1.42/get-v1filesfiletype Use this cURL command to call the API and retrieve device asset files. Ensure you replace placeholders like {consoleId} and with your actual values. This example requires UniFi Connector with FW version 5.0.3 or later. ```bash curl -L -g "https://api.ui.com/v1/connector/consoles/{consoleId}/proxy/protect/integration/v1/files/{fileType}" \-H "Accept: application/json" \-H "X-API-Key: " ``` -------------------------------- ### Get All Sensors (cURL) Source: https://developer.ui.com/protect/v7.1.42/get-v1sensors Example cURL command to retrieve all sensor data. Ensure you replace `{consoleId}` with your console ID and `` with your actual API key. This call requires UniFi Connector with FW version 5.0.3 or later. ```bash curl -L -g "https://api.ui.com/v1/connector/consoles/{consoleId}/proxy/protect/integration/v1/sensors" \ -H "Accept: application/json" \ -H "X-API-Key: " ``` -------------------------------- ### Sample Response for Get All Users Source: https://developer.ui.com/protect/v7.1.42/get-v1users This is a sample JSON response for the GET /v1/users endpoint, illustrating the structure of user data returned. ```json [ { "id": "string", "name": "string", "firstName": null, "lastName": null, "email": null, "ucoreUserId": null, "modelKey": "string" } ] ``` -------------------------------- ### cURL Example Source: https://developer.ui.com/protect/v7.1.42/get-v1ulp-usersid Example cURL command to retrieve user details. Ensure your UniFi Connector firmware version is 5.0.3 or later. ```shell curl -L -g "https://api.ui.com/v1/connector/consoles/{consoleId}/proxy/protect/integration/v1/ulp-users/{id}" \ -H "Accept: application/json" \ -H "X-API-Key: " ``` -------------------------------- ### Sample Response for Get Camera Details Source: https://developer.ui.com/protect/v7.1.42/get-v1camerasid A sample JSON response for the GET /v1/cameras/{id} endpoint, illustrating the structure and types of data returned for a camera. ```json { "id": "string", "modelKey": "string", "state": "CONNECTED", "name": "string", "mac": "string", "isMicEnabled": true, "osdSettings": { "isNameEnabled": true, "isDateEnabled": true, "isLogoEnabled": true, "isDebugEnabled": true, "overlayLocation": "topLeft" }, "ledSettings": { "isEnabled": true, "welcomeLed": true, "floodLed": true }, "lcdMessage": { "type": "LEAVE_PACKAGE_AT_DOOR", "resetAt": null, "text": "string" }, "micVolume": 0, "activePatrolSlot": 0, "videoMode": "default", "hdrType": "auto", "featureFlags": { "supportFullHdSnapshot": true, "hasHdr": true, "smartDetectTypes": [ "person" ], "smartDetectAudioTypes": [ "alrmSmoke" ], "videoModes": [ "default" ], "hasMic": true, "hasLedStatus": true, "hasSpeaker": true }, "smartDetectSettings": { "objectTypes": [ "person" ], "audioTypes": [ "alrmSmoke" ] }, "hasPackageCamera": true } ``` -------------------------------- ### Get All Relays (cURL) Source: https://developer.ui.com/protect/v7.1.42/get-v1relays Use this cURL command to retrieve detailed information about all UniFi relays. Ensure you replace `{consoleId}` with your console ID and `` with your actual API key. This example requires UniFi Connector with firmware version 5.0.3 or later. ```bash curl -L -g "https://api.ui.com/v1/connector/consoles/{consoleId}/proxy/protect/integration/v1/relays" \ -H "Accept: application/json" \ -H "X-API-Key: " ``` -------------------------------- ### Sample Response for Get Light Details Source: https://developer.ui.com/protect/v7.1.42/get-v1lightsid This is a sample JSON response for a successful request to the get light details endpoint. It includes the light's ID, model, connection state, name, MAC address, various settings, and sensor status. ```json { "id": "string", "modelKey": "string", "state": "CONNECTED", "name": "string", "mac": "string", "lightModeSettings": { "mode": "string", "enableAt": "string" }, "lightDeviceSettings": { "isIndicatorEnabled": true, "pirDuration": 0, "pirSensitivity": 0, "ledLevel": 0 }, "isDark": true, "isLightOn": true, "isLightForceEnabled": true, "lastMotion": null, "isPirMotionDetected": true, "camera": "string" } ``` -------------------------------- ### Get Protect Application Information (cURL) Source: https://developer.ui.com/protect/v7.1.42/get-v1metainfo Use this cURL command to retrieve generic information about the UniFi Protect application. Ensure you replace `{consoleId}` with your console's ID and `` with your actual API key. This example requires UniFi Connector and firmware version 5.0.3 or later. ```bash curl -L -g "https://api.ui.com/v1/connector/consoles/{consoleId}/proxy/protect/integration/v1/meta/info" \ -H "Accept: application/json" \ -H "X-API-Key: " ``` -------------------------------- ### Test Speaker Sound cURL Example Source: https://developer.ui.com/protect/v7.1.42/post-v1speakersidtest-sound Example cURL command to test speaker sound. Requires UniFi Connector and firmware version 5.0.3 or higher. The 'volume' parameter controls the test sound volume. ```curl curl -L -g "https://api.ui.com/v1/connector/consoles/{consoleId}/proxy/protect/integration/v1/speakers/{id}/test-sound" \ -H "Accept: application/json" \ -H "X-API-Key: " \ -H "Content-Type: application/json" \ -d "{ \"volume\": 0}" ``` -------------------------------- ### Call GET /v1/link-stations/{id} with cURL Source: https://developer.ui.com/protect/v7.1.42/get-v1link-stationsid Use this cURL command to retrieve detailed information about a specific link station. Ensure you replace placeholders like {consoleId}, {id}, and with your actual values. This example requires UniFi Connector with firmware version 5.0.3 or later. ```bash curl -L -g "https://api.ui.com/v1/connector/consoles/{consoleId}/proxy/protect/integration/v1/link-stations/{id}" \ -H "Accept: application/json" \ -H "X-API-Key: " ``` -------------------------------- ### Get All Viewers Response Sample Source: https://developer.ui.com/protect/v7.1.42/get-v1viewers A sample JSON response for the GET /v1/viewers endpoint, illustrating the structure and data types of viewer information. ```json [ { "id": "string", "modelKey": "string", "state": "CONNECTED", "name": "string", "mac": "string", "liveview": "string", "streamLimit": 0 } ] ``` -------------------------------- ### Response Sample for Get All Arm Profiles Source: https://developer.ui.com/protect/v7.1.42/get-v1arm-profiles This is a sample JSON response for the GET /v1/arm-profiles endpoint, illustrating the structure of the returned arm profile data. ```json [ { "id": "string", "name": "string", "automations": [ "string" ], "creator": "string", "schedules": [ { "start": "string", "end": "string" } ], "recordEverything": true, "activationDelay": 0, "createdAt": 0, "updatedAt": 0 } ] ``` -------------------------------- ### Sample Response for Get All Cameras Source: https://developer.ui.com/protect/v7.1.42/get-v1cameras This is a sample JSON response for the 'Get all cameras' endpoint, illustrating the structure and types of data returned for each camera. ```json [ { "id": "string", "modelKey": "string", "state": "CONNECTED", "name": "string", "mac": "string", "isMicEnabled": true, "osdSettings": { "isNameEnabled": true, "isDateEnabled": true, "isLogoEnabled": true, "isDebugEnabled": true, "overlayLocation": "topLeft" }, "ledSettings": { "isEnabled": true, "welcomeLed": true, "floodLed": true }, "lcdMessage": { "type": "LEAVE_PACKAGE_AT_DOOR", "resetAt": null, "text": "string" }, "micVolume": 0, "activePatrolSlot": 0, "videoMode": "default", "hdrType": "auto", "featureFlags": { "supportFullHdSnapshot": true, "hasHdr": true, "smartDetectTypes": [ "person" ], "smartDetectAudioTypes": [ "alrmSmoke" ], "videoModes": [ "default" ], "hasMic": true, "hasLedStatus": true, "hasSpeaker": true }, "smartDetectSettings": { "objectTypes": [ "person" ], "audioTypes": [ "alrmSmoke" ] }, "hasPackageCamera": true }] ``` -------------------------------- ### Response Sample for Get All Lights Source: https://developer.ui.com/protect/v7.1.42/get-v1lights A sample JSON response structure for the 'Get all lights' endpoint, illustrating the expected fields and data types for each light. ```json [ { "id": "string", "modelKey": "string", "state": "CONNECTED", "name": "string", "mac": "string", "lightModeSettings": { "mode": "string", "enableAt": "string" }, "lightDeviceSettings": { "isIndicatorEnabled": true, "pirDuration": 0, "pirSensitivity": 0, "ledLevel": 0 }, "isDark": true, "isLightOn": true, "isLightForceEnabled": true, "lastMotion": null, "isPirMotionDetected": true, "camera": "string" } ] ``` -------------------------------- ### Start Camera PTZ Patrol Slot (cURL) Source: https://developer.ui.com/protect/v7.1.42/post-v1camerasidptzpatrolstartslot Use this cURL command to start a PTZ patrol for a specific camera at a given slot. Ensure your UniFi Connector firmware version is 5.0.3 or later. Replace placeholders like {consoleId}, {id}, {slot}, and with your actual values. ```curl curl -L -g -X POST "https://api.ui.com/v1/connector/consoles/{consoleId}/proxy/protect/integration/v1/cameras/{id}/ptz/patrol/start/{slot}" \ -H "Accept: application/json" \ -H "X-API-Key: " ``` -------------------------------- ### Create Talkback Session Source: https://developer.ui.com/protect/v7.1.42/post-v1camerasidtalkback-session Initiates a talkback session for a specified camera and returns the talkback stream URL and audio configuration. ```APIDOC ## POST /v1/cameras/{id}/talkback-session ### Description Returns the talkback stream URL and audio configuration for a specific camera. ### Method POST ### Endpoint `/v1/cameras/{id}/talkback-session` ### Parameters #### Path Parameters - **id** (string) - Required - The primary key of camera ### Response #### Success Response (200) - **url** (string) - Required - Talkback stream URL - **codec** (string) - Required - Audio format to use. - **samplingRate** (integer) - Required - Sampling Rate. - **bitsPerSample** (integer) - Required - Bits per sample. ### Response Example ```json { "url": "https://example.com", "codec": "string", "samplingRate": 0, "bitsPerSample": 0 } ``` ``` -------------------------------- ### Get NVR Details using cURL Source: https://developer.ui.com/protect/v7.1.42/get-v1nvrs Use this cURL command to retrieve NVR details. Ensure you replace `{consoleId}` with your console ID and `` with your actual API key. This example requires UniFi Connector with firmware version 5.0.3 or later. ```cURL curl -L -g "https://api.ui.com/v1/connector/consoles/{consoleId}/proxy/protect/integration/v1/nvrs" \ -H "Accept: application/json" \ -H "X-API-Key: " ``` -------------------------------- ### Create live view Source: https://developer.ui.com/protect/v7.1.46/post-v1liveviews Creates a new live view with specified configurations for cameras and layout. ```APIDOC ## POST /v1/liveviews ### Description Create a new live view. ### Method POST ### Endpoint /v1/liveviews ### Parameters #### Request Body - **id** (string) - Required - The primary key of liveview - **modelKey** (string) - Required - The model key of the liveview - **name** (string) - Required - The name of this live view. - **isDefault** (boolean) - Required - Whether this live view is the default one for all viewers. - **isGlobal** (boolean) - Required - Whether this live view is global and available system-wide to all users - **owner** (string) - Required - The primary key of user - **layout** (number) - Required - The number of slots this live view contains. Which as a consequence also affects the layout of the live view. - **slotsExpand** (Array of object) - Required - List of cameras visible in each given slot. And cycling settings for each slot if it has multiple cameras listed. ### Response #### Success Response (200) - **id** (string) - The primary key of liveview - **modelKey** (string) - The model key of the liveview - **name** (string) - The name of this live view. - **isDefault** (boolean) - Whether this live view is the default one for all viewers. - **isGlobal** (boolean) - Whether this live view is global and available system-wide to all users - **owner** (string) - The primary key of user - **layout** (number) - The number of slots this live view contains. Which as a consequence also affects the layout of the live view. - **slotsExpand** (Array of object) - List of cameras visible in each given slot. And cycling settings for each slot if it has multiple cameras listed. ### Request Example ```json { "id": "string", "modelKey": "string", "name": "string", "isDefault": true, "isGlobal": true, "owner": "string", "layout": 0, "slots": [ { "cameras": [ "string" ], "cycleMode": "motion", "cycleInterval": 0 } ] } ``` ### Response Example ```json { "id": "string", "modelKey": "string", "name": "string", "isDefault": true, "isGlobal": true, "owner": "string", "layout": 0, "slots": [ { "cameras": [ "string" ], "cycleMode": "motion", "cycleInterval": 0 } ] } ``` ``` -------------------------------- ### Call GET /v1/relays/{id} Endpoint Source: https://developer.ui.com/protect/v7.1.42/get-v1relaysid Use this cURL command to retrieve details for a specific relay. Ensure you replace `{consoleId}` and `{id}` with your actual values and provide a valid API key. This example requires UniFi Connector with FW version 5.0.3 or later. ```curl curl -L -g "https://api.ui.com/v1/connector/consoles/{consoleId}/proxy/protect/integration/v1/relays/{id}" \ -H "Accept: application/json" \ -H "X-API-Key: " ``` -------------------------------- ### Create Talkback Session (cURL) Source: https://developer.ui.com/protect/v7.1.42/post-v1camerasidtalkback-session Use this cURL command to initiate a talkback session for a specific camera. Ensure you are using the UniFi Connector with firmware version 5.0.3 or higher. ```bash curl -L -g -X POST "https://api.ui.com/v1/connector/consoles/{consoleId}/proxy/protect/integration/v1/cameras/{id}/talkback-session" \ -H "Accept: application/json" \ -H "X-API-Key: " ``` -------------------------------- ### Get RTSPS Stream URL (cURL) Source: https://developer.ui.com/protect/v7.1.42/get-v1camerasidrtsps-stream Use this cURL command to retrieve RTSPS stream URLs for a camera. Ensure you replace placeholders like {consoleId}, {id}, and with your actual values. This example requires UniFi Connector and firmware version 5.0.3 or later. ```shell curl -L -g "https://api.ui.com/v1/connector/consoles/{consoleId}/proxy/protect/integration/v1/cameras/{id}/rtsps-stream" \ -H "Accept: application/json" \ -H "X-API-Key: " ``` -------------------------------- ### Create Live View (cURL) Source: https://developer.ui.com/protect/v7.1.42/post-v1liveviews Use this cURL command to create a new live view. Ensure you replace placeholders like {consoleId} and with your actual values. The request body specifies the live view's configuration. ```bash curl -L -g "https://api.ui.com/v1/connector/consoles/{consoleId}/proxy/protect/integration/v1/liveviews" \ -H "Accept: application/json" \ -H "X-API-Key: " \ -H "Content-Type: application/json" \ -d "{ \"id\": \"string\", \"modelKey\": \"string\", \"name\": \"string\", \"isDefault\": true, \"isGlobal\": true, \"owner\": \"string\", \"layout\": 0, \"slots\": [ { \"cameras\": [ \"string\" ], \"cycleMode\": \"motion\", \"cycleInterval\": 0 } ]}" ``` -------------------------------- ### Connector GET Source: https://developer.ui.com/protect/v7.1.42/connectorget Forward GET requests to UniFi applications using RESTful HTTP methods. The request is proxied through api.ui.com cloud endpoint to the remote console at http://127.0.0.1/proxy/[path] with GET method. ```APIDOC ## GET /v1/connector/consoles/{id}/*path ### Description Forward GET requests to UniFi applications using RESTful HTTP methods. The request is proxied through `api.ui.com` cloud endpoint to the remote console at `http://127.0.0.1/proxy/[path]` with GET method. ### Method GET ### Endpoint `/v1/connector/consoles/{id}/*path` ### Parameters #### Path Parameters - **id** (string) - Required - Host ID to proxy the request to - **path** (string) - Required - API path to proxy ### Request Example ```curl curl -L -g "https://api.ui.com/v1/connector/consoles/{id}/*path" \ -H "Accept: application/json" \ -H "X-API-Key: " ``` ### Response #### Success Response (200) On success, the upstream API response is passed through directly. #### Response Example ```json { "count": 1, "data": [ { "id": "88f7af54-98f8-306a-a1c7-c9349722b1f6", "internalReference": "default", "name": "Default" } ], "limit": 25, "offset": 0, "totalCount": 1 } ``` ``` -------------------------------- ### Response Sample Source: https://developer.ui.com/protect/v7.1.42/get-v1ulp-usersid Sample JSON response for a successful request to retrieve user details. ```json { "id": "string", "firstName": "string", "lastName": "string", "fullName": "string", "status": "ACTIVE", "modelKey": "string" } ``` -------------------------------- ### Get Application Information Source: https://developer.ui.com/protect/v7.1.42/quick_start.ansible Retrieve metadata about the UniFi Protect application using a GET request to the /v1/meta/info path. ```yaml tasks: - name: Get application info ubiquiti.unifi_api.protect: path: "/v1/meta/info" method: GET register: info - debug: var: site_info.data ``` -------------------------------- ### Talkback Session Response Sample Source: https://developer.ui.com/protect/v7.1.42/post-v1camerasidtalkback-session This is a sample JSON response for a successful talkback session creation, including the stream URL and audio configuration. ```json { "url": "https://example.com", "codec": "string", "samplingRate": 0, "bitsPerSample": 0 } ``` -------------------------------- ### Sample Response for Get All Fobs Source: https://developer.ui.com/protect/v7.1.42/get-v1fobs This is a sample JSON response for the GET /v1/fobs endpoint, illustrating the structure and data fields for a fob. ```json [ { "id": "string", "modelKey": "string", "state": "CONNECTED", "name": "string", "mac": "string", "awayState": "ONLINE", "featureFlags": { "buttons": [ "function" ] }, "wirelessConnectionState": { "signalState": { "signalQuality": null, "signalStrength": null }, "batteryStatus": { "percentage": null, "isLow": true }, "bridge": "string" } } ] ``` -------------------------------- ### cURL Example for Connector POST Request Source: https://developer.ui.com/protect/v7.1.42/connectorpost This snippet demonstrates how to make a POST request to a UniFi console using cURL. It includes setting headers for API key and content type, and provides a sample JSON payload. ```shell curl -L -g "https://api.ui.com/v1/connector/consoles/{id}/*path" \ -H "Accept: application/json" \ -H "X-API-Key: " \ -H "Content-Type: application/json" \ -d "{ \"action\": \"AUTHORIZE_GUEST_ACCESS\"}" ``` -------------------------------- ### Get All Relays Response Sample Source: https://developer.ui.com/protect/v7.1.42/get-v1relays This is a sample JSON response for the 'Get All Relays' endpoint, illustrating the structure and data types of relay information. ```json [ { "id": "string", "modelKey": "string", "state": "CONNECTED", "name": "string", "mac": "string", "ledSettings": { "isEnabled": true }, "outputs": [ { "id": 0, "name": null, "type": null, "delay": null, "pulseDuration": null, "state": null, "rebootState": "restore" } ], "inputs": [ { "id": 0, "name": null, "state": null, "actionTrigger": null, "actionType": null, "actionOutputId": null } ], "wirelessConnectionState": { "signalState": { "signalQuality": null, "signalStrength": null }, "batteryStatus": { "percentage": null, "isLow": true }, "bridge": "string" } } ] ``` -------------------------------- ### Get All Speakers Response Sample Source: https://developer.ui.com/protect/v7.1.42/get-v1speakers This is a sample JSON response for the GET /v1/speakers endpoint, illustrating the structure and data types of speaker information. ```json [ { "id": "string", "modelKey": "string", "state": "CONNECTED", "name": "string", "mac": "string", "volume": 0, "micVolume": 0, "isMicEnabled": true, "speakerState": { "status": "idle", "mode": "listen" }, "featureFlags": { "hasMic": true } } ] ``` -------------------------------- ### Live View Details Response Sample Source: https://developer.ui.com/protect/v7.1.42/get-v1liveviewsid Sample JSON response for a successful request to get live view details. This schema includes identifiers, configuration, and layout information for the live view. ```json { "id": "string", "modelKey": "string", "name": "string", "isDefault": true, "isGlobal": true, "owner": "string", "layout": 0, "slots": [ { "cameras": [ "string" ], "cycleMode": "motion", "cycleInterval": 0 } ] } ``` -------------------------------- ### Sample Response for Get Chimes Source: https://developer.ui.com/protect/v7.1.42/get-v1chimes This is a sample JSON response for the GET /v1/chimes endpoint, illustrating the structure and data fields returned for each chime. ```json [ { "id": "string", "modelKey": "string", "state": "CONNECTED", "name": "string", "mac": "string", "cameraIds": [ "string" ], "ringSettings": [ { "cameraId": "string", "repeatTimes": 0, "ringtoneId": "string", "volume": 0 } ] } ] ```