Get Staff Member(s)

Get one or more staff member records

GET https://integrate.d6plus.co.za/api/v1/adminplus/staffmembers/{school_login_id}

Use this endpoint to fetch one or more staff member records for the specified school. By default all current active staff members will be returned.

It is possible to retrieve a single staff member by providing the optional staff_member_id query parameter.

Path Parameters

Query Parameters

Headers

[
    {
        "id": "1",
        "title": "Mr",
        "first_name": "John",
        "last_name": "Smith",
        "mobile_calling_code": "27",
        "mobile_number": "0823456789",
        "email_address": "jjsmith@example.com",
        "date_of_birth": "1967-02-14",
        "gender": "M",
        "ethnic_group": "White",
        "residential_address": "Plot 101\r\nDaffodil Street\r\nPretoria",
        "postal_address": "PO Box 12\r\nMenlyn\r\nPretoria",
        "home_language": "English",
        "nationality": "South Africa",
        "id_number": "6702145076084",
        "passport_number": "A0176543",
        "marital_status_id": "Married",
        "employment_category": "Finance",
        "appointment_type": "Temporary",
        "paid_by": "Department of Education",
        "sace_number": "123456",
        "register_classes": "2A"
    },
    {
        "id": "2",
        "title": "Mrs",
        "first_name": "Jane",
        "last_name": "Smith",
        "mobile_calling_code": "27",
        "mobile_number": "0798765432",
        "email_address": "smith.jj@example.org",
        "date_of_birth": "1955-06-17",
        "gender": "F",
        "ethnic_group": "African/Black",
        "residential_address": "Plot 101\r\nDaffodil Street\r\nPretoria",
        "postal_address": "PO Box 12\r\nMenlyn\r\nPretoria",
        "home_language": "English",
        "nationality": "South Africa",
        "id_number": "5506170079082",
        "passport_number": "",
        "marital_status_id": "Married",
        "employment_category": "Head Of Department",
        "appointment_type": "Permanent",
        "paid_by": "Governing Body",
        "sace_number": "234567",
        "register_classes": "1A,2B,5A"
    }
]

Examples

<?php

const BASE_URL = 'https://integrate.d6plus.co.za/api/v1/adminplus/staffmembers';
const SCHOOL_LOGIN_ID = '1000';
const PARAMS = ['staff_member_id' => 1];
const API_USERNAME = getenv('API_USERNAME'); // Assuming you have these environment variables set
const API_PASSWORD = getenv('API_PASSWORD');

$curl = curl_init();

$query = http_build_query(PARAMS);

$options = [
    CURLOPT_URL => BASE_URL . '/' . SCHOOL_LOGIN_ID . '?' . $query,
    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;

Last updated