[英]How to access datahug API via HTTP Authentication?
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.' 在Datahug的文档中 ,它指出:“身份验证是使用HTTP基本身份验证执行的-需要Datahug用户名和密码才能访问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))
I've tracked the issue down to the Datahug Edition your account was configured to. 我已将问题追溯到您的帐户配置为的Datahug版本。 It was
CRM Only
which at the moment doesn't allow API access. 是
CRM Only
,目前不允许API访问。 I've changed the account Edition to Full
which will also give you access to the web app and you will also be able to make api calls. 我已将帐户Edition更改为
Full
,这也使您可以访问该网络应用,并且还可以进行api调用。
You should now get a valid response when you make API calls. 现在,当您进行API调用时,您应该会得到一个有效的响应。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.