You can use this request to return a URL that will automatically log a user in.

You can supply a user ID in the request, and then when someone clicks the URL which is returned, it will log that person in as the user specified in the original request. The system will also redirect the user to the part of the product specified in the redirect.

The Method

API Method
RESTGEThttp://[Your URL]/api/2.0/authentication_url/:user_id/:redirect
Your URL is the address of your Everlytic install.

Your method must be structured as follows:

GetAuthenticationUrl(intger $user_id, string redirect)


PropertyTypeDescriptionDefaultRequiredRead Only
$user_idintegerUser identifier.noneyesno
$redirectstringPath to redirect user to once logged in.nonenono


object"auth_key": {
"data": "Dxo3YVXcrF0AAjR9"
"auth_expires": {
"data": 1394538677
"full_url": {
"data": ""

Code Samples


The rest of this document describes the example above, step-by-step.

In our Getting Started section we covered the four important components of an API request; URL, method, headers, and body.


Let's analyse the code sample above to determine where each line fits into this outline.

1. Load the Everlytic API

The following line of code tells the server which API URL to access for the request:

$url = '(Your URL)/api/2.0/authentication_url/1/customers

2. Method

In this line of code, you tell the API which REST function to use:

$method = ‘GET’;

3. cURL

cURL is a tool for sending and receiving files from a web server. This line of code initialises the cURL session.

$cSession = curl_init();

4. Initiate the headers

This section of the code opens the headers section and passes the authentication (including your API key).

$headers = array();

$auth = base64_encode($username . ':' . $apikey);

$headers[] = 'Authorization: Basic ' . $auth;

5. Set various cURL options for the session

The first line uses the $url to get your specified url
The second line returns the string (text) of the return value.
The third line tells the server not to include the header in the ouput.
The fourth line calls the $method specified above, which is to ‘GET’ (read) the data from the server.

curl_setopt($cSession, CURLOPT_URL, $url);

curl_setopt($cSession, CURLOPT_RETURNTRANSFER, true);

curl_setopt($cSession, CURLOPT_HEADER, false);

curl_setopt($cSession, CURLOPT_CUSTOMREQUEST, strtoupper($method));

6. Headers

Call the headers using the $headers method.

curl_setopt($cSession, CURLOPT_HTTPHEADER, $headers);

7. Output the API response to test authentication

$result = curl_exec($cSession);

8. Close the cURL session

Translate »