API Authentication

Learn how to perform API authentication on the Genius Referrals platform. We offer two authentication methods for accessing our API: WSSE and X-Auth-Token. Both methods provide secure ways to authenticate requests.

Prerequisites

  1. Platform Registration: Sign up on Genius Referrals and obtain your API credentials.
  2. Specialized Knowledge: Familiarity with using APIs and Curl commands.

Method 1: WSSE Authentication

To use WSSE authentication, you must include the X-WSSE header in your request. Here's an example using Curl:

Request:

# Testing Authentication
curl -v -H 'Accept: application/json' -H 'Content-type: application/json' -H 'X-WSSE: UsernameToken Username="test@geniusreferrals.com", PasswordDigest="oCKMP/2zpOOikGksjBcNS3kSd9c=", Nonce="09579a3b30e86b94d887c037b76476baf1bf2519", Created="2014-06-06T20:12:52+00:00"' -X GET https://api.geniusreferrals.com/test-authentication

Response:

GET /test-authentication HTTP/1.1
User-Agent: curl/7.22.0 (x86_64-pc-linux-gnu) libcurl/7.22.0 OpenSSL/1.0.1 zlib/1.2.3.4 libidn/1.23 librtmp/2.3
Host: api.geniusreferrals.com
Accept: application/json
Content-type: application/json
X-WSSE: UsernameToken Username="test@geniusreferrals.com", PasswordDigest="oCKMP/2zpOOikGksjBcNS3kSd9c=", Nonce="09579a3b30e86b94d887c037b76476baf1bf2519", Created="2014-06-06T20:12:52+00:00"
 
HTTP/1.1 200 OK
Date: Mon, 19 May 2014 18:45:58 GMT
Server: Apache/2.2.16 (Debian)
Cache-Control: no-cache
Access-Control-Allow-Origin: *
Allow: GET, OPTIONS
X-Debug-Token: 9a49db
Transfer-Encoding: chunked
Content-Type: application/json
 
* Connection #0 to host api.geniusreferrals.com left intact
* Closing connection #0
{
    "code":200,
    "message":"Hello test@geniusreferrals.com!, You've successfully authenticated on Genius Referrals platform."
}
Method 2: X-Auth-Token Authentication
Alternatively, you can use the X-Auth-Token header for authentication. Here's an example using Curl:

Request:

# X-Auth-Token Authentication
curl -X GET -H 'Accept: application/json' -H 'Content-type: application/json' -H 'X-Auth-Token: 828475d245e6ac4e18bb998ccd3d089956669ca0' https://api.geniusreferrals.com/test-authentication

Response:

GET /test-authentication HTTP/1.1
User-Agent: curl/7.22.0 (x86_64-pc-linux-gnu) libcurl/7.22.0 OpenSSL/1.0.1 zlib/1.2.3.4 libidn/1.23 librtmp/2.3
Host: api.geniusreferrals.com
Accept: application/json
Content-type: application/json
X-Auth-Token: 828475d245e6ac4e18bb998ccd3d089956669ca0
 
HTTP/1.1 200 OK
Date: Mon, 19 May 2014 18:45:58 GMT
Server: Apache/2.2.16 (Debian)
Cache-Control: no-cache
Access-Control-Allow-Origin: *
Allow: GET, OPTIONS
X-Debug-Token: 9a49db
Transfer-Encoding: chunked
Content-Type: application/json
 
{
    "code":200,
    "message":"Hello user!, You've successfully authenticated using X-Auth-Token on the Genius Referrals platform."
}
Was this page helpful?
LANGUAGE