Open xkraty opened 6 years ago
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.
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"})
Aweber added support for tagging subscribers