Language

An application developer is not authorized to approve data debits, however that, like other operations on the HAT, is managed using an API call: GET /api/v2/data-debit/DATA_DEBIT_ID/enable/BUNDLE_NAME. Specifically, it requires both the Data Debit ID and the Bundle name to be set to accurately identify the data that is being shared.

curl --request GET \
  --url https://test.hubat.net/api/v2/data-debit/userprofile/enable/userprofile \
  --header 'x-auth-token: ACCESS_TOKEN'
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://test.hubat.net/api/v2/data-debit/userprofile/enable/userprofile");
xhr.setRequestHeader("x-auth-token", "ACCESS_TOKEN");

xhr.send(data);
<?php

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => "https://test.hubat.net/api/v2/data-debit/userprofile/enable/userprofile",
  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(
    "x-auth-token: ACCESS_TOKEN"
  ),
));

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

curl_close($curl);

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

url = "https://test.hubat.net/api/v2/data-debit/userprofile/enable/userprofile"

headers = {'x-auth-token': 'ACCESS_TOKEN'}

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

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

url = URI("https://test.hubat.net/api/v2/data-debit/userprofile/enable/userprofile")

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["x-auth-token"] = 'ACCESS_TOKEN'

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