AnsweredAssumed Answered

How to connect to Archer API with Python

Question asked by Anna Fitterer on Oct 7, 2020

I'm very new to using APIs, but I need to connect to one to get data to use for another part of my project. I was given a username, password, and endpoint and am trying to connect to Archer API to consume some data. I am getting this error:

HTTPSConnectionPool(host='URL DELETED FOR PRIVACY', port=443): Max retries exceeded with url: /api/ (Caused by SSLError(SSLCertVerificationError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: self signed certificate in certificate chain (_ssl.c:1108)')))

 

This is my code (with url, username and password declared above copied section):

try:
    response = requests.get('url',
                            auth=HTTPBasicAuth('username''password'))
    response.raise_for_status()
    # Code here will only run if the request is successful
    response.json()
    print(response)
except requests.exceptions.HTTPError as errh:
    print(errh)
except requests.exceptions.ConnectionError as errc:
    print(errc)
except requests.exceptions.Timeout as errt:
    print(errt)
except requests.exceptions.RequestException as err:
    print(err)

Outcomes