-
×InformationNeed Windows 11 help?Check documents on compatibility, FAQs, upgrade information and available fixes.
Windows 11 Support Center. -
-
×InformationNeed Windows 11 help?Check documents on compatibility, FAQs, upgrade information and available fixes.
Windows 11 Support Center. -
- HP Community
- Poly Phones
- Desk and IP Conference Phones
- Formating REST API Post in Python

Create an account on the HP Community to personalize your profile and ask a question

02-12-2021 02:14 PM
I'm trying to send a POST request to restart a phone using python:requests-module to the API and getting either "400 Bad Request" or "4000 Invalid input parameters.
This is the request.
reb = requests.post('https://10.10.10.10/api/v1/mgmt/safeReboot', json, auth=('username','password'),)
Not sure what I'm missing, but any help is appreciated.
I got this from the following document.
Using the "ucsoftware-restapi.pdf",
Management.Restart
Protocol, Method & Path
Protocol: HTTP/HTTPS
Method: POST
Path: /api/v1/mgmt/safeRestart
Input / Output Format Access Level
JSON
Input
None
Output
Applicable return codes
Success Response:
{“Status”: “2000” }
Failure Response:
{ “Status”: “5000” }
2000, 5000
02-12-2021 02:53 PM
Hello @Jim-D ,
Welcome to the Poly Community.
The Voice FAQ contains:
Jun 05, 2018 Question: Do Poly Phones support a REST API?
Resolution: Please => here <=
the above has examples that you can use and work your way back.
Please ensure to provide some feedback if this reply has helped you so other users can profit from your experience.
Best Regards
Steffen Baier
Notice: I am an HP Poly employee but all replies within the community are done as a volunteer outside of my day role. This community forum is not an official HP Poly support resource, thus responses from HP Poly employees, partners, and customers alike are best-effort in attempts to share learned knowledge.
If you need immediate and/or official assistance for former Poly\Plantronics\Polycom please open a service ticket through your support channels
For HP products please check HP Support.
Please also ensure you always check the General VoIP , Video Endpoint , UC Platform (Microsoft) , PSTN

02-12-2021 03:08 PM
Thank you for your response, I've read those documents and they only say post "None" or nothing to the url - https://x.x.x.x/api/v1/mgmt/safeRestart
I'm sending:
reb = requests.post('https://x.x.x.x/api/v1/mgmt/safeReboot', "Content-Type: application/json", auth=('username','password'))
keep getting code 400 or 4000. I can issue a GET request, but for some reason I can't sent a POST. I'm not using powershell.
Any help is appreciated.
Thanks,
Jim-D,
02-12-2021 03:34 PM
Hello @Jim-D
you are using an unsupported software. Update to a currently supported software for your phone model and then test one of the examples. CURL or Power Shell and then you can work your way back with Python
replied via a mobile device
Notice: I am an HP Poly employee but all replies within the community are done as a volunteer outside of my day role. This community forum is not an official HP Poly support resource, thus responses from HP Poly employees, partners, and customers alike are best-effort in attempts to share learned knowledge.
If you need immediate and/or official assistance for former Poly\Plantronics\Polycom please open a service ticket through your support channels
For HP products please check HP Support.
Please also ensure you always check the General VoIP , Video Endpoint , UC Platform (Microsoft) , PSTN

02-12-2021 03:49 PM
Thanks for the suggestion. Unfortunately this is the version of software on the 2000+ phones. I can not change that at this time.
I did try the powershell commands on a test windows pc and it does work, so I know the phones will respond to a saferestart api request. What I need help with is how to put that into a python request so the phone will do the same thing.
Thanks,
Jim-D,

