Security News
Node.js EOL Versions CVE Dubbed the "Worst CVE of the Year" by Security Experts
Critics call the Node.js EOL CVE a misuse of the system, sparking debate over CVE standards and the growing noise in vulnerability databases.
This library is all set to go with version 1 of the Elvanto API.
Add this line to your application's Gemfile:
gem 'elvanto-api'
And then execute:
$ bundle
Or install it yourself as:
$ gem install elvanto-api
Finally, include the library:
require 'elvanto'
The Elvanto API supports authentication using either OAuth 2 or an API key.
This library provides functionality to help you obtain an Access Token and Refresh token. The first thing your application should do is redirect your user to the Elvanto authorization URL where they will have the opportunity to approve your application to access their Elvanto account. You can get this authorization URL by using the authorize_url
method, like so:
authorize_url = ElvantoAPI.authorize_url(client_id, redirect_uri, scope, state)
// Redirect your users to authorize_url.
If your user approves your application, they will then be redirected to the redirect_uri
you specified, which will include a code
parameter, and optionally a state
parameter in the query string. Your application should implement a handler which can exchange the code passed to it for an access token, using exchange_token
like so:
response = ElvantoAPI.exchange_token(client_id, client_secret, code, redirect_uri)
access_token = response[:access_token]
expires_in = response[:expires_in]
refresh_token = response[:refresh_token]
// Save access_token, expires_in and refresh_token.
At this point you have an access token and refresh token for your user which you should store somewhere convenient so that your application can look up these values when your user wants to make future Elvanto API calls.
Once you have an access token and refresh token for your user, you can authenticate and make further API calls like so:
ElvantoAPI.configure({:access_token=>access_token})
all_people = ElvantoAPI.call("people/getAll")
All OAuth tokens have an expiry time, and can be renewed with a corresponding refresh token. If your access token expires when attempting to make an API call, you will receive an error response, so your code should handle this. Here's an example of how you could do this:
result = ElvantoAPI.refresh_token(refresh_token)
ElvantoAPI.configure({:api_key=>api_key})
people = ElvantoAPI.call("people/getAll")
Documentation can be found on the Elvanto API website.
Follow our Twitter to keep up-to-date with changes in the API.
For bugs with the API Ruby Wrapper please use the Issue Tracker.
For suggestions on the API itself, please post in the forum or contact us via our website.
FAQs
Unknown package
We found that elvanto-api demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
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.
Security News
Critics call the Node.js EOL CVE a misuse of the system, sparking debate over CVE standards and the growing noise in vulnerability databases.
Security News
cURL and Go security teams are publicly rejecting CVSS as flawed for assessing vulnerabilities and are calling for more accurate, context-aware approaches.
Security News
Bun 1.2 enhances its JavaScript runtime with 90% Node.js compatibility, built-in S3 and Postgres support, HTML Imports, and faster, cloud-first performance.