Doccy::Api
Official Ruby wrapper for the https://www.doccyapp.com api
Installation
Add this line to your application's Gemfile:
gem 'doccy-api'
And then execute:
$ bundle
Or install it yourself as:
$ gem install doccy-api
Usage
Create a doccy_api.rb file in your config/initializers folder and add the following
Doccy::Config.mode = :production # OPTIONAL defaults to staging.
Doccy::Config.app_key = "YOUR-PARTNER-KEY" #OPTIONAL you only need this to create client accounts.
Sections
Accounts
Doccy Partners are able to create client accounts through their applications. To become a partner contact us at [email protected] for more information.
Create an account and a user:
Doccy::Accounts.create(company_name, user_name, email, password, = {})
Templates
Returns all Templates for that users account
Doccy::Templates.all(auth_token)
Returns a specific Template
Doccy::Templates.get(auth_token, template_id)
Uploads a Teamplate to Doccy
- Method:
post Request Params:
- template[name]: Name of template in Doccy * Required
- template[description]: Optional
- template[document_template]: Template file to upload * Required
Request Example: no request content
Doccy::Templates.upload(auth_token, template_params)
Documents
Creates a Document from Template
- Method:
post - Request Params:
- document[name]: Name of document * Required
- document[content][:placeholder]: Placeholde should be replaced by the values returned from template show action
Doccy::Documents.create(auth_token, template_id, document_params)
Returns a specific Document
Doccy::Documents.get(auth_token, template_id, document_id)
Downloads a Document
Doccy::Documents.download(auth_token, template_id, document_id, original=nil)
- if you past through original=true as a param if will return the document in the original format with the merges rather then in PDF.
Emails
Will send a document via Doccy
Doccy::Documents.create(auth_token, template_id, document_id, email_params)
Login
This will return the auth_token for that user.
Doccy::Session.create(email, password)
Contributing
- Fork it
- 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 new Pull Request