• ×
    Information
    Windows update impacting certain printer icons and names. Microsoft is working on a solution.
    Click here to learn more
    Information
    Need Windows 11 help?
    Check documents on compatibility, FAQs, upgrade information and available fixes.
    Windows 11 Support Center.
  • post a message
  • ×
    Information
    Windows update impacting certain printer icons and names. Microsoft is working on a solution.
    Click here to learn more
    Information
    Need Windows 11 help?
    Check documents on compatibility, FAQs, upgrade information and available fixes.
    Windows 11 Support Center.
  • post a message
Guidelines
The HP Community is where owners of HP products, like you, volunteer to help each other find solutions.
HP Recommended

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

 

7 REPLIES 7
HP Recommended

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
HP Recommended

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,

 

HP Recommended

In case it helps,

Phone Information

Phone Model: VVX 501

UC Software Version: 5.8.1.7278

Updater Version: 5.9.6.8818

 

 

HP Recommended

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
HP Recommended

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,

 

HP Recommended

Figured it out.

reb = requests.post('https://x.x.x.x/api/v1/mgmt/safeRestart', headers={'Content-Type' : 'applicaation/json'}, auth=('username','password'), verify=False)

I appeciate your help.

 

Jim-D,

 

HP Recommended


Thanks for the update and quick reply. I'll be sure to keep an eye on this thread.  Bumped into your thread. Thanks for creating it. Looking forward for solution.

† The opinions expressed above are the personal opinions of the authors, not of HP. By using this site, you accept the <a href="https://www8.hp.com/us/en/terms-of-use.html" class="udrlinesmall">Terms of Use</a> and <a href="/t5/custom/page/page-id/hp.rulespage" class="udrlinesmall"> Rules of Participation</a>.