Issues Accessing OSI API Data using web api with Python

I'm currently facing a challenge while attempting to retrieve data from the OSI API using Python. When I try to access the data through a browser, it displays without any issues. However, when I attempt to fetch the data using Python, I encounter the following error:

HTTPSConnectionPool(host='your_api_url.com', port=443): Max retries exceeded with url: /piwebapi/auth/login (Caused by NameResolutionError("<urllib3.connection.HTTPSConnection object at 0x00000189DE38CB80>: Failed to resolve 'your_api_url.com' ([Errno 11001] getaddrinfo failed)"))

Additionally, when using Postman to access the same endpoint, I receive a 401 Unauthorized request error.

I would greatly appreciate any insights, suggestions, or guidance from the community on how to resolve these issues. If anyone has experience working with OSI API in Python or has encountered similar problems

  • I was originally going to lookup the auth workflow for PI Server 2023 since I see that you're calling /auth/login (although I do not believe this is an endpoint even when using AVEVA AIM). However, it says that it failed to resolve your API server. Looks like something with DNS is messed up on the server where you're running the python. Make sure the API server is reachable and resolvable from that server.