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.
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.
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\"}"
A community search finds this power shell example >here<
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\"}]}
Disable the Device Mode
Check if Device mode is active:
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 -X GET -H "Content-Type: application/json" -k https://10.252.149.104/rest/system/mode/device
The system responds with:
{"result":true}
Disabling the device mode:
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 -X DELETE -H "Content-Type: application/json" -k https://10.252.149.104/rest/system/mode/device
The system responds with
{"success":true}
Use POST instead of DELETE to set Device mode
Remote Control Check
Check the battery status of a Bluetooth remote:
curl -b cookies.txt -c cookies.txt -X POST -d "{\"user\": \"admin\",\"password\": \"789\"}" -H "Content-Type: application/json" -k https://10.252.149.104/rest/session
curl -b cookies.txt -c cookies.txt -X GET -H "Content-Type: application/JSON" -k https://10.252.149.104/rest/system/bluetooth
Please be aware this is working at present but could change at any point. If you need this ensured please work with Poly sales to request this to be documented.
The reply would be (if a remote is paired):
[{"batteryLevel":100,"firmwareRevision":"97","id":"80:6F:B0:45:BF:81","name":"Polycom Remote","connected":true}]
If official support is required please check how to phone or open a case here
----------------