API Authentication Methods

All API calls require valid Gemini user credentials.

Username/API KEY

Authenticate by providing username and the user's API key (found under User Profile).

You need to Base64 encode username and the API KEY as one string.

This information should be placed in Authorization header of the request.

username:api

Example when username is "manager" and API KEY is "xvitjc5bmm".

Basic bWFuYWdlcjp4dml0amM1Ym1t

JavaScript Example

var geminiUrl = "http://localhost/gemini/api/type/55";
var geminiUsername = Base64.encode("manager:xvitjc5bmm"); // user:apikey

$.ajax({
    url: geminiUrl,
    type: "GET",
    headers: { "Authorization": "Basic " + geminiUsername },
    success: function (data) {
      alert('Success!');
    }
});

Username/Password

Authenticate by providing username and the user's password.

You need to MD5 encode the password and then pre-pend the username with a colon. The resultant string is then Base64 encoded.

This information should be placed in Authorization header of the request.

JavaScript Example

var geminiUrl = "http://localhost/gemini/api/type/55";
var geminiUsername = Base64("user:"+ Base64(md5("password"))); // user:password

$.ajax({
    url: geminiUrl,
    type: "GET",
    headers: { "Authorization": "Basic " + geminiUsername },
    success: function (data) {
      alert('Success!');
    }
});