We currently support a single authentication scheme, which we call the “simple” approach.

Simple Authentication

This is the solely supported authentication scheme at this time. You need to supply an appId and appKey as part of the request either via headers or the query string (more info below). The appId is the unique ID of your application and is immutable. The appKey is something you can and should refresh periodically. Both are available on the My Organizations page of Dash by Genability.

To authenticate, pass in your appId and appKey in the request header. This is the standard HTTP Basic authentication scheme with your appId as the username and appKey as the password. You simply format the two together as the string appId:appKey and base64-encode it. Then add it as the Authorization HTTP Header. The resulting header will look like this:

Authorization: Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==

Most languages and REST client libraries have helper utilities to make adding this a snap.

Here are some examples of authenticating to the Genability API in various languages and frameworks. For these examples, we’ll assume that our app id is APP_ID and our app key is APP_KEY. We’ll make a simple request to the Echo Hello endpoint.


> curl -u APP_ID:APP_KEY https://api.genability.com/rest/echo/hello
{"status":"success","count":1,"type":null,"results":["Hello World","Hello World!"]}


If you are developing in Java, We recommend using our Java client library. It handles all of the authenticating and request building for you. If you can’t use our library, we have an example of how to authenticate below.

This example uses the Apache HttpClient library. It is adapted from one of their samples.

import org.apache.http.auth.AuthScope;
import org.apache.http.auth.UsernamePasswordCredentials;
import org.apache.http.client.CredentialsProvider;
import org.apache.http.client.methods.CloseableHttpResponse;
import org.apache.http.client.methods.HttpGet;
import org.apache.http.impl.client.BasicCredentialsProvider;
import org.apache.http.impl.client.CloseableHttpClient;
import org.apache.http.impl.client.HttpClients;
import org.apache.http.util.EntityUtils;

public class GenabilityAuthentication {

    public static void main(String[] args) throws Exception {
        CredentialsProvider credsProvider = new BasicCredentialsProvider();
                new AuthScope("api.genability.com", 443),
                new UsernamePasswordCredentials("APP_ID", "APP_KEY"));
        CloseableHttpClient httpclient = HttpClients.custom()
        try {
            HttpGet httpget = new HttpGet("https://api.genability.com/rest/echo/hello");

            System.out.println("Executing request " + httpget.getRequestLine());
            CloseableHttpResponse response = httpclient.execute(httpget);
            try {
            } finally {
        } finally {

JavaScript (Browser using Fetch)

The Genability API implements the CORS standard, which allows you to make cross-origin JavaScript requests in the browser. This example uses Fetch (good intro to Fetch here).

var appId = 'APP_ID';
var appKey = 'APP_KEY';

var url = 'https://api.genability.com/rest/echo';

fetch(url, {
    method: 'get',
    headers: {
      "Authorization": "Basic: " + btoa(appId + ":" + appKey)
  .then(function(response) {
    if (response.status !== 200) {
      console.log('Request Status not 200');
    response.json().then(function(data) {
      console.log('Request succeeded with JSON response');
  .catch(function(error) {
    console.log('Request errored');

JavaScript (Browser using jquery + AJAX)

As mentioned, the Genability API implements the CORS standard, which allows you to make cross-origin JavaScript requests in the browser. This example uses jQuery.

    <script src="https://code.jquery.com/jquery-1.11.3.min.js"></script>
  <p id="text">Some Text</p>
  <button id="btn">Click</button>

   var appId = "APP_ID"
   var appKey = "APP_KEY"
   $("#btn").click(function(e) {
       $.ajax("https://api.genability.com/rest/echo/hello", {
           headers: {
               "Authorization": "Basic: " + btoa(appId + ":" + appKey)
           success: function(data, status, xhr) {

JavaScript (Node.js)

If you are running Javascript on a Node.js server, you can authenticate like this example.

var https = require("https");

var appId = "APP_ID";
var appKey = "APP_KEY";
var credentials = new Buffer(appId + ":" + appKey).toString("base64");
var auth = "Basic " + credentials

var options = {
    hostname: "api.genability.com",
    path: "/rest/echo/hello",
    headers: {
        "Authorization": auth

function after(res) {
    var body = "";

    res.on("data", function(d) {
        body += d;

    res.on("end", function() {

https.get(options, after);

Running the above in a file called example.js would give you the following.

> node example.js
{"status":"success","count":1,"type":null,"results":["Hello World","Hello World!"]}


This example uses the Python requests package.

>>> import requests
>>> response = requests.get("https://api.genability.com/rest/echo/hello", auth=("APP_ID", "APP_KEY"))
>>> print(response.text)
{"status":"success","count":1,"type":null,"results":["Hello World","Hello World!"]}


This example uses the Ruby httpclient gem.

require 'httpclient'

appId = "APP_ID"
appKey = "APP_KEY"
domain = "https://api.genability.com"

http = HTTPClient.new
http.set_auth(domain, appId, appKey)
response = http.get_content("https://api.genability.com/rest/echo/hello")

puts response
> ruby example.rb
{"status":"success","count":1,"type":null,"results":["Hello World","Hello World!"]}


There are a few different ways to accomplish this in PHP. This first example uses a request context to set the username and password for a file_get_contents call.

    $appId = 'APP_ID';
    $appKey = 'APP_KEY';
	$auth = base64_encode($appId . ':' . $appKey);

    $options = array(
		'http' => array(
			'method' => "GET",
			'header' => 'Authorization: Basic ' . $auth
	$context = stream_context_create($options);
    print(file_get_contents("https://api.genability.com/rest/echo/hello", false, $context));
> php example.php
{"status":"success","count":1,"type":null,"results":["Hello World","Hello World!"]}

This example uses cURL.

$url = "https://api.genability.com/rest/echo/hello";

$appId = "APP_ID";
$appKey = "APP_KEY";

$ch = curl_init($url);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "GET");
curl_setopt($ch, CURLOPT_USERPWD, $appId . ":" . $appKey);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); 
$resp = curl_exec($ch); 

> php example-curl.php
{"status":"success","count":1,"type":null,"results":["Hello World","Hello World!"]}