Skip to main content

ONSCHED API (Booking app)

https://docs.onsched.com/docs/getting-started

To view onsched data we can access 2 dashboards:​

  1. Sandbox (for staging and dev purposes): https://sandbox-dashboard.onsched.com
  2. Dashboard (for production): https://dashboard.onsched.com/

When user hits /plugins/appointments/standalone url, system calls onsched API to create location, service and resource.

First at app/controllers/settings_controller.rb system initialize the onsched location, service and resource:

 def init_appointments_app  
AppointmentsApp.init!(@backend_app, current_user, params)
end

lib/apps/appointments/setup.rb

 def init  
create_location
create_service
create_resource
end

All the created onsched data will be stored at APPs external_data attribute app.external_data["booking_app"]

CALENDAR AVAILABILITY​

CALENDAR TIMEZONE​

  • To change the timezone, we use the UPDATE_LOCATION_TIMEZONE function. It leads to update_location_timezone action in appointments_controller.rb. This action calls the update_location method in setup.rb, which makes a PUT request to Onsched update location object endpoint. (https://docs.onsched.com/reference/put_setup-v1-locations-id)

CALENDAR DURATION​

  • To change the availability duration, we use the UPDATE_SERVICE_DURATION function. It leads to update_service_duration action in appointments_controller.rb. This action calls the update_location method in setup.rb, which makes a PUT request to Onsched update service object endpoint. (https://docs.onsched.com/reference/put_setup-v1-services-id)