FormAPI Ruby Client
The form_api gem is an API client library for FormAPI.
You can use FormAPI to generate PDFs. Configure your PDF template in our online editor,
then post data to fill out the PDF.
Supported Ruby Versions
The form_api gem supports Ruby >= 1.9.3. We run our tests with the following Ruby versions:
1.9.32.1.102.4.2
Installation
gem install form_api
Or add the following to your Gemfile.
gem "form_api"
Then run:
bundle install
Usage
See examples for some runnable examples.
FormAPI.configure do |config|
config.username = "YOUR_API_TOKEN_ID"
config.password = "YOUR_API_TOKEN_SECRET"
end
formapi = FormAPI::Client.new
response = formapi.generate_pdf(
template_id: 'YOUR_TEMPLATE_ID', # ID of a template that you have configured
test: true, # Test documents are free but watermarked
wait: true, # Wait for the PDF to be processed (default: true)
data: { # Data to render in the template
name: "foo",
number: 42
},
metadata: { # Custom data to include in the request, for your own purposes
user_id: 123
}
)
# {
# status: "success",
# submission: {
# id: "bymRSZYTKDnd6jfY",
# test: true,
# state: "processed",
# download_url: "https://..."
# }
# }
This submits a PDF request and waits for the job to finish.
More Help
See the FormAPI documentation for more information.
Please email us if you need any help.
Development
The majority of the code in this repo is generated using swagger-codegen.
You can modify this file and regenerate the client using scripts/generate.
Release Process
- Pull latest master
- Merge feature branch(es) into master
script/test- Increment version in code:
swagger-config.jsonlib/formapi/version.rb
- Update CHANGELOG.md
- Commit "Release version vX.Y.Z"
rake release- Verify package release at https://rubygems.org/gems/formapi
- Refresh documentation on formapi.io
Version Policy
This library follows Semantic Versioning 2.0.0.