Skip to content

Appointment Routes

Alex Aralis edited this page Aug 1, 2017 · 5 revisions

Appointment Routes

GET /appointment

Requires authentication. Gets all appointments involving users both as a learner and as a tutor.

returns

{
  asTutor: Array<Appointment>,
  asLearner: Array<Appointment>,
}

GET /appointment/:appointmentId

Requires auth. Fetch an appointment that has the logged in user as the tutor or learner in the appointment.

{
  appointment: Appointment,
  message: string,
}

POST /appointment

Requires authentication by a user with a registered card. Creates a proposed appointment between startDate and endDate, at location with tutor.

requires

{
  tutor: string,
  startDate: Date,
  endDate: Date,
  location: string,
  subject: string,
}

returns

{
  message: string,
  appointment: Appointment,
}

POST /appointment/approve/:appointmentId

Requires authentication as a tutor. Approves an appointment. This triggers billing of the involved learner.

returns

{
  message: string,
  appointment: Appointment,
}

POST /appointment/reject/:appointmentId

Requires authentication as a tutor. Rejects an appointment.

returns

{
  message: string,
  appointment: Appointment,
}

Clone this wiki locally