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
| Parameter | Type | Required | Description |
|---|---|---|---|
| username | string | yes | Your username. |
| password | string | yes | Your 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
| Parameter | Type | Required | Description |
|---|---|---|---|
| test_id | string | yes | Alphanumeric test identifier. |
| patient_email | string | yes | Email address of the patient. |
| patient_name | string | yes | First name of the patient. |
| patient_surname | string | yes | Last name of the patient. |
| gender | string | yes | Gender of the patient (either “male” or “female”). |
| dob | string | yes | Date of birth of the patient in “dmY” format (e.g., “01012000”). |
| test_date | string | yes | Date of taste in “dmY” format (e.g., “01012000”). |
| phone | string | yes | Phone number of the patient. |
| profiles | string[] | yes | Requested test profile codes. Please see the test code table for more information. |
| Profile Code | Test Name |
|---|---|
| HBEL | Thalassaemia Screen |
| NADL066 | Hair loss profile |
| HBIM | Hepatitis B surface antibody |
| NADL065 | Menopause profile |
| B12 | Vitamin B12 (active form) |
| Vitamin B profile | Vitamin B complex panel (2x EDTA and 1xSST) |
| Vitamin D | Vitamin D |
| NADL063 | G6PD (Glucose-6 phosphate dehydrogenase) |
| NADL053 | Inhalant panel |
| NADL062 | Male hormone panel |
| NADL061 | Female hormone panel |
| NADL057 | Polycystic Ovary Syndrome (PCOS) |
| NADL060 | Full sexual health screen |
| NADL059 | Herpes 1/2 |
| NADL058 | STI panel |
| NADL054 | ALEX Screen |
| NADL052 | Antibiotics Panel |
| NADL051 | Fish & Shellfish Panel |
| NADL050 | Children’s Panel |
| NADL049 | Foods & Inhalants Profile |
| NADL047 | Nut & Seeds Panel |
| NADL046 | Common Foods Profile |
| NADL042 | Well Woman |
| NADL041 | Well Man |
| NADL035 | Erectile Dysfunction |
| NADL032 | Prostate Profile |
| NADL031 | Thyroid Profile |
| NADL026 | Biochemistry Profile |
| NADL015 | Liver Function Tests |
| NADL014 | Kidney (renal) function |
| NADL009 | HbA1c |
| NADL027 | Iron Status Profile |
| NADL004 | High-sensitivity C-reactive protein (HS-CRP) |
| NADL003 | Lipids/cholesterol |
| NADL001 | Beta HCG (pregnancy) |
| NADL029 | STI Screen- Basic |
| NADL037 | STI Screen- Bloods Only |
| NADL036 | Hepatitis B Profile |
| NADL012 | Hepatitis C antibody |
| NADL011 | Hepatitis B Surface antigen |
| NADL010 | Hepatitis B Core antibody |
| NADL028 | Prostate specific antigen (PSA) only |
| NADL022 | Testosterone |
| NADL020 | Prolactin |
| NADL019 | Progesterone |
| NADL018 | Oestradiol |
| NADL007 | Follicle Stimulating Hormone (FSH) |
| NADL016 | Luteinising hormone (LH) |
| NADL055 | Cortisol |
| NADL030 | Vitamin Profile 1 |
| NADL045 | Blood Group |
| NADL008 | Full 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
| Parameter | Type | Required | Description |
|---|---|---|---|
| test_id | string | yes | Alphanumeric 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"
}