# Hospitals
The Hospitals API allows authenticated users to manage hospital records. Users can list, create, retrieve, update, and delete hospital entries. Each hospital entry is uniquely identified by a unique_id and contains comprehensive information, including contact details, location, and type.
# Get Hospital List
Retrieve a list of all hospitals.
- URL:
resources/hospitals/ - Method:
GET - Response Example:
[ { "unique_id": "12345", "hospital_name": "General Hospital", "hospital_description": "A primary healthcare hospital.", "hospital_practice_number": "GH123456", "hospital_type": "Private", "hospital_physical_address": "123 Health St, Wellness City", "hospital_postal_address": "P.O. Box 7890", "hospital_town": "Wellness City", "hospital_region": "Central", "hospital_province": "Province A", "hospital_country": "Country X", "hospital_postal_code": "1001", "hospital_phone_number": "123-456-7890", "hospital_phone_number_alt": "123-456-7891", "hospital_emergency_number": "123-456-7899", "hospital_fax_number": "123-456-7892", "hospital_email_address": "info@generalhospital.com", "hospital_website_url": "https://www.generalhospital.com", "hospital_image_url": "https://images.com/12345", "hospital_latitude": "-25.12345", "hospital_longitude": "28.12345", "date_created": "2023-01-01T12:00:00Z", "last_updated": "2023-01-05T08:30:00Z" }, ... ]
# Create a Hospital
Create a new hospital entry.
URL:
resources/hospitals/Method:
POSTRequest Example:
{ "hospital_name": "General Hospital", "hospital_description": "A primary healthcare hospital.", "hospital_practice_number": "GH123456", "hospital_type": "Private", "hospital_physical_address": "123 Health St, Wellness City", "hospital_postal_address": "P.O. Box 7890", "hospital_town": "Wellness City", "hospital_region": "Central", "hospital_province": "Province A", "hospital_country": "Country X", "hospital_postal_code": "1001", "hospital_phone_number": "123-456-7890", "hospital_phone_number_alt": "123-456-7891", "hospital_emergency_number": "123-456-7899", "hospital_fax_number": "123-456-7892", "hospital_email_address": "info@generalhospital.com", "hospital_website_url": "https://www.generalhospital.com", "hospital_image_url": "https://images.com/12345", "hospital_latitude": "-25.12345", "hospital_longitude": "28.12345" }Response Example:
{ "unique_id": "12345", "hospital_name": "General Hospital", "hospital_description": "A primary healthcare hospital.", "hospital_practice_number": "GH123456", "hospital_type": "Private", "hospital_physical_address": "123 Health St, Wellness City", "hospital_postal_address": "P.O. Box 7890", "hospital_town": "Wellness City", "hospital_region": "Central", "hospital_province": "Province A", "hospital_country": "Country X", "hospital_postal_code": "1001", "hospital_phone_number": "123-456-7890", "hospital_phone_number_alt": "123-456-7891", "hospital_emergency_number": "123-456-7899", "hospital_fax_number": "123-456-7892", "hospital_email_address": "info@generalhospital.com", "hospital_website_url": "https://www.generalhospital.com", "hospital_image_url": "https://images.com/12345", "hospital_latitude": "-25.12345", "hospital_longitude": "28.12345", "date_created": "2023-01-01T12:00:00Z", "last_updated": "2023-01-05T08:30:00Z" }
# Get a Hospital
Retrieve details of a specific hospital by unique ID.
- URL:
resources/hospitals/<str:unique_id>/ - Method:
GET - Response Example:
{ "unique_id": "12345", "hospital_name": "General Hospital", "hospital_description": "A primary healthcare hospital.", "hospital_practice_number": "GH123456", "hospital_type": "Private", "hospital_physical_address": "123 Health St, Wellness City", "hospital_postal_address": "P.O. Box 7890", "hospital_town": "Wellness City", "hospital_region": "Central", "hospital_province": "Province A", "hospital_country": "Country X", "hospital_postal_code": "1001", "hospital_phone_number": "123-456-7890", "hospital_phone_number_alt": "123-456-7891", "hospital_emergency_number": "123-456-7899", "hospital_fax_number": "123-456-7892", "hospital_email_address": "info@generalhospital.com", "hospital_website_url": "https://www.generalhospital.com", "hospital_image_url": "https://images.com/12345", "hospital_latitude": "-25.12345", "hospital_longitude": "28.12345", "date_created": "2023-01-01T12:00:00Z", "last_updated": "2023-01-05T08:30:00Z" }
# Update a Hospital
Update an existing hospital by unique ID.
- URL:
resources/hospitals/<str:unique_id>/ - Method:
PUT - Request Example:
{ "hospital_name": "Updated General Hospital", "hospital_description": "Updated description for the hospital." } - Response Example:
{ "unique_id": "12345", "hospital_name": "Updated General Hospital", "hospital_description": "Updated description for the hospital.", "hospital_practice_number": "GH123456", "hospital_type": "Private", "hospital_physical_address": "123 Health St, Wellness City", "hospital_postal_address": "P.O. Box 7890", "hospital_town": "Wellness City", "hospital_region": "Central", "hospital_province": "Province A", "hospital_country": "Country X", "hospital_postal_code": "1001", "hospital_phone_number": "123-456-7890", "hospital_phone_number_alt": "123-456-7891", "hospital_emergency_number": "123-456-7899", "hospital_fax_number": "123-456-7892", "hospital_email_address": "info@generalhospital.com", "hospital_website_url": "https://www.generalhospital.com", "hospital_image_url": "https://images.com/12345", "hospital_latitude": "-25.12345", "hospital_longitude": "28.12345", "date_created": "2023-01-01T12:00:00Z", "last_updated": "2023-01-06T08:30:00Z" }
# Delete a Hospital
Delete a hospital by unique ID.
- URL:
resources/hospitals/<str:unique_id>/ - Method:
DELETE - Response:
204 No Content
Doctors →