UCPrimer
  • UCprimer
  • About

Exploring the REST API Feature of Poly Teams Room devices

2/28/2024

0 Comments

 
Picture
Poly is a leading provider of communication and collaboration technology, offering a wide range of products and services to enhance the way people connect and work together. One of the key features of Poly's technology is the REST (Representational State Transfer) API, which provides a convenient, scalable, portable, and reliable way to interact with Poly video systems. The REST API allows users to execute certain functions and retrieve information from Poly video systems, enabling greater control and customization of their communication and collaboration experience. This feature is available on a range of Poly MTR Android systems, including the Poly G7500, Poly Studio X70, X50 and X30. In this blogpost, we explore the REST API commands that are available.
Before using the REST API, it is important to note that administrator credentials are required for access authentication. Poly recommends changing the default administrator password before using the REST API. Additionally, all request and response bodies should be processed as JSON formatted data, and the REST API cannot accept more than 10 MB of data. The REST API feature is always on and cannot be disabled.

The primary audience for the REST API feature is systems integrators who intend to enable configuration and management of system features through integrated systems. However, the REST API can also be useful for advanced users who want to have greater control over their Poly video systems.

The REST API offers a wide range of commands and functions, covering various aspects of the Poly video system. These include audio, calendar, cameras, collaboration, conferences, directory, session, system, SysTracker, video, and diagnostics. Each of these categories includes a range of specific commands and functions, allowing users to fully customize and control their Poly video system.

The System category allows admins to perform maintenance tasks for multiple devices. For example, below is a simple Powershell script to reboot multiple PolyOS devices:

# This is very basic script to reboot Poly OS devices using REST API (PowerShell 6+ required)
$DeviceIPs = @("192.168.0.136";"192.168.0.214";"192.168.0.133")
$DeviceUserName = "admin"
$DevicePassword = "XXXXXXX"
$SessionRequestBody = ConvertTo-Json @{user=$DeviceUserName ; password=$DevicePassword }
$RebootRequestBody = ConvertTo-Json @{action="reboot" }
foreach ($DeviceIP in $DeviceIPs)
    { Invoke-WebRequest -Method 'POST' -Uri ("https://" + $DeviceIP + "/rest/session") -Body $SessionRequestBody -ContentType 'application/json' -SkipCertificateCheck -SessionVariable session
      Start-Sleep -Seconds 2
      Invoke-WebRequest -Method 'POST' -Uri ("https://" + $DeviceIP + "/rest/system/reboot") -Body $RebootRequestBody -ContentType 'application/json' -SkipCertificateCheck -WebSession $session
      Start-Sleep -Seconds 2
    }


Running the above script will immediately reboot the devices and output the following:
Picture
For example, the audio category includes commands for retrieving audio information, performing audio actions, and controlling microphone mute and volume. Below is a sample Powershell script that leverages the audio GET method:

# This is very basic script to get audio info from Poly OS devices using REST API (PowerShell 6+ required)
$DeviceIPs = @("192.168.0.136";"192.168.0.214";"192.168.0.133")
$DeviceUserName = "admin"
$DevicePassword = "XXXXXXX"
$SessionRequestBody = ConvertTo-Json @{user=$DeviceUserName ; password=$DevicePassword }

foreach ($DeviceIP in $DeviceIPs)
   { Invoke-WebRequest -Method "POST" -Uri ("https://" + $DeviceIP + "/rest/session") -Body $SessionRequestBody -ContentType "application/json" -SkipCertificateCheck -SessionVariable SV
      Start-Sleep -Seconds 2
      Invoke-WebRequest -Method "GET" -Uri ("https://" + $DeviceIP + "/rest/audio") -SkipCertificateCheck -WebSession $SV
      Start-Sleep -Seconds 2
    }


Running the above script will obtain audio status information:

Content: {"volume":48,"muted":false,"muteLocked":false,"numOfMicsConnected":2}

The output is as shown below:
Picture
​The cameras category includes commands for controlling near and far cameras, managing camera presets, and retrieving camera information. Below is a sample script that performs a hide action on the local video:

​#This is very basic script to hide local video using REST API (PowerShell 6+ required)
$DeviceIPs = @("192.168.0.136";"192.168.0.214";"192.168.0.133")
$DeviceUserName = "admin"
$DevicePassword = "admin"
$SessionRequestBody = ConvertTo-Json @{user=$DeviceUserName ; password=$DevicePassword }
$VideoRequestBody = ConvertTo-Json @{"mute"=$true }
foreach ($DeviceIP in $DeviceIPs)

    { Invoke-WebRequest -Method 'POST' -Uri ("https://" + $DeviceIP + "/rest/session") -Body $SessionRequestBody -ContentType 'application/json' -SkipCertificateCheck -SessionVariable session

      Start-Sleep -Seconds 2

      Invoke-WebRequest -Method 'POST' -Uri ("https://" + $DeviceIP + "/rest/video/local/mute") -Body $VideoRequestBody -ContentType 'application/json' -SkipCertificateCheck -WebSession $session

      Start-Sleep -Seconds 2
    }


The output will provide the result in Content: {"success":true} as per screenshot below:
Picture
There are many more REST methods available for different categories and it would not be feasible to provide examples for all. A full list of REST API methods are referenced in the attached document for this blogpost.

In addition to the REST API methods, Poly also offers a range of resources and support for users. The Poly Online Support Center is the entry point for online product, service, and solution support, offering video tutorials, documents and software, a knowledge base, community discussions, Poly University, and additional services. The Poly Document Library provides support documentation for active products, services, and solutions, while the Poly Community offers access to the latest developer and support information.
​Overall, the REST API feature of Poly products and services offers a powerful and flexible way for users to control and customize their communication and collaboration experience. With a wide range of commands and functions, and extensive support and resources available, the REST API is a valuable tool for systems integrators and advanced users alike.
video-os-rest-api-4-0-0.pdf
File Size: 834 kb
File Type: pdf
Download File

0 Comments

Your comment will be posted after it is approved.


Leave a Reply.

    UCPrimer

    Picture
    Picture
    Picture
    View my profile on LinkedIn

    Important Links

    Microsoft Teams Docs
    Microsoft Learn

    ​Microsoft MVP Blogs

    Michael Tressler’s Blog
    Michael’s MTR Quick Tip Videos
    Jimmy Vaughan’s Blog
    Jeff Schertz
    Adam Jacobs
    James Cussen
    ​Damien Margaritis

    Archives

    March 2025
    February 2025
    January 2025
    December 2024
    November 2024
    October 2024
    August 2024
    July 2024
    May 2024
    April 2024
    March 2024
    February 2024
    December 2023
    November 2023
    October 2023
    September 2023
    July 2023
    March 2023
    February 2023
    January 2023
    November 2022
    October 2022
    September 2022
    August 2022
    July 2022
    March 2022
    February 2022
    January 2022
    December 2021
    November 2021
    October 2021
    September 2021
    August 2021
    June 2021
    April 2021
    March 2021
    December 2020
    October 2020
    September 2020
    August 2020
    April 2020
    March 2020
    February 2020
    January 2020
    December 2019
    November 2019
    October 2019
    September 2019
    August 2019
    July 2019
    March 2019
    November 2018
    October 2018
    September 2018
    August 2018
    June 2018
    March 2018
    February 2018
    January 2018
    December 2017
    November 2017
    August 2017
    July 2017
    April 2017
    March 2017
    February 2017
    January 2017
    November 2016
    October 2016
    September 2016
    August 2016
    July 2016
    June 2016
    May 2016
    April 2016
    March 2016
    January 2016
    November 2015
    October 2015
    September 2015
    August 2015
    July 2015
    June 2015
    May 2015
    April 2015
    March 2015
    February 2015
    January 2015
    December 2014
    November 2014
    October 2014
    September 2014
    August 2014
    July 2014
    June 2014
    May 2014
    April 2014
    March 2014
    February 2014
    January 2014
    December 2013
    November 2013
    October 2013
    September 2013
    August 2013
    July 2013
    June 2013
    May 2013
    April 2013
    March 2013
    February 2013
    January 2013
    December 2012
    November 2012
    September 2012
    August 2012

    Categories

    All
    Edge
    Exchange 2013
    Hybrid
    Lpe
    Lync 2010
    Lync 2013
    Mobility
    Oauth
    Office365
    Polycom
    Ucs

    RSS Feed

    This website uses marketing and tracking technologies. Opting out of this will opt you out of all cookies, except for those needed to run the website. Note that some products may not work as well without tracking cookies.

    Opt Out of Cookies