Ruby gem to support digital signatures utilizing the services provided by Visma. The users of Visma Sign can sign documents with strong identification (local BankID/NemID codes) in Finland, Norway, Sweden and Denmark. The API is available globally, but signers need Finnish, Swedish, Danish or Norwegian banking or mobile authentication credentials.
Add this line to your application's Gemfile:
gem 'vismasign', github: "anthonymakela/vismasign"
And then execute:
$ bundle install
Or install it yourself as:
$ gem install vismasign
To access the API you'll need the identifier and an api key from Visma. After recieving your credentials you can access the resources with
client = Vismasign::Client.new(identifier: ENV["IDENTIFIER"], api_key: ENV["API_KEY"])
To create a new document you can call the create
method as follows
client.document.create(document: { "name": "Test document" })
You can find the params for the create method from the docs.
Following the signin process you can add a file to the created document with
client.document.add_file(document_id: xxx, file_url: xxx)
note that the gem currently only supports files to be uploaded from a given url.
Visma has an endpoint to fetch the status for a single document however, this will return more than just the status so we will refer to this as retrieving a document. You can do this by calling
client.document.retrieve(document_id: xxx)
To get the status of a document you can call the status
method which will return a string
client.document.status(document_id: xxx) # e.g "pending"
To send the signatures after you've created the document and added the file to be signed you can use the create
method for the invitation resource as follows
client.invitation.create([ { "email": "[email protected]"}, { "email": "[email protected]"} ], document_id: xxx)
note that the first argument to the create
method expects an array of hashes. You can find more information about the arguments for the invitations from the docs.
After checking out the repo, run bin/setup
to install dependencies. Then, run rake spec
to run the tests. You can also run bin/console
for an interactive prompt that will allow you to experiment.
To install this gem onto your local machine, run bundle exec rake install
. To release a new version, update the version number in version.rb
, and then run bundle exec rake release
, which will create a git tag for the version, push git commits and the created tag, and push the .gem
file to rubygems.org.
Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/vismasign. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the code of conduct.
The gem is available as open source under the terms of the MIT License.
Everyone interacting in the Vismasign project's codebases, issue trackers, chat rooms and mailing lists is expected to follow the code of conduct.