Skip to content
This repository was archived by the owner on Aug 29, 2019. It is now read-only.

Conversation

@xkraty
Copy link

@xkraty xkraty commented Feb 12, 2018

Aweber added support for tagging subscribers

@masha256
Copy link

Is this feature working for you? I am trying to use it to edit tags of an existing subscriber and I always get back:

"{"error": {"status": 400, "documentation_url": "https://labs.aweber.com/docs/troubleshooting#badrequest", "message": "tags: You tried to modify a nonexistent attribute. https://labs.aweber.com/docs/troubleshooting#badrequest", "type": "BadRequestError"}}"

I am setting the tags using the 'add' and 'remove' keys of the tags attribute, as their documentation says, such as:

subscriber.tags={'add' => ['tag1','tag2']}
subscriber.save

But I get the error.

@xkraty
Copy link
Author

xkraty commented Jul 26, 2018

Yeah it do work, I'm using the list collection link to patch the subscriber

url = @aweber.account.lists.find_by_id(list_id).subscribers_collection_link() + "/#{user["id"]}"
consumer = OAuth::Consumer.new(AWEBER_APP_USER, AWEBER_APP_PASSWORD, site: AWeber.auth_endpoint)
access_token = OAuth::AccessToken.new(consumer, Setting.get(AWEBER_ACCESS_TOKEN), Setting.get(AWEBER_ACCESS_SECRET))
access_token.patch(url, { tags: { add: tags } }.to_json, {"Content-Type" => "application/json"})

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants