Public
Documentation Settings

Med_Sal API

This documentation descripes the API work in the med_sal project

http://127.0.0.1:8000/api/v1 => 127.0.0.1:8000/api/v1/

appointments

specific appointment

GETread

http://127.0.0.1:8000/api/v1/appointments/30/

This HTTP GET request retrieves details of a specific appointment by providing the appointment ID in the URL.

This endpoint is for authenticated users.

The response will contain details such as appointment ID, timing, date, status, creation and update timestamps, service details, user details, location ID, provider details, and provider business name.

The response will be in JSON format with a status code of 200.

HEADERS
Authorization

JWT eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ0b2tlbl90eXBlIjoiYWNjZXNzIiwiZXhwIjoxNzA3MTUxMTQ1LCJpYXQiOjE3MDcxNDk5NDUsImp0aSI6ImVjYTg2YjU2MzQzMTRjOGM4ODQ5ZDE5NDIxZjBhNWRjIiwidXNlcl9pZCI6Mjl9.Nvwe8pUiojODkH1f_Nqi6RvAEDGDlSmfOcbNXbQ_JzI

DELETEdelete

http://127.0.0.1:8000/api/v1/appointments/34/

This endpoint sends an HTTP DELETE request to remove the appointment with the ID 34.

This endpoint is for admins.

The response returns a status code of 204 with a Content-Type of text/xml.

HEADERS
Authorization

JWT eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ0b2tlbl90eXBlIjoiYWNjZXNzIiwiZXhwIjoxNzA3MTU3NTgyLCJpYXQiOjE3MDcxNTYzODIsImp0aSI6IjI1NzFhODA1YTk3YjQ4MDBhNzVkMjY3YzMxNTg1NGM5IiwidXNlcl9pZCI6MjN9.H2O2iY0lODPdbL4MR9k3l4ZAeMc80atpTKoBs61Tamw

POSTcreate

http://127.0.0.1:8000/api/v1/appointments/create/

Create Appointment

This endpoint allows you to create a new appointment.

This endpoint is for authenticated users.

Request Body

  • from_time (string, required): The start time of the appointment.
  • to_time (string, required): The end time of the appointment.
  • service (integer, required): The ID of the service for the appointment.
  • diagonsis (string, optional): The diagnosis for the appointment.
  • date (string, required): The date of the appointment.
  • note (string, optional): Any additional notes for the appointment.

Response

  • id (integer): The ID of the created appointment.
  • from_time (string): The start time of the appointment.
  • to_time (string): The end time of the appointment.
  • date (string): The date of the appointment.
  • status (string): The status of the appointment.
  • created_at (string): The timestamp of when the appointment was created.
  • updated_at (string): The timestamp of when the appointment was last updated.
  • service (integer): The ID of the service for the appointment.
  • user (integer): The ID of the user for the appointment.
  • user_email (string): The email of the user for the appointment.
  • service_title (string): The title of the service for the appointment.
  • location_id (integer): The ID of the location for the appointment.
  • provider_id (integer): The ID of the provider for the appointment.
  • provider_email (string): The email of the provider for the appointment.
  • provider_business_name (string): The business name of the provider for the appointment.

Example Response

json
{
    "id": 0,
    "from_time": "",
    "to_time": "",
    "date": "",
    "status": "",
    "created_at": "",
    "updated_at": "",
    "service": 0,
    "user": 0,
    "user_email": "",
    "service_title": "",
    "location_id": 0,
    "provider_id": 0,
    "provider_email": "",
    "provider_business_name": ""
}
HEADERS
Authorization

JWT eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ0b2tlbl90eXBlIjoiYWNjZXNzIiwiZXhwIjoxNzA3MTU3OTY1LCJpYXQiOjE3MDcxNTY3NjUsImp0aSI6ImQzYTM0YmMxOGVmNzQwMzQ5ZmYwZWIyYmRmMTlkNzAwIiwidXNlcl9pZCI6Mjl9.TW2HTiPXMWa4JMD6awqt8KHMAOFR_wFhKPOWmxT_By0

Bodyraw (json)
json
{
  "from_time": "12:00",
  "to_time": "13:30",
  "service": 21,
  "diagonsis": "nothing",
  "date": "2024-2-15",
  "note": "no note"
}
Loading