INNER CODE UNIT · Python
conn
nordnet/next-api-v2-examples · python3/test_program.py:210
conn = http.client.HTTPSConnection(API_URL + country_code)
headers = {"Accept": "application/json"}
# Check Nordnet API status. Check Nordnet API documentation page to verify the path
print("Checking Nordnet API status...")
uri = API_PREFIX + '/' + API_VERSION + '/'
j = send_http_request(conn, 'GET', uri, '', headers)
# Login using SSH key authentication
j = ssh_key_authentication(conn, api_key, country_code, private_key_path)
# Store Nordnet API login response data
public_feed_hostname = j["public_feed"]["hostname"]
public_feed_port = j["public_feed"]["port"]
our_session_key = j["session_key"]
print(f"Successfully authenticated. Session key: {our_session_key}")