Language

Authentication

Authentication happens the usual HAT way: with username and password sent inside headers, which responds with an Access Token used for further API calls

HTTP Request

GET Authenticate https://testing.hubat.net/users/access_token

Authenticate with the HAT to get Access Token used in future requests

Headers

Accept

application/json

username

testing

password

labai-geras-slaptazodis

curl --request GET \
  --url https:///users/access_token \
  --header 'accept: application/json' \
  --header 'password: ' \
  --header 'username: '
var data = null;

var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("GET", "https:///users/access_token");
xhr.setRequestHeader("accept", "application/json");
xhr.setRequestHeader("username", "");
xhr.setRequestHeader("password", "");

xhr.send(data);
<?php

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => "https:///users/access_token",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => "",
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 30,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => "GET",
  CURLOPT_HTTPHEADER => array(
    "accept: application/json",
    "password: ",
    "username: "
  ),
));

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
  echo "cURL Error #:" . $err;
} else {
  echo $response;
}
import requests

url = "https:///users/access_token"

headers = {
    'accept': "application/json",
    'username': "",
    'password': ""
    }

response = requests.request("GET", url, headers=headers)

print(response.text)
require 'uri'
require 'net/http'

url = URI("https:///users/access_token")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
http.verify_mode = OpenSSL::SSL::VERIFY_NONE

request = Net::HTTP::Get.new(url)
request["accept"] = 'application/json'
request["username"] = ''
request["password"] = ''

response = http.request(request)
puts response.read_body