Sure. Here is a bit of my code using Python 3.9.12:
import requests
import json
import base64
import pandas as pd
# Define your API credentials and parameters
api_credentials = ("
mye...@mail.com", "mypassword") # Replace with your actual email and password
headers = {
"Authorization": "Basic " + base64.b64encode(f"{api_credentials[0]}:{api_credentials[1]}".encode()).decode(),
"Content-Type": "application/json"
}
# Define the request data in JSON format
request_data = {
"from_loc": "ABE",
"to_loc": "ABW",
"from_time": "0700",
"to_time": "0800",
"from_date": "2016-07-01",
"to_date": "2016-08-01",
"days": "WEEKDAY"
}
And here is the summary of the error I am receiving:
TimeoutError: [Errno 60] Operation timed out
During handling of the above exception, another exception occurred:
NewConnectionError: <urllib3.connection.HTTPSConnection object at 0x7fc85800f7f0>: Failed to establish a new connection: [Errno 60] Operation timed out
During handling of the above exception, another exception occurred:MaxRetryError: HTTPSConnectionPool(host='hsp-prod.rockshore.net', port=443): Max retries exceeded with url: /api/v1/serviceMetrics (Caused by NewConnectionError('<urllib3.connection.HTTPSConnection object at 0x7fc85800f7f0>: Failed to establish a new connection: [Errno 60] Operation timed out'))
During handling of the above exception, another exception occurred:ConnectionError: HTTPSConnectionPool(host='hsp-prod.rockshore.net', port=443): Max retries exceeded with url: /api/v1/serviceMetrics (Caused by NewConnectionError('<urllib3.connection.HTTPSConnection object at 0x7fc85800f7f0>: Failed to establish a new connection: [Errno 60] Operation timed out'))
This code was working fine until yesterday afternoon.
Your help is much appreciated.
Damilola.