Authentication

Get the browser SSL confirmation page

GET /confirm

Return a ide html pages for confirming the browser SSL

This endpoint does not require authentication.

curl
curl -X GET "https://appliance.example.com/api/v1/confirm"
PHP
<?php

$url = 'https://appliance.example.com/api/v1/confirm';
$headers = [
];

$ch = curl_init($url);
curl_setopt_array($ch, [
    CURLOPT_CUSTOMREQUEST => 'GET',
    CURLOPT_HTTPHEADER => $headers,
    CURLOPT_RETURNTRANSFER => true,
]);

$response = json_decode(curl_exec($ch), true);
curl_close($ch);
Python
import requests


response = requests.get("https://appliance.example.com/api/v1/confirm")
response.raise_for_status()
print(response.json())
JavaScript
const response = await fetch('https://appliance.example.com/api/v1/confirm', {
  method: 'GET',
});

const data = await response.json();
Response
"<!DOCTYPE html><html lang=\"en\"><head>…</head><body>…</body></html>"

Get the login options for an identity

POST /login/options

Pre-auth login options for an identity (password vs SSO)

This endpoint does not require authentication.

This change is staged. Send PUT /services/apply to apply it.

Body parameters
email string Required
curl
curl -X POST "https://appliance.example.com/api/v1/login/options" \
  -H "Content-Type: application/json" \
  -d '{
  "email": "<email>"
}'
PHP
<?php

$url = 'https://appliance.example.com/api/v1/login/options';
$headers = [
    'Content-Type: application/json',
];

$payload = [
    'email' => '<email>',
];

$ch = curl_init($url);
curl_setopt_array($ch, [
    CURLOPT_CUSTOMREQUEST => 'POST',
    CURLOPT_HTTPHEADER => $headers,
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_POSTFIELDS => json_encode($payload),
]);

$response = json_decode(curl_exec($ch), true);
curl_close($ch);
Python
import requests

payload = {
    "email": "<email>"
}

response = requests.post("https://appliance.example.com/api/v1/login/options", json=payload)
response.raise_for_status()
print(response.json())
JavaScript
const response = await fetch('https://appliance.example.com/api/v1/login/options', {
  method: 'POST',
  headers: {
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({
  "email": "<email>"
}),
});

const data = await response.json();
Response
{
  "status": "success",
  "message": "Login options",
  "data": {
    "loginType": "password",
    "ssoEnforced": false,
    "samlConfigured": false,
    "samlEnforced": false,
    "2faRequired": false
  }
}

Check that the API is answering

GET /ping

Ping API Ping/Pong

This endpoint does not require authentication.

curl
curl -X GET "https://appliance.example.com/api/v1/ping"
PHP
<?php

$url = 'https://appliance.example.com/api/v1/ping';
$headers = [
];

$ch = curl_init($url);
curl_setopt_array($ch, [
    CURLOPT_CUSTOMREQUEST => 'GET',
    CURLOPT_HTTPHEADER => $headers,
    CURLOPT_RETURNTRANSFER => true,
]);

$response = json_decode(curl_exec($ch), true);
curl_close($ch);
Python
import requests


response = requests.get("https://appliance.example.com/api/v1/ping")
response.raise_for_status()
print(response.json())
JavaScript
const response = await fetch('https://appliance.example.com/api/v1/ping', {
  method: 'GET',
});

const data = await response.json();
Response
{
  "status": "success",
  "message": "pong",
  "data": []
}

Token

GET /token

Refresh the JWT token before if expires

curl
curl -X GET "https://appliance.example.com/api/v1/token" \
  -H "Authorization: Bearer $TOKEN"
PHP
<?php

$url = 'https://appliance.example.com/api/v1/token';
$headers = [
    'Authorization: Bearer ' . $token,
];

$ch = curl_init($url);
curl_setopt_array($ch, [
    CURLOPT_CUSTOMREQUEST => 'GET',
    CURLOPT_HTTPHEADER => $headers,
    CURLOPT_RETURNTRANSFER => true,
]);

$response = json_decode(curl_exec($ch), true);
curl_close($ch);
Python
import requests

headers = {"Authorization": f"Bearer {token}"}

response = requests.get("https://appliance.example.com/api/v1/token", headers=headers)
response.raise_for_status()
print(response.json())
JavaScript
const response = await fetch('https://appliance.example.com/api/v1/token', {
  method: 'GET',
  headers: {
    Authorization: `Bearer ${token}`,
  },
});

const data = await response.json();
Response
{
  "status": "success",
  "message": "Token refreshed",
  "data": {
    "token": "****jwt token ****"
  }
}

POST /token

Login and get the JWT token

This endpoint does not require authentication.

This change is staged. Send PUT /services/apply to apply it.

Body parameters
email string Required
password string Required
curl
curl -X POST "https://appliance.example.com/api/v1/token" \
  -H "Content-Type: application/json" \
  -d '{
  "email": "<email>",
  "password": "<password>"
}'
PHP
<?php

$url = 'https://appliance.example.com/api/v1/token';
$headers = [
    'Content-Type: application/json',
];

$payload = [
    'email' => '<email>',
    'password' => '<password>',
];

$ch = curl_init($url);
curl_setopt_array($ch, [
    CURLOPT_CUSTOMREQUEST => 'POST',
    CURLOPT_HTTPHEADER => $headers,
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_POSTFIELDS => json_encode($payload),
]);

$response = json_decode(curl_exec($ch), true);
curl_close($ch);
Python
import requests

payload = {
    "email": "<email>",
    "password": "<password>"
}

response = requests.post("https://appliance.example.com/api/v1/token", json=payload)
response.raise_for_status()
print(response.json())
JavaScript
const response = await fetch('https://appliance.example.com/api/v1/token', {
  method: 'POST',
  headers: {
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({
  "email": "<email>",
  "password": "<password>"
}),
});

const data = await response.json();
Response
{
  "status": "success",
  "message": "Successfully login",
  "data": {
    "user": {
      "id": "5d1-9be-6bb-c5a",
      "email": "loadbalancer@loadbalancer.org",
      "name": "Loadbalancer",
      "extra": []
    },
    "token": "****jwt token ****",
    "appliance_id": "5d9-be6-bbc-5af",
    "applianceVersion": "9.0.1",
    "licence": {
      "updateType": "full",
      "platform": "vmware",
      "serial": "5c6d53365a1e2",
      "model": "max",
      "supportExpired": false,
      "daysToExpire": 30,
      "companyName": "Acme Inc",
      "maxVips": 0,
      "maxRips": 0,
      "supportExpireDate": "31/07/2019",
      "modules": [],
      "licenceType": "trial"
    }
  }
}