Trulioo

Trulioo Developer Portal

Welcome to the Trulioo's developer hub. You'll find comprehensive guides and documentation to help you start working with Trulioo as quickly as possible, as well as support if you get stuck. Let's jump right in!

Get Started

Keys and Authentication

Account setup

To access the Trulioo API you will need the following:

  1. A GlobalGateway account: The account consists of configurations and test entities. If you need to set up a GlobalGateway account, contact us.
  2. A NAPI user: You need a username and password for authenticating API calls. If you have a GlobalGateway account set up, email support@trulioo.com with the following information:
    • First Name
    • Last Name
    • Account Name

Authentication

The Trulioo API uses Basic Authentication. Once you have the username and password for your API account, you will be able to construct the request Authorization header as follows:

  • Username and password are combined into a string "username:password"
  • The resulting string is encoded using the RFC2045-MIME variant of Base64, except without the 76 char per line limitation. This encoded string will be referred to simply as ACCESS_TOKEN in examples.
  • The authorization method and a space, in this case "Basic ", is then put before the encoded string, so the resulting header is "Authorization: Basic ACCESS_TOKEN"

See the Test Authentication API reference for more examples.

If you are using an API testing application such as Postman or SOAPUI, you should be able to add a basic authentication header without encoding the username/password yourself, as described in the application's help docs. Most programming languages include HTTP client libraries that handle the fine details of basic authentication, and our SDKs for C# and Java make the process as streamlined as possible.

Authorization Headers

Our generated code examples in the API Reference don't currently include how to set Authorization headers so for now we'll document them here:

cURL

Add "--user" to your cURL command . cURL will add it to the Authorization header and encode it as a Base64 string:

--user username:password

Node

For the options object you need to add a header object along with the url:

var options = { 
	method: 'GET',
  url: 'https://api.globaldatacompany.com/connection/v1/testauthentication',
  headers: {
	  "Authorization": "Basic " + new Buffer("username:password").toString("base64")
	}
};

JavaScript

XMLHttpRequest provides a method to set the request header. It has to be called between the open and send methods are called:

xhr.open("GET", "https://api.globaldatacompany.com/connection/v1/testauthentication");
xhr.setRequestHeader("Authorization", "Basic " + btoa("username:password")); 
xhr.send(data);

Ruby

For Ruby, once we've initialized the request we can set the Authorization by using the .basic_auth method. It takes the username and password and encodes them as Base64 strings in the Authorization header.

request = Net::HTTP::Get.new(url)
request.basic_auth("username", "password")
response = http.request(request)

Python

For the request set up, after the url is passed in you need to add one more parameter auth as follows:

response = requests.request("GET", url, auth=('username', 'password'))