对于这样一个基本问题,我提前道歉。我尝试使用 Insightly for Python github repo。示例代码是:
from insightly import Insightly
i = Insightly(apikey=my_api_key)
我用我的 apikey 尝试了这个并得到了 401 错误。IT 验证了他们为我提供 API 密钥的帐户具有所有必要的权限。
我也尝试过使用 python 请求。文档说“API 密钥需要作为 Base64 编码的用户名包含在内,密码留空。”
我的代码是:
import requests
r = requests.get('https://api.na1.insightly.com/v3.1/Contacts',auth=(my_api_key,''))
这也有401错误。
有没有更好的方法来使用 python 访问 Insightly API?