In Datahug's documentation, it states, 'Authentication is performed using HTTP Basic Authentication - A Datahug username and password will be required in order to access the API.'
As a result, I've tried the below (with my username and password defined)
import requests
from requests.auth import HTTPBasicAuth
url = 'https://api.datahug.com/Contact/'
l = requests.get(url,auth=HTTPBasicAuth(username,password)
But I receive the following error:
<Response [401]>
Am I doing something wrong here?
I've also tried the following:
import requests
from requests.auth import HTTPBasicAuth
url = "https://api.datahug.com/Contact/test@test.com"
l = requests.get(url,auth=(username,password))