Skip to content

Commit

Permalink
Add Tags client prototype (#17)
Browse files Browse the repository at this point in the history
Add support for "tags_list" method to the pototype
Fix for calls which are serving array as response
  • Loading branch information
kartikupadhyay90 authored and mhenrixon committed Sep 10, 2018
1 parent 856b81c commit 8fdf47b
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
10 changes: 10 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,16 @@ All responses are wrapped under `results` so
}
```

For using tags_list action do the following

```ruby
ActiveCampaign.get('tags_list')
```
The response of method is an array of tags

```ruby
[{"id":1,"name":"test_tag","count":1}]
```

## Contributing

Expand Down
1 change: 1 addition & 0 deletions lib/active_campaign/client.rb
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,7 @@ def body(method, _api_method, options = {})
end

def normalize(response)
return response if response.is_a? Array
keys, values = keys_values(response)
if keys.all? { |key| numeric?(key) }
response['results'] = values
Expand Down

0 comments on commit 8fdf47b

Please sign in to comment.