Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

assently

Package Overview
Dependencies
Maintainers
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

assently

  • 1.0.0
  • Rubygems
  • Socket score

Version published
Maintainers
2
Created
Source

Build Status Code Climate Test Coverage Gem Version

Assently API Client

Ruby client for the Assently API v2. Check out the official API documentation here.

Supported API calls

API callSupported
createcase✔️
sendcase✔️
getcase✔️
createcasefromtemplate
updatecase
remindcase
deletecase
recallcase
findcases
findtemplates
getdocumentdata
createagent
createssoticket

Missing something? Contributions are very welcome! 😘

Installation

Include the gem in your Gemfile:

gem "assently"

Usage

Environment

When creating a client instance you can choose to use either Assently's production (default when not specified) or test environment. The host app.assently.com is used for production and test.assently.com is used for test when constructing the API commands. Test environment is specified like this:

Assently.client ENV["ASSENTLY_API_KEY"], ENV["ASSENTLY_API_SECRET"], :test

Creating a case

assently = Assently.client assently_api_key, assently_api_secret

case_id = SecureRandom.uuid

signature_case = Assently::Case.new "Agreement", ["electronicid"], id: case_id
signature_case.add_party Assently::Party.new_with_attributes({
  name: "First Last",
  email: "name@example.com",
  social_security_number: "1234567890"
})
signature_case.add_document Assently::Document.new "/some/path/file.pdf"

event_subscription = Assently::CaseEventSubscription.new ["finished", "expired"], "https://example.com/my-endpoint"

result = assently.create_case(signature_case, {
  # Callback for document events
  event_callback: event_subscription,
  # User ends up here after finishing the signing process
  continue: {
    url: "http://example.com/user-endpoint",
    auto: true
  },
  # User ends up here when cancelling, at the moment there is no cancel callback
  cancel_url: "http://example.com/user-canceled"
})

if result.success?
  puts "#{signature_case.id} was created."
else 
  puts "There was some issues with the case"
  result.errors.each do |error|
    puts error
  end
end

Making a case available for signing

assently = Assently.client API_KEY, API_SECRET
result = assently.get_case case_id

if result.success?
  assently.send_case case_id
  
  signing_case = assently.get_case case_id
  
  puts "Sign it here: #{signing_case.response["Parties"].first["PartyUrl"]}"
else
  puts "Could not get signature url"
  result.errors.each do |error|
    puts error
  end
end

Local development

Create a .env file in the root directory to run the integration tests against your Assently test environment.

ASSENTLY_API_KEY=your-api-key
ASSENTLY_API_KEY=your-api-secret

Contributing

Contributions is more than welcome!

Just create a fork and submit a pull request.

Please adhere to the coding standards used in the project and add tests.

FAQs

Package last updated on 20 Feb 2017

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc