Ruby client for the Perfect Audience reporting api
Add this line to your application's Gemfile:
gem 'perfecta'
And then execute:
$ bundle
Or install it yourself as:
$ gem install perfecta
client = Perfecta::Client.new do |c|
c.email = 'email@ddress'
c.password = 'password'
endThis will exchange the credentials for an API token and use this token for all subsequent calls.
You can now use the client instance to query the API.
### List all Campaign Reports
p client.campaign_reports.inspectOptional Query Parameters include
| Name | Type |
|---|---|
| interval | ['today','yesterday','last_7_days','last_30_days','lifetime'] |
| start_date | 'YYYY-MM-DD' |
| end_date | 'YYYY-MM-DD' |
| site_id | 'the_site_id' |
| campaign_id | 'the_site_id' |
and can be used by supplying a hash e.g.
p client.campaign_reports(interval: 'yesterday').inspectp client.ad_reports.inspectAny of the additional query parameters from the above table can be supplied as a hash.
p client.conversion_reports.inspectAny of the additional query parameters from the above table can be supplied as a hash.
p client.sites.inspectp client.site('SITE_ID').inspectp client.campaigns.inspectp client.campaign('CAMPAIGN_ID').inspectp client.ads.inspectp client.ad('AD_ID').inspectp client.segments.inspectp client.segment('SEGMENT_ID').inspectp client.conversions.inspectp client.conversion('CONVERSION_ID').inspectFlesh out the rest of the APIAccept query parameters- Error handling, specifically for when token expires
- Relationships and delegation between of objects
Get rid of all the duplication
- Fork it
- Create your feature branch (
git checkout -b my-new-feature) - Commit your changes (
git commit -am 'Add some feature') - Push to the branch (
git push origin my-new-feature) - Create new Pull Request


