Skip to content

Latest commit

 

History

History
45 lines (28 loc) · 1.08 KB

File metadata and controls

45 lines (28 loc) · 1.08 KB

GimmieAPI

Ruby wrapper for the Gimmie API for sending Events and retrieving owned Stamp Cards.

Installation

Add this line to your application's Gemfile:

gem 'gimmie_api', github: 'gimmie/ruby'

And then execute:

$ bundle

Set the client key, secret, and api url by doing:

GimmieAPI.client_key = 'yourclientkey'
GimmieAPI.client_secret = 'yourclientsecret'
GimmieAPI.api_root = 'http://instancename.gimmie.io' # replace instancename with your instance name

Optionally, you can change the Faraday adapter, by default it is:

GimmieAPI.faraday_adapter = Faraday.default_adapter

Which should work just fine for most use cases but if you have a special use case, see the Faraday documentation.

Usage

See the specs for examples, but basically:

response = GimmieAPI::Client.new(uid: uid).trigger('name_of_event', {'user_property_name' => 'user_property_value', ...})
response.success? # basic faraday response object

License

The gem is available as open source under the terms of the MIT License.