README.md in form_api-0.1.5 vs README.md in form_api-0.2.0

- old
+ new

@@ -1,105 +1,121 @@ -# FormAPI Ruby Client +# form_api -[![Build Status](https://travis-ci.org/FormAPI/formapi-ruby.svg?branch=master)](https://travis-ci.org/FormAPI/formapi-ruby) +FormAPI - the Ruby gem for the API V1 -The `form_api` gem is an API client library for [FormAPI](https://formapi.io). -You can use FormAPI to generate PDFs. Configure your PDF template in our online editor, -then post data to fill out the PDF. +No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) -## Supported Ruby Versions +This SDK is automatically generated by the [Swagger Codegen](https://github.com/swagger-api/swagger-codegen) project: -The `form_api` gem supports Ruby >= `1.9.3`. We run our tests with the following Ruby versions: +- API version: v1 +- Package version: 0.2.0 +- Build package: io.swagger.codegen.languages.RubyClientCodegen -* `1.9.3` -* `2.1.10` -* `2.4.2` - ## Installation -```bash -gem install form_api -``` +### Build a gem -Or add the following to your `Gemfile`. +To build the Ruby code into a gem: -```ruby -gem "form_api" +```shell +gem build form_api.gemspec ``` -Then run: +Then either install the gem locally: -```bash -bundle install +```shell +gem install ./form_api-0.2.0.gem ``` +(for development, run `gem install --dev ./form_api-0.2.0.gem` to install the development dependencies) +or publish the gem to a gem hosting service, e.g. [RubyGems](https://rubygems.org/). -## Usage +Finally add this to the Gemfile: -See [examples](examples/) for some runnable examples. + gem 'form_api', '~> 0.2.0' +### Install from Git + +If the Ruby gem is hosted at a git repository: https://github.com/GIT_USER_ID/GIT_REPO_ID, then add the following in the Gemfile: + + gem 'form_api', :git => 'https://github.com/GIT_USER_ID/GIT_REPO_ID.git' + +### Include the Ruby code directly + +Include the Ruby code directly using `-I` as follows: + +```shell +ruby -Ilib script.rb +``` + +## Getting Started + +Please follow the [installation](#installation) procedure and then run the following code: ```ruby +# Load the gem +require 'form_api' + +# Setup authorization FormAPI.configure do |config| - config.username = "YOUR_API_TOKEN_ID" - config.password = "YOUR_API_TOKEN_SECRET" + # Configure HTTP basic authorization: api_token_basic + config.username = 'YOUR USERNAME' + config.password = 'YOUR PASSWORD' end -formapi = FormAPI::Client.new +api_instance = FormAPI::PDFApi.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 - } -) +template_id = "template_id_example" # String | -# { -# status: "success", -# submission: { -# id: "bymRSZYTKDnd6jfY", -# test: true, -# state: "processed", -# download_url: "https://..." -# } -# } -``` +opts = { + create_submission_batch_body: [FormAPI::CreateSubmissionBatchBody.new] # Array<CreateSubmissionBatchBody> | +} -This submits a PDF request and waits for the job to finish. +begin + #Generates multiple PDFs + result = api_instance.batch_generate_pdf(template_id, opts) + p result +rescue FormAPI::ApiError => e + puts "Exception when calling PDFApi->batch_generate_pdf: #{e}" +end +``` -## More Help +## Documentation for API Endpoints -See the [FormAPI documentation](https://formapi.io/docs) for more information. +All URIs are relative to *https://app.formapi.io/api/v1* -Please [email us](mailto:support@formapi.io) if you need any help. +Class | Method | HTTP request | Description +------------ | ------------- | ------------- | ------------- +*FormAPI::PDFApi* | [**batch_generate_pdf**](docs/PDFApi.md#batch_generate_pdf) | **POST** /templates/{template_id}/submissions/batch | Generates multiple PDFs +*FormAPI::PDFApi* | [**combine_submissions**](docs/PDFApi.md#combine_submissions) | **POST** /combined_submissions | Merge generated PDFs together +*FormAPI::PDFApi* | [**expire_combined_submission**](docs/PDFApi.md#expire_combined_submission) | **DELETE** /combined_submissions/{combined_submission_id} | Expire a combined submission +*FormAPI::PDFApi* | [**expire_submission**](docs/PDFApi.md#expire_submission) | **DELETE** /submissions/{submission_id} | Expire a PDF submission +*FormAPI::PDFApi* | [**generate_pdf**](docs/PDFApi.md#generate_pdf) | **POST** /templates/{template_id}/submissions | Generates a new PDF +*FormAPI::PDFApi* | [**get_combined_submission**](docs/PDFApi.md#get_combined_submission) | **GET** /combined_submissions/{combined_submission_id} | Check the status of a combined submission (merged PDFs) +*FormAPI::PDFApi* | [**get_submission**](docs/PDFApi.md#get_submission) | **GET** /submissions/{submission_id} | Check the status of a PDF +*FormAPI::PDFApi* | [**get_templates**](docs/PDFApi.md#get_templates) | **GET** /templates | Get a list of all templates +*FormAPI::PDFApi* | [**test_authentication**](docs/PDFApi.md#test_authentication) | **GET** /authentication | Test Authentication -## Development +## Documentation for Models -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`. + - [FormAPI::CreateCombinedSubmissionBody](docs/CreateCombinedSubmissionBody.md) + - [FormAPI::CreateSubmissionBatchBody](docs/CreateSubmissionBatchBody.md) + - [FormAPI::CreateSubmissionBody](docs/CreateSubmissionBody.md) + - [FormAPI::InlineResponse200](docs/InlineResponse200.md) + - [FormAPI::InlineResponse2001](docs/InlineResponse2001.md) + - [FormAPI::InlineResponse201](docs/InlineResponse201.md) + - [FormAPI::InlineResponse2011](docs/InlineResponse2011.md) + - [FormAPI::InlineResponse201CombinedSubmission](docs/InlineResponse201CombinedSubmission.md) + - [FormAPI::InlineResponse400](docs/InlineResponse400.md) + - [FormAPI::InlineResponse401](docs/InlineResponse401.md) + - [FormAPI::InlineResponse422](docs/InlineResponse422.md) + - [FormAPI::TemplatestemplateIdsubmissionsbatchSubmission](docs/TemplatestemplateIdsubmissionsbatchSubmission.md) -## Release Process +## Documentation for Authorization -1. Pull latest master -2. Merge feature branch(es) into master -3. `script/test` -4. Increment version in code: - - `swagger-config.json` - - `lib/formapi/version.rb` -5. Update [CHANGELOG.md](CHANGELOG.md) -6. Commit "Release version vX.Y.Z" -7. `rake release` -8. Verify package release at https://rubygems.org/gems/formapi -9. Refresh documentation on formapi.io +### api_token_basic -## Version Policy +- **Type**: HTTP basic authentication -This library follows [Semantic Versioning 2.0.0](http://semver.org).