Typeform is a Ruby gem that provides a wrapper for interacting with the Typeform Data API.
Add this line to your application's Gemfile:
gem 'typeform'
And then execute:
$ bundle
Or install it yourself as:
$ gem install typeform
Please refer to the Typeform Data API Documentation for more information about the API, or follow the examples below:
require 'typeform'
Typeform.api_key = ENV['TYPEFORM_API_KEY']
typeform_id = "an_id_here"
form = Typeform::Form.new(typeform_id)
all_entries = form.all_entries
incomplete_entries = form.incomplete_entries
complete_entries = form.complete_entries
# Fetches all complete entries since today
newest_entries = form.complete_entries(since: Date.today.to_time.to_i)
For now, the wrapper returns the default format as returned by the Typeform Data API. I have some thoughts on how they should structure their data and how they can be build a Hypermedia APIs, but the current implementation allows you to build your custom logic on top of the responses (e.g. your pagination logic).
- Fork it ( https://github.com/ClarkSource/typeform/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