Speakers

Managing speakers in an account

Before you begin

It is important to note the following:

  • A speaker needs to be associated to a camera in order to use 2-Way Audio.
  • A speaker can be associated with multiple cameras.
  • A camera can have only one speaker associated with it.

Adding a speaker to an account

It is possible to add a speaker using API for 2-Way Audio communication using the Eagle Eye Cloud VMS.

  1. Identify the speaker using the availableDevices endpoint.
curl --location --request GET 'https://baseURL/api/v3.0/availableDevices?deviceType__in=speaker&pageSize=200' \
--header 'Authorization: Bearer <access_token>'
{
    "nextPageToken": "",
    "prevPageToken": "",
    "totalSize": 1,
    "results": [
        {
            "deviceType": "speaker",
            "guid": "9cd9c991-8997-47bd-8f04-0013cb28312f",
            "state": "addable",
            "unknownCredentials": false,
            "visibleByBridges": [
                "1000ba31",
                "1003171a"
            ],
            "make": "Zenitel",
            "model": "Video_Normal_TCIV-2+/TCIV-3+",
            "firmwareVersion": "6.4.3.9",
            "ipAddress": "10.1.140.91"
        }
    ]
}
  1. Add the speaker to your account using the /speakers endpoint.

The POST request needs the speaker's guid, the bridgeid of the speaker's bridge, and the IP address.

curl --location --request POST 'https://baseURL/api/v3.0/speakers' \
--header 'Accept: application/json' \
--header 'authorization: Bearer <access token>' \
--header 'Content-Type: application/json' \
--data-raw '{
   "name" : "mySpeaker",
   "guid": "8a45491e-c834-475d-b741-32b56320aad2",
    "bridgeId": "10047fde",
  "ipAddress": "10.143.240.60",
  "registrationStrategy": "discoveredSip"
}'

An example response once the speaker is added:

{
    "id": "10041ae2",
    "accountId": "00059884",
    "name": "mySpeaker",
    "bridgeId": "10047fde",
    "locationId": "a48736e6-5f3d-4ace-9aba-ce4ce07edd49",
    "isShared": false
}

Viewing speakers in an account

The GET /speakers request returns all speakers added to the account.

curl --location --request GET 'https://<baseUrl>/api/v3.0/speakers' \
--header 'Accept: application/json' \
--header 'authorization: Bearer <access token>'
{
    "nextPageToken": "",
    "prevPageToken": "",
    "totalSize": 1,
    "results": [
        {
            "deviceType": "speaker",
            "guid": "9cd9c991-8997-47bd-8f04-0013cb28312f",
            "state": "addable",
            "unknownCredentials": false,
            "visibleByBridges": [
                "1000ba31",
                "1003171a"
            ],
            "make": "Zenitel",
            "model": "Video_Normal_TCIV-2+/TCIV-3+",
            "firmwareVersion": "6.4.3.9",
            "ipAddress": "10.1.140.91"
        }
    ]
}

Removing speakers from an account

Remove a speaker with the DELETE request by providing the speakerId.

curl --location --request DELETE 'https://baseUrl/api/v3.0/speakers/10041ae2' \
--header 'Accept: application/json' \
--header 'authorization: Bearer <access token>'

Result: A successful request returns a 204 response.

Attaching speaker to cameras

Attach a speaker to multiple cameras using the /cameras:bulkUpdate endpoint. Add the speaker ID of the speaker you would like to attach to the cameras, and the camera IDs of said cameras.

Example:

curl --location --request POST 'https://baseUrl/api/v3.0/cameras:bulkUpdate' \
--header 'Authorization: Bearer <access token> \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--data-raw '{
  "ids": [
    "1007d450",#camera ids
    "10097318",
    "1003d468"
  ],
  "updateFields": {
    "speakerId": "100de0f9"
  }
}'
{
    "response": {
        "10097318": {
            "status": 204
        },
        "1007d450": {
            "status": 204
        },
        "1003d468": {
            "status": 204
        }
    }
}