Get Note Type(s)
Last updated
{
"success": false,
"message": "The note type does not exist"
}<?php
// API Credentials
$api_username = 'your_username';
$api_password = 'your_password';
$school_id = 'the_school_id';
// Base API endpoint
define('BASE_URL', 'https://integrate.d6plus.co.za/api/v2/finplus/debtmanagement/debtornotes/notetypes');
// Optional: Set an ID to fetch a specific note type (or leave empty for all)
$id = '';
$url = BASE_URL;
if (!empty($id)) {
$url .= '/' . $id;
}
// Initialize cURL
$curl = curl_init();
// Set cURL options
curl_setopt_array($curl, [
CURLOPT_URL => $url,
CURLOPT_RETURNTRANSFER => true,
CURLOPT_TIMEOUT => 30, // Set timeout to prevent hanging requests
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => 'GET',
CURLOPT_HTTPHEADER => [
"HTTP-X-USERNAME: $api_username",
"HTTP-X-PASSWORD: $api_password",
"HTTP-X-SCHOOLID: $school_id"
],
]);
// Execute request
$response = curl_exec($curl);
// Check for errors
$error = curl_error($curl);
if ($error) {
curl_close($curl);
throw new Exception("cURL Error: $error");
}
// Close cURL and output response
curl_close($curl);
echo $response;
curl --request GET 'https://integrate.d6plus.co.za/api/v2/finplus/debtmanagement/debtornotes/notetypes' \
--header 'HTTP-X-USERNAME: your_username' \
--header 'HTTP-X-PASSWORD: your_password' \
--header 'HTTP-X-SCHOOLID: the_school_id'