AnsweredAssumed Answered

Calling a RESTful API: python

Question asked by Shouchun (Marnith) Peng Peng Employee on May 10, 2017
Latest reply on May 11, 2017 by Shouchun (Marnith) Peng Peng

Hi DevNet,


Now i am able to manual collect the index results from the api page of HCI, but i would like to include that into my python script.


do you happen to have a working sample for python requesting rest api? just in case, you have some ideas.


this is the input that i can get from the api page

curl -X POST --header 'Content-Type: application/json' --header 'Accept: application/json' -d '{

"indexName": "OBSLOG",

"offset": 0,

"itemsToReturn": 100

}' ''


have tried using the request url:


import requests

response = requests.get("")



and this hits to another SSL error

SSLError: ("bad handshake: Error([('SSL routines', 'ssl3_get_server_certificate', 'certificate verify failed')],)",)


Any suggestions?



Best regards,