Plantronics + Polycom. Now together as Poly Logo

[FAQ] Rest API for G7500 and Studio X

Highlighted
Polycom Employee & Community Manager

[FAQ] Rest API for G7500 and Studio X

Hello all,

 

a quick introduction to the Poly G7500 Command-Line API Reference Guide or the Poly G7500 Command-Line API Reference Guide

 

Please always ensure you are using the latest >Poly VideoOS REST API< and/or >Poly Command-Line API< from the User and Administrator Documents >here<

 

If a UI is preferred a Tool like https://www.postman.com/ can be used. Instructions similar to this are >here<

 

Command-Line API

 

Enabling the Command Line access via Security > Access will either prompt you for the standard user name of the unit (factory default admin) using ssh and/or the password.

 

G7500_Studio_X_REST_API_01.png

 

Using for example:

 

 

addrbook all

 

 

will return all the Speed Dials added to the system.

 

REST API

 

Based on the above REST API documentation in order to establish a session a user would initially login to the system:

 

 

curl -b cookies.txt -c cookies.txt -d "{\"user\": \"admin\",\"password\": \"123\"}" -H "Content-Type: application/json" -k https://192.168.0.9/rest/session

 

 

For the above, we use CURL as this can be used with Windows 10 MS-Dos and/or Linux machines.

MS-Dos.png

  • -k is being used to use HTTPs and trust the certificate of the Studio X and/or G7500
  • -c is the instruction to write cookies to a file
    -b is the instruction to read cookies from a file
    For more details on cookies check >here<
  • Ensure you use the right Admin (example admin) user and password (example 123)

The reply includes the sessionId which we store in the cookie.txt

 

 

{"loginStatus":{"failedLogins":0,"isPasswordAgeLimitReached":false,"lastLoginClient":"127.0.0.1","lastLoginClientType":"WEB","lastLoginTime":1591786577000,"loginResult":"NOLOCKOUT"},"session":{"clientType":"WEB","creationTime":2688,"isAuthenticated":true,"isConnected":false,"isNew":true,"isStale":false,"location":"192.168.0.5","role":"ADMIN","sessionId":"PSVG+zUra9TcTFaKpvG0RUP6J6ITchMilk70Gc3k4Rydr0N6Uy","userId":"admin"},"success":true}

 

 

We can then continue to use this cookie.txt

 

# Netscape HTTP Cookie File
# https://curl.haxx.se/docs/http-cookies.html
# This file was generated by libcurl! Edit at your own risk.

#HttpOnly_192.168.0.9	FALSE	/	TRUE	0	session_id	PSVG+zUra9TcTFaKpvG0RUP6J6ITchMilk70Gc3k4Rydr0N6Uy

 

 

to continue the session

 

 

curl -b cookies.txt -c cookies.txt -k https://192.168.0.9/rest/system

 

 

and the G7500 and/or Studio X will respond

 

{"build":"216109","buildType":"dev","hardwareVersion":"1","lanStatus":{"duplex":"FULL","speedMbps":1000,"state":"LAN_UP"},"model":"StudioX50","rebootNeeded":false,"serialNumber":"8L19445XXXXXX","softwareVersion":"3.1.1","state":"READY","systemName":"BaierSteffenGSeries","systemTime":1591789081000,"timeOffset":10800000,"timeServerState":"TIMESERVER_UP","uptime":2689.95}

 

 

Reboot a Studio X or G7500:

 

curl -b cookies.txt -c cookies.txt -X POST -d "{\"user\": \"admin\",\"password\": \"123\"}" -H "Content-Type: application/json" -k https://10.252.149.104/rest/session
curl -b cookies.txt -c cookies.txt -H "Content-Type: application/JSON" -k https://10.252.149.104/rest/system/reboot -d "{\"action\": \"reboot\"}"

 

 

 

Disable the Wireless advertisement of MiraCast and/or Airplay:

 

1st we check the current setting

 

curl -b cookies.txt -c cookies.txt -d "{\"user\": \"admin\",\"password\": \"626DFB\"}" -H "Content-Type: application/json" -k https://10.252.149.104/rest/session
curl -b cookies.txt -c cookies.txt -X POST -H "Content-Type: application/json" -k https://10.252.149.104/rest/config -d "{\"names\": [\"system.network.wireless.wifi.enabled\"]}" 

 

 

 

The system will respond with

 

{"vars":[{"name":"system.network.wireless.wifi.enabled","result":"NOERROR","value":"True","isEditable":true,"isHidden":false,"isSecure":false}]}

 

 

In the above case the Wireless in Security - Wireless Security is enabled.

 

We can then also check the Miracast

 

curl -b cookies.txt -c cookies.txt -X POST -H "Content-Type: application/json" -k https://10.252.149.104/rest/config -d "{\"names\": [\"cast.miracast.enabled\"]}"
{"vars":[{"name":"cast.miracast.enabled","result":"NOERROR","value":"True","isEditable":false,"isHidden":false,"isSecure":false}]}

 

 

and/or Airplay state

 

curl -b cookies.txt -c cookies.txt -X POST -H "Content-Type: application/json" -k https://10.252.149.104/rest/config -d "{\"names\": [\"cast.airplay.enabled\"]}"
{"vars":[{"name":"cast.airplay.enabled","result":"NOERROR","value":"True","isEditable":true,"isHidden":false,"isSecure":false}]}

 

or Bluetooth

curl -b cookies.txt -c cookies.txt -d "{\"user\": \"admin\",\"password\": \"626DFB\"}" -H "Content-Type: application/json" -k https://10.252.149.104/rest/session
curl -b cookies.txt -c cookies.txt -X POST -H "Content-Type: application/json" -k https://10.252.149.104/rest/config -d "{\"names\": [\"system.network.wireless.bt.enabled\"]}" 
{"vars":[{"name":"system.network.wireless.bt.enabled","result":"NOERROR","value":"True","isEditable":true,"isHidden":false,"isSecure":false}]}

 

In order to disable all broadcasting WiFi and Bluetooth for example in Partner Modes simply set all to False:

 

 

curl -b cookies.txt -c cookies.txt -d "{\"user\": \"admin\",\"password\": \"626DFB\"}" -H "Content-Type: application/json" -k https://10.252.149.104/rest/session
curl -b cookies.txt -c cookies.txt -X POST -H "Content-Type: application/json" -k https://10.252.149.104/rest/config -d "{\"names\": [\"system.network.wireless.wifi.enabled\"]}" 
curl -b cookies.txt -c cookies.txt -X POST -H "Content-Type: application/json" -k https://10.252.149.104/rest/config -d "{\"names\": [\"system.network.wireless.bt.enabled\"]}" 
curl -b cookies.txt -c cookies.txt -X POST -H "Content-Type: application/json" -k https://10.252.149.104/rest/config -d "{\"vars\":[{\"name\":\"cast.airplay.enabled\",\"value\":\"False\"}]}
curl -b cookies.txt -c cookies.txt -X POST -H "Content-Type: application/json" -k https://10.252.149.104/rest/config -d "{\"vars\":[{\"name\":\"cast.miracast.enabled\",\"value\":\"False\"}]}
curl -b cookies.txt -c cookies.txt -X POST -H "Content-Type: application/json" -k https://10.252.149.104/rest/config -d "{\"vars\":[{\"name\":\"system.network.wireless.bt.enabled\",\"value\":\"False\"}]}

 

 

----------------

Notice: This community forum is not an official Poly support resource, thus responses from Poly employees, partners, and customers alike are best-effort in attempts to share learned knowledge. If you need immediate and/or official assistance please open a service ticket through your proper support channels.
Please also ensure you always check the VoIP , Video Endpoint , Skype for Business , PSTN or RPM FAQ's