This serves as a Wrapper to http://developer.fyber.com/content/ios/offer-wall/offer-api/
Add this line to your application's Gemfile:
gem 'fyber_api_wrapper', git: 'git@github.com:dinks/fyber_api_wrapper.git'
And then execute:
$ bundle
For the Fyber API to work, you must have an API Key which is available on demand.
Please have a look at the api documantation.
With Rails, set up the configuration
require 'fyber_api_wrapper'
FyberApiWrapper.configure do |config|
config.format = :json
config.appid = 157
config.offer_types = [ 112 ]
config.api_key = ENV['FYBER_API_KEY']
end
where FYBER_API_KEY
is set up as an environment variable. Now you are ready to use the FyberApiWrapper
to access the offers
api.
Use FyberApiWrapper.offers(options)
to get a FyberApiWrapper::Request
object. Call this object with .get
to get the response.
FyberApiWrapper.offers(options).get(more_options)
The response could be a FyberApiWrapper::Response
if all goes well.
If exceptions are raised, then it could be one of
FyberApiWrapper::UnauthorizedError
- 401 HttpstatusFyberApiWrapper::BadRequestError
- 400 HttpstatusFyberApiWrapper::ResponseError
- all the others
Specs were written using Rspec
. The requests were recorded using vcr
and stored so that it can be replayed.
- Fork it ( https://github.com/[my-github-username]/fyber_api_wrapper/fork )
- 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 a new Pull Request