我正在使用 createdend 库尝试与我的 Campaign Monitor 帐户建立连接。我想统计和监控一段时间内发送给所有用户的电子邮件。但是在尝试使用分配给我登录的用户的 api 密钥时,出现错误。
!pip install createsend
from createsend import *
cs = CreateSend({'api_key': 'my_api_key'})
clients = cs.clients()
错误:
Unauthorized: The CreateSend API responded with the following error - 50:
Must supply a valid HTTP Basic Authorization header
这个 api 密钥是否需要属于我发送给的每个特定用户,而不是我登录的用户?如果是这样,我如何自动使用我的登录 api 密钥来获取所有用户所需的所有密钥......然后获得随时间发送的监控电子邮件的最终产品?
使用的文档:
https://github.com/campaignmonitor/createsend-python
https://help.createsend.com/admin/api-keys
https://github.com/campaignmonitor/createsend-python/blob/master/lib/createsend/transactional.py