我正在使用 aweber gem 将订阅者添加到 aweber 列表。
我遵循了所有需要的步骤(创建应用程序,验证应用程序)。
以下代码可以检索所需的列表,但在尝试检索订阅者时会引发错误(第 6 行)
1: oauth = AWeber::OAuth.new('XXXXXXXXXX', 'XXXXXXXXX')
2: oauth.authorize_with_access('XXXXXXXXXX', 'XXXXXXXXX')
3: aweber = AWeber::Base.new(oauth)
4: list = aweber.account.lists.find_by_name("listname")
5: if list
6: subscriber = list.subscribers.find_by_email("user@example.com")
7: if subscriber.size > 0
8: subscriber.first.last.custom_fields["custom_field"] = "custom_field_value"
9: subscriber.first.last.save
10: else
11: subscriber = {}
12: subscriber["email"] = "user@example.com"
13: subscriber["custom_fields"] = {"custom_field"=>"custom_field_value"}
14: list.subscribers.create(subscriber)
15: end
16: end
日志文件中的错误:
AWeber::ForbiddenRequestError (Method requires extended permissions.):
line : 6.