Using the Fulcrum Ruby API gem

07 August 2012 by Chris Hall

In the last few months we’ve had a lot of interest from developers wanting to build connectors and integrations from their own apps to the Fulcrum platform — to do things like publishing maps from data collected in their Fulcrum accounts, and import data from their own databases to update in the field. We just published our Fulcrum Ruby API gem on GitHub, giving Ruby developers an easy set of tools for interacting with the Fulcrum API in their applications. We’re currently using this gem in some of our own apps and projects, and thought it would be great to open it up to other developers.

You will need to be using Ruby 1.9.x in order to use this gem. You will also need a Fulcrum user account to get an API token. After that it’s as simple as installing and configuring the gem.

Using bundler:

# bundler
gem 'fulcrum'

Or, if not using bundler:

gem install fulcrum

Then just either bundle install or require 'fulcrum' and you are good to go!

Once you are setup, you will need to point it to the Fulcrum API and also provide your Fulcrum API key, the link to which can be found on your user profile page. If you’re interested in using the Fulcrum API in your own apps, let us know on Twitter or our support site.

Fulcrum::Api.configure do |config|
  config.uri = 'https://web.fulcrumapp.com/api/v2'
  config.key = 'your_api_token'
end

Once you have configured the gem, you can now start making API calls to your account in Fulcrum. For example, to retrieve a list of of your apps:

Fulcrum::Form.all

This will return a paginated list of the apps you have created. You can also pass parameters to fetch a specific page or to return the form schema (or not).

Fulcrum::Form.all(page: 2)
Fulcrum::Form.all(schema: false)

More information and documentation on the Fulcrum API can be found on the Fulcrum API gem GitHub readme or on our Fulcrum developer site.

About the author

Chris worked a software engineer with Fulcrum, and contributed to our web and backend platform.

comments powered by Disqus

Sign Up Today & Start Collecting Data In Just Minutes!

Start Your FREE Trial