API Documentation

Explore NAD Medica’s API reference.

1. Authentication

All requests to the API must be authenticated using JSON Web Tokens (JWT). To obtain a token, send a POST request to the /wp-json/jwt-auth/v1/token endpoint with your provided credentials.

Request Body Parameters

ParameterTypeRequiredDescription
usernamestringyesYour username.
passwordstringyesYour API password.

Request

POST /wp-json/jwt-auth/v1/token
Content-Type: application/json

{
  "username": "your_username",
  "password": "your_password"
}

Response

200 OK
Content-Type: application/json

{
    "token": "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJodHRwczovL2Jsb29kLWRldi5uYWRsYWJvcmF0b3J5LmNvbSIsImlhdCI6MTY4ODY1NjA2MCwibmJmIjoxNjg4NjU2MDYwLCJleHAiOjE2ODkyNjA4NjAsImRhdGEiOnsidXNlciI6eyJpZCI6IjgxIn19fQ.8yiVqw-gxIbx1hIplsGr316Z_scJcTJNmi_0EVl-UyY",
    "user_email": "your_email",
    "user_nicename": "your_nicename",
    "user_display_name": "you_display_name"
}

2. Register a Test

Registers a new test.

Request Body Parameters

ParameterTypeRequiredDescription
test_idstringyesAlphanumeric test identifier.
patient_emailstringyesEmail address of the patient.
patient_namestringyesFirst name of the patient.
patient_surnamestringyesLast name of the patient.
genderstringyesGender of the patient (either “male” or “female”).
dobstringyesDate of birth of the patient in “dmY” format (e.g., “01012000”).
test_datestringyesDate of taste in “dmY” format (e.g., “01012000”).
phonestringyesPhone number of the patient.
profilesstring[]yesRequested test profile codes. Please see the test code table for more information.
Profile CodeTest Name
HBELThalassaemia Screen
NADL066Hair loss profile
HBIMHepatitis B surface antibody
NADL065Menopause profile
B12Vitamin B12 (active form)
Vitamin B profileVitamin B complex panel (2x EDTA and 1xSST)
Vitamin DVitamin D
NADL063G6PD (Glucose-6 phosphate dehydrogenase)
NADL053Inhalant panel
NADL062Male hormone panel
NADL061Female hormone panel
NADL057Polycystic Ovary Syndrome (PCOS)
NADL060Full sexual health screen
NADL059Herpes 1/2
NADL058STI panel
NADL054ALEX Screen
NADL052Antibiotics Panel
NADL051Fish & Shellfish Panel
NADL050Children’s Panel
NADL049Foods & Inhalants Profile
NADL047Nut & Seeds Panel
NADL046Common Foods Profile
NADL042Well Woman
NADL041Well Man
NADL035Erectile Dysfunction
NADL032Prostate Profile
NADL031Thyroid Profile
NADL026Biochemistry Profile
NADL015Liver Function Tests
NADL014Kidney (renal) function
NADL009HbA1c
NADL027Iron Status Profile
NADL004High-sensitivity C-reactive protein (HS-CRP)
NADL003Lipids/cholesterol
NADL001Beta HCG (pregnancy)
NADL029STI Screen- Basic
NADL037STI Screen- Bloods Only
NADL036Hepatitis B Profile
NADL012Hepatitis C antibody
NADL011Hepatitis B Surface antigen
NADL010Hepatitis B Core antibody
NADL028Prostate specific antigen (PSA) only
NADL022Testosterone
NADL020Prolactin
NADL019Progesterone
NADL018Oestradiol
NADL007Follicle Stimulating Hormone (FSH)
NADL016Luteinising hormone (LH)
NADL055Cortisol
NADL030Vitamin Profile 1
NADL045Blood Group
NADL008Full Blood Count

Request

POST /wp-json/api/v1/register
Content-Type: application/json
Authorization: Bearer your_token

{
  "test_id": "abc123",
  "patient_email": "[email protected]",
  "patient_name": "John",
  "patient_surname": "Doe",
  "gender": "male",
  "dob": "01012000",
  "phone": "1234567890",
  "test_date": "01012000",
  "profiles": "[HBEL, NADL010]"
}

Response

200 OK
Content-Type: application/json

{
    "Status": true,
    "StatusCode": 1000,
    "StatusMessage": "success",
    "Data": [
        "your_test_id"
    ]
}

3. Retrieve Test Results

Check test status and retrieve results.

Request Body Parameters

ParameterTypeRequiredDescription
test_idstringyesAlphanumeric test identifier.

Request

POST /wp-json/api/v1/status
Content-Type: application/json
Authorization: Bearer your_token

{
  "test_id": "abc123"
}

Response

200 OK
Content-Type: application/json

{
    "Status": true,
    "StatusCode": 1000,
    "StatusMessage": "success",
    "Data": [
        "test_status": "your_test_status",
        "test_status_hl7": "status_HL7_file",
        "test_result_hl7": "result_HL7_file"
    ]
}

4. Error Handling

If there are any errors with the request, you will receive an appropriate error response.

Example Error Response

200 OK
Content-Type: application/json

{
    "Status": false,
    "StatusCode": 0,
    "StatusMessage": "Incorrect Data"
}