# Medications
The Medications API enables CRUD operations for medication records. Each medication entry includes essential details such as name, brands, and description.
# Get Medication List
Retrieve a list of all medications.
- URL:
documents/medications/ - Method:
GET - Response Example:
[ { "unique_id": "med123", "medication_name": "Aspirin", "medication_brands": "Bayer, Bufferin", "medication_details": "Used to reduce fever and relieve mild to moderate pain.", "date_created": "2023-01-01T12:00:00Z", "last_updated": "2023-01-01T12:00:00Z" }, { "unique_id": "med456", "medication_name": "Ibuprofen", "medication_brands": "Advil, Motrin", "medication_details": "Nonsteroidal anti-inflammatory drug.", "date_created": "2023-01-02T12:00:00Z", "last_updated": "2023-01-02T12:00:00Z" }, ... ]
# Create a Medication
Create a new medication entry.
- URL:
documents/medications/ - Method:
POST - Request Example:
{ "medication_name": "Aspirin", "medication_brands": "Bayer, Bufferin", "medication_details": "Used to reduce fever and relieve mild to moderate pain." } - Response Example:
{ "unique_id": "med123", "medication_name": "Aspirin", "medication_brands": "Bayer, Bufferin", "medication_details": "Used to reduce fever and relieve mild to moderate pain.", "date_created": "2023-01-01T12:00:00Z", "last_updated": "2023-01-01T12:00:00Z" }
# Get a Medication
Retrieve details of a specific medication by unique ID.
- URL:
documents/medications/<str:unique_id>/ - Method:
GET - Response Example:
{ "unique_id": "med123", "medication_name": "Aspirin", "medication_brands": "Bayer, Bufferin", "medication_details": "Used to reduce fever and relieve mild to moderate pain.", "date_created": "2023-01-01T12:00:00Z", "last_updated": "2023-01-01T12:00:00Z" }
# Update a Medication
Update an existing medication by unique ID.
- URL:
documents/medications/<str:unique_id>/ - Method:
PUT - Request Example:
{ "medication_name": "Ibuprofen", "medication_brands": "Advil, Motrin", "medication_details": "Nonsteroidal anti-inflammatory drug used to relieve pain." } - Response Example:
{ "unique_id": "med123", "medication_name": "Ibuprofen", "medication_brands": "Advil, Motrin", "medication_details": "Nonsteroidal anti-inflammatory drug used to relieve pain.", "date_created": "2023-01-01T12:00:00Z", "last_updated": "2023-01-03T08:30:00Z" }
# Delete a Medication
Delete a medication by unique ID.
- URL:
documents/medications/<str:unique_id>/ - Method:
DELETE - Response:
204 No Content