TM
Blog

Using the Quovo API with Ruby

Hoss@Hossapp /

Using Quovo API with Ruby

Today, we’re going to show you how to get started with the Quovo API in Ruby. We’ll cover library installation, obtaining an access token, and making some basic requests.

Installing and Importing Libraries

Before we can start using the API, we need to install a few libraries. This can be done via the gem package manager - so run ‘gem install net/http’, ‘gem install uri’, and ‘gem install json’, and ‘gem install hoss’ in your terminal. If you want to sign up for Hoss - which provides you with deep visibility into API performance, alerts you of errors before your customers notice, and reduces the amount of time spent debugging integrations - you can do so here. To install Hoss, you should run 'gem install hoss’. We are going to be using Hoss to make sure that calls are being made correctly, and to better analyze the information we send in as well as the response coming back from the API.

Include the following libraries in your gemfile.

source 'https://rubygems.org'
gem 'net/http'
gem 'json'
gem 'uri'
gem 'hoss-agent'

Integrate the Hoss SDK

First, find your Hoss keys here. For this tutorial, we’ll be using the development key.

Hoss.start('<HOSS API KEY>')

Getting Started With Quovo

Now, go over to your Quovo account and obtain your API credentials. If you haven’t done so already, create a Quovo developer account here.

In order to make an API request, we need to obtain an access token. To obtain a token, we will need to use the /v3/tokens endpoint.

uri = URI.parse("https://api.quovo.com/v3/tokens") 
request = Net::HTTP::Post.new(uri) 
request.basic_auth("my_api_username", "my_api_password") 
request.content_type = "application/json" 
request.body = JSON.dump({ "name" => "main_token" }) 
req_options = { use_ssl: uri.scheme == "https", } 
response = Net::HTTP.start(uri.hostname, uri.port, req_options) do |http| http.request(request) end # response.code # response.body

The response is returned as follows. We just need a “token” parameter.

{
    "access_token": {
        "created": "2018-01-31T17:45:09Z",
        "expires": "2018-01-31T18:45:09Z",
        "name": "main_token",
        "token": "a724809d37d0a21b7e9257f45cee416f5aec61993ab4b09e"
    }
}

Getting Account Information

We’ll show you how to obtain information on an individual financial account. To display information regarding a single account, use the /accounts endpoint

require 'net/http' require 'uri' 

uri = URI.parse("https://api.quovo.com/v3/accounts/750007") 
request = Net::HTTP::Get.new(uri) 

request["Authorization"] = "Bearer a724809d37d0a21b7e9257f45cee416f5aec61993ab4b09e" 

req_options = { use_ssl: uri.scheme == "https" } 

response = Net::HTTP.start(uri.hostname, uri.port, req_options) do |http| http.request(request) end # response.code # response.body

The response is returned as follows:

{
    "accounts": [
        {
            "category": "Investment",
            "connection_id": 877247,
            "id": 746745,
            "institution_id": 21534,
            "institution_name": "Test Institution",
            "is_disabled": false,
            "is_taxable": true,
            ....
        }
}

View your Request History in Hoss

We can select an API to view metrics on by clicking the API name on the left-hand side of the panel. To view the requests log, you can just click on “Requests” and you’ll be able to view recent requests. You can view information about a particular request by clicking on the actual request.

Masking Fields

Using the Quovo API, you may receive PII in the request bodies. In order to ensure compliance with data privacy regulations, you may want to mask fields. You can read more about this here.

Set Up Alarms

You can set up alarms to monitor API status, failed calls, and latency, while also integrating the alerts with Slack and Pagerduty.

Next Steps

That’s it! Check out the full Quovo API documentation here and get started!

Subscribe to Hoss ModeA weekly newsletter with curated articles, community discussions, news and trends.

Getting Started with the Stripe API for Python

Hoss
Read more
In this guide, we will show you how to get up and running with the Stripe API using Python.

Using the Quovo API with Node.js

Hoss
Read more
In this tutorial, we’ll talk about how to get started with the Quovo API. We’ll cover installing important libraries and authentication, before diving into some sample requests.
TM

Copyright © Hoss Technologies, Inc. 2020 - All rights reserved. Terms of Service & Privacy Policy