Get Appointments

GET /trainer-appointment

Get client's trainer appointments using their client_id.

Responses

  • 200 application/json

    Successful retrieval of appointments.

    Hide response attributes Show response attributes object
    • success boolean

      Whether the retrieval is successful

    • bank_card array[object]
      Hide bank_card attributes Show bank_card attributes object
      • client_id integer Required

        Id of the client in database

      • created_at string(date) Required

        Account creation date

      • email_address string Required

        Client's email address

      • first_name string Required

        Client's first name

      • last_name string Required

        Client's last name

      • patronymic string Required

        Client's patronymic/middle name

      • phone_number string Required

        Client's phone number

      • profile_picture_url string Required

        Link to client's profile picture, typically uploaded using POST /profile-picture

      • employee_id integer Required

        Id of the employee in database

      • employee_type string Required

        Employee's current job posting

        Values are ADMIN, INSTRUCTOR, or TRAINER.

      • left_at string(date) Required

        Employee's firing date (null if employee wasn't fired yet)

      • trainer_appointment_id integer Required

        Id of the appointment in database

      • gym_id integer Required

        Id of the gym in database

      • appointed_at string(date) Required

        Appointment start date

      • ends_at string(date) Required

        Appointment end date

  • 401 application/json

    User is not unauthorized or permissions are missing.

    Hide response attributes Show response attributes object
    • success boolean

      Whether query is successful

    • error string

      Error message

  • 429 application/json

    Rate limit exceeded - 100 queries per 15 minutes.

    Hide response attributes Show response attributes object
    • success boolean

      Whether query is successful

    • error string

      Error message

GET /trainer-appointment
curl \
 --request GET 'http://63.141.232.244:25540/v0/trainer-appointment' \
 --header "Authorization: Bearer $ACCESS_TOKEN"
Response examples (200)
{
  "success": true,
  "bank_card": [
    {
      "client_id": 1,
      "last_name": "Иванов",
      "created_at": "2024-10-10T18:36:47Z",
      "first_name": "Иван",
      "patronymic": "Иванович",
      "phone_number": "79174236278",
      "email_address": "Og0rB@example.com",
      "profile_picture_url": "https://example.com/profile_picture.jpg",
      "left_at": null,
      "employee_id": 2,
      "employee_type": "ADMIN",
      "gym_id": 1,
      "ends_at": "2024-10-10T20:36:47Z",
      "appointed_at": "2024-10-10T18:36:47Z",
      "trainer_appointment_id": 1
    }
  ]
}
Response examples (401)
{
  "success": false,
  "error": "Unauthorized"
}
Response examples (429)
{
  "success": false,
  "error": "Too many requests, please try again later"
}