我已经尝试过尽我所能让它发挥作用。我翻阅了活动监控 API 文档,并在互联网上搜索了我能找到的所有可能的文章。我没有找到一个更新订户记录的代码示例。我可以得到记录。我只是无法更新它,我希望有人可以帮助我找出我做错了什么。谢谢!
from createsend import *
def GetSubscribers(token, refresh_token, list_id):
auth = {
'access_token': token,
'refresh_token': refresh_token}
user_email = 'email@example.com'
subscriber = Subscriber(auth, list_id, user_email).get()
for i in subscriber.CustomFields:
for n in i.__dict__.keys():
print(i.__dict__[n])
if i.__dict__[n] == "campaign_code":
print(n, i.__dict__[n])
print(i.__dict__["Value"])
campaign_code = i.__dict__["Value"]
new_campaign_code = campaign_code + "_REPLIED"
print(new_campaign_code)
custom_fields = [
{"Key": i.__dict__[n], "Value": new_campaign_code}]
Subscriber.update(user_email, "Subscriber",
custom_fields, True, True, "Yes")
参数 = {“电子邮件”:self.email_address}
AttributeError:“str”对象没有属性“email_address”