Staff

Retrieve a list of all staff users

GET /api/staff/
Query Parameters
  • username (string) – Find a user by username

Example request:

cURL

curl \
-H 'Token: <token>' https://demo.helpdeskz.com/api/staff

PHP

<?php
$curl = curl_init();
curl_setopt_array($curl, array(
  CURLOPT_URL => 'https://demo.helpdeskz.com/api/staff',
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_CUSTOMREQUEST => 'GET',
  CURLOPT_HTTPHEADER => array(
    'Token: <token>'
  ),
));
$response = curl_exec($curl);
curl_close($curl);

Example response:

{
    "success": 1,
    "users": [
        {
            "id": "1",
            "username": "admin",
            "fullname": "Andres Mendoza",
            "email": "andres@demo.com",
            "registration": "1611613586",
            "last_login": "1611618058"
        }
    ]
}

Retrieve details of staff user by ID

GET /api/staff/show/<staff_id>

Example request:

cURL

curl \
-H 'Token: <token>' https://demo.helpdeskz.com/api/staff/show/1

PHP

<?php
$curl = curl_init();
curl_setopt_array($curl, array(
  CURLOPT_URL => 'https://demo.helpdeskz.com/api/staff/show/1',
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_CUSTOMREQUEST => 'GET',
  CURLOPT_HTTPHEADER => array(
    'Token: <token>'
  ),
));
$response = curl_exec($curl);
curl_close($curl);

Example response:

{
    "success": 1,
    "staff_data": {
        "id": "1",
        "username": "admin",
        "fullname": "Andres Mendoza",
        "email": "andres@demo.com",
        "registration": "1611613586",
        "last_login": "1611618058"
    }
}

Staff Authentication

POST /api/staff/auth
Query Parameters
  • username (string) – Staff username

  • password (string) – Staff password

  • two_factor (numeric) – Two-Factor Authentication code, this is required if two-factor authentication is active in account

  • ip_address (string) – IP Address of client

Example request:

cURL

curl \
-X POST \
-H 'Token: <token>' https://demo.helpdeskz.com/api/staff/auth/ \
-F 'username="admin"' \
-F 'password="demo123"' \
-F 'two_factor="815435"' \
-F 'ip_address="127.0.0.1"'

PHP

<?php
$curl = curl_init();
curl_setopt_array($curl, array(
  CURLOPT_URL => 'https://demo.helpdeskz.com/api/staff/auth/',
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_CUSTOMREQUEST => 'POST',
  CURLOPT_POSTFIELDS => array('username' => 'admin','password' => 'demo123','two_factor' => '815435','ip_address' => '127.0.0.1'),
  CURLOPT_HTTPHEADER => array(
    'Token: <token>'
  ),
));
$response = curl_exec($curl);
curl_close($curl);

Example response:

{
    "success": 1,
    "message": "You have been logged in."
}