You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
opensslreq-x509-nodes-days9999-newkeyrsa:2048-keyoutpython-key.pem-outpython-cert.pemimportrequestsimportbase64importurllib3# Suppress the InsecureRequestWarning related to verify=Falseurllib3.disable_warnings(urllib3.exceptions.InsecureRequestWarning)
# Variables (replace with actual values)shc_api="https://192.168.0.10:8444"# Replace with your actual SHC API URLapi_version="3.13"# Replace with the actual API version you're usingsystem_password_base64=base64.b64encode(b'testtest').decode('utf-8') # Replace with your password# Endpoint for devicesurl=f"{shc_api}/smarthome/devices"# Replace with the actual devices endpoint# Path to client certificate and key files (replace with actual paths)client_cert= ('/home/user/python-cert.pem', '/home/user/python-key.pem') # Update these paths# Headersheaders= {
'Content-Type': 'application/json',
'User-Agent': 'PostmanRuntime/7.42.0',
'Accept': '*/*',
'Accept-Encoding': 'gzip, deflate, br',
'Connection': 'keep-alive',
'Systempassword': system_password_base64,
'api-version': api_version,
'Host': '192.168.0.10:8444',
}
# No payload needed for GET request to /smarthome/devices# Make the GET request with client certificateresponse=requests.get(url, headers=headers, cert=client_cert, verify=False, timeout=120)
# Print the responseprint(f"Status Code: {response.status_code}")
print(f"Response Body: {response.text}")
The text was updated successfully, but these errors were encountered:
That was working for me. But I didn't know the option "cert" in requests.get etc.
Are more detailed docu would be good.
first following the postman instruction: https://github.com/BoschSmartHome/bosch-shc-api-docs/tree/master/postman
The text was updated successfully, but these errors were encountered: