Get the list of available genders
GET
https://integrate.d6plus.co.za/api/v1/adminplus/lookup/genders
Use this endpoint to retrieve the list of available genders within the d6+ SAMS. The list is generic across all d6+ SAMS clients. All available genders are returned.
Copy [
{
"id": "M",
"name": "Male"
},
{
"id": "F",
"name": "Female"
}
]
Copy {
"error": "Unauthorized",
"error_description": "Request not authorised"
}
Examples
Copy <?php
const BASE_URL = 'https://integrate.d6plus.co.za/api/v1/adminplus/lookup/genders';
const API_USERNAME = getenv('API_USERNAME'); // Assuming you have these environment variables set
const API_PASSWORD = getenv('API_PASSWORD');
$curl = curl_init();
$options = [
CURLOPT_URL => BASE_URL,
CURLOPT_RETURNTRANSFER => true,
CURLOPT_SSL_VERIFYPEER => true,
CURLOPT_CUSTOMREQUEST => 'GET',
CURLOPT_HTTPHEADER => [
"HTTP-X-USERNAME: " . API_USERNAME,
"HTTP-X-PASSWORD: " . API_PASSWORD
],
];
curl_setopt_array($curl, $options);
$response = curl_exec($curl);
if (curl_errno($curl)) {
throw new Exception('Curl error: ' . curl_error($curl));
}
curl_close($curl);
echo $response;
Copy curl --location 'https://integrate.d6plus.co.za/api/v1/adminplus/lookup/genders' \
--header 'HTTP-X-USERNAME: your_username' \
--header 'HTTP-X-PASSWORD: your_password'