========
AdRoll Developer Documentation
Add this line to your application's Gemfile:
gem 'adroller'
And then execute:
$ bundle
Or install it yourself as:
$ gem install adroller
API version: v1
API base url: https://services.adroll.com/api/v1/
API documentation: https://developers.adroll.com/docs/
Set your API token, and organization eid in your environment
ENV['ADROLL_TOKEN'] = 'Your personal access token'
ENV['ADROLL_ORGANIZATION'] = 'Your Organization eid'
ENV['ADROLL_API_KEY'] = 'Your Developer App apikey'
This gem uses basic abstraction for the AdRoll services
A method call will return a JSON response directly from the api
AdRoll::Api::{Endpoint Name}.{Endpoint Method}({Endpoint Parameters})
When authenticating Facebook, there is an optional parameter you can pass in for the HTTP request method
AdRoll::Api::Facebook.fb_page_url(params, method = :get)
The default method is get method, and it expects the request method as symbol name e.g. :post, :get. Pass in :post when authenticating for first time, and :get once the Facebook page is authenticated
For Universal Campaigns, there are POST/PUT requests that have query strings as well as JSON data. For HTTP Requests that have JSON data as well as query paramters, pass in the JSON data as the first argument, and the query parameters second, then finally the HTTP Request method as symbol.
Here are some example to show how to call the universal campaigns endpoints
# GET Request for AdGroup
AdRoll::Api::UniversalCampaigns.adgroup(query_params, method = :get)
# POST Request for AdGroup
AdRoll::Api::UniversalCampaigns.adgroup(json_params, query_params, method = :post)
params = {
name: 'My Advertisable',
organization: 'FDS32DFA3DK341B4KAL4RK',
set_as_default: true,
url: 'http://www.thisisaurl.com',
product_name: 'My Product'
}
advertisable = AdRoll::Api::Advertisable.create(params)
=> {:name => 'My Advertisable' ... }
To make a new release of the AdRoller gem:
- Change the version.rb file to include the new version number
- Merge your changes to the gem.
- Click releases at the top of this page
- Click 'Draft a new release'
- Enter the new version number as the 'tag version'
- Add information about what changes in this version
- Click 'Publish release'
- Change adroller gem version in the Gemfile where it is being used