API Medications

See API Specification

Anyone using the API should also become very familiar with our schema documentation which contains important details about individual database table columns.
See Medication Database Schema.

Medications GET (single)

Version Added: 26.1.14

Gets a single medication.

MedicationNum: Required in the URL.

Example Request:
GET /medications/42

Example Response:
{
"MedicationNum": 42,
"MedName": "Acetaminophen",
"GenericNum": 42,
"genericName": "Acetaminophen",
"Notes": "",
"DateTStamp": "2019-10-02 12:31:11",
"IsHidden": "false"
}

200 OK
404 NotFound (with explanation)

Medications GET (multiple)

Version Added: 21.3

Gets a list of medications.

Example Request:
GET /medications

Example Response:
[
{
"MedicationNum": 12,
"MedName": "Glucophage",
"GenericNum": 124,
"genericName": "Metformin",
"Notes": "",
"DateTStamp": "2016-12-01 14:10:23",
"IsHidden": "false"
},
etc...
]

200 OK
400 BadRequest (with explanation)

Medications POST

Version Added: 21.3

Creates a new medication.

MedName: Required.

GenericNum: (Added in version 26.1.14) Optional. This or genericName can be used to link a medication to a generic medication. If not provided, this will be the same as MedicationNum, indicating this medication is generic.
genericName: Optional. This or GenericNum can be used to link a medication to a generic medication. If not provided this will be the same as MedName.
Notes: Optional. Can only be set if this medication is generic. Default empty string.

Example Requests:
POST /medications

{
"MedName": "Metformin",
"Notes": "Antidiabetic agent"
}

or

{
"MedName": "Glucophage",
"genericName": "Metformin"
}

Example Response:
{
"MedicationNum": 28,
"MedName": "Glucophage",
"GenericNum": 124,
"genericName": "Metformin",
"Notes": "Antidiabetic agent",
"DateTStamp": "2016-12-01 08:22:31",
"IsHidden": "false"
}

201 Created
400 BadRequest (with explanation)
404 Not Found (with explanation)

Medications PUT

Version Added: 26.1.14

Updates a medication.

MedicationNum: Required in the URL.


Notes: Optional. Can only be set if this medication is generic.
IsHidden: Optional. Either "true" or "false".

Example Request:
PUT /medications/42

{
"Notes": "Treats mild-to-moderate pain and reduces fevers.",
"IsHidden": "true"
}

Example Response:
{
"MedicationNum": 42,
"MedName": "Acetaminophen",
"GenericNum": 42,
"genericName": "Acetaminophen",
"Notes": "Treats mild-to-moderate pain and reduces fevers.",
"DateTStamp": "2026-04-22 10:45:48",
"IsHidden": "true"
}

200 OK
400 BadRequest (with explanation)
404 Not Found (with explanation)

Medications DELETE

Version Added: 26.1.14

Deletes a medication.

MedicationNum: Required in the URL.

Example Request:
DELETE /medications/28

Example Response:
200 OK
400 BadRequest (with explanation)
404 Not Found (with explanation)