Skip to content

nekapoor/paperform-ruby

Repository files navigation

Paperform-Ruby

This gem is a VERY basic wrapper around the very new Paperform API. I love Paperform and use it a lot in a lot of my projects. The API will help a lot and this wrapper should (hopefully!) make things easier as well.

Installation

Add this line to your application's Gemfile:

gem 'paperform-ruby'

And then execute:

$ bundle

Or install it yourself as:

$ gem install paperform-ruby

Usage

Head to the developer documentation page on the paperform website for general info about the api. To get started, you'll need to generate a token. This will serve as the bearer token passed with every request you send to Paperform. Visit this page in your paperform account to generate one. Note that you'll need to have a Pro or Agency account in order to use the API. Store this somewhere in your rails app (like a .env file or something). From there, you can use the gem like this:

Auth

After we have gotten our token, we just need to initialize the client

 client = Paperform::Client.new(token: token)

Every request returns a JSON body response

Forms

client.forms

You can also pass in parameters that you need.

client.forms(limit: 200, skip: 3)
``

## Form

```ruby
client.form(slug_or_id)

Form Fields

client.form_fields(slug_or_id)

Partial Submissions

client.partial_submissions(form: form)

You can also pass in parameters that you need.

client.partial_submissions(limit: 200, skip: 3)

Partial Submission

client.partial_submission(slug_or_id)

Submissions

client.submissions(form: form)

You can also pass in parameters that you need.

client.submissions(form: form, limit: 200, skip: 3)

Submission

client.submission(slug_or_id)

Contributing

Bug reports and pull requests are welcome on GitHub at https://github.com/nekapoor/paperform-ruby.

License

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

About

A wrapper gem around the paperform api

Resources

License

Stars

Watchers

Forks

Packages

No packages published