@Laltu Singhโ : To access an API in Databricks from within a restricted network, you may need to configure a proxy server to route your requests through like below.
import os
os.environ['HTTP_PROXY'] = 'http://<proxy_hostname>:<proxy_port>'
os.environ['HTTPS_PROXY'] = 'http://<proxy_hostname>:<proxy_port>'
os.environ['NO_PROXY'] = '<comma-separated-list-of-hostnames-or-IP-addresses>'
Replace <proxy_hostname> and <proxy_port> with the hostname and port of your proxy server, respectively. Replace <comma-separated-list-of-hostnames-or-IP-addresses> with a comma-separated list of hostnames or IP addresses that should not be routed through the proxy.
If you continue to experience issues accessing the API, it may be helpful to reach out to the network administrator for the restricted network to ensure that the necessary firewall rules are in place to allow traffic to and from the API endpoint.