Skip to content

How to Add Availabilities or Unavailabilities

jonlunsford edited this page Oct 15, 2014 · 2 revisions

Availabilities as they pertain to MINDBODY are when a staff member is available to perform services.

This will go much smoother if you've already activated your developer account / app. See getting started. The API testing site isn't kept up to date, I've found that there are features missing and that particular site is very error prone. The official MINDBODY docs can be found here (need to be logged in to view).

You will need to know the staff members user credentials to add / update the availability or unavailability.

Add Availability

user_credentials = {
  "Username" => "my_username",
  "Password" => "my_password",
  "SiteIDs" => { "int" => [000] } # Site id the staff member is at
}

params = {
  "StartDateTime" => DateTime.new(2014, 10, 14, 12, 0),
  "EndDateTime" => DateTime.new(2014, 10, 14, 2, 0),
  "StaffIDs" => { "long" => 100000006 },
  "LocationID" => 1
}

MindBody::Services::AppointmentService.add_or_update_availabilities(user_credentials, params)

Add Unavailability

user_credentials = {
  "Username" => "my_username",
  "Password" => "my_password",
  "SiteIDs" => { "int" => [000] } # Site id the staff member is at
}

params = {
  "StartDateTime" => DateTime.new(2014, 10, 14, 14, 0, 0),
  "EndDateTime" => DateTime.new(2014, 10, 14, 04, 0, 0),
  "UnavailableDescription" => "Ruby FTW! Lunch!",
  "StaffIDs" => { "long" => 100000006 },
  "LocationID" => 1,
  "IsUnavailable" => true
}

MindBody::Services::AppointmentService.add_or_update_availabilities(user_credentials, params)

Notes and Caveats

  • LocationID is required, this isn't stated in the official docs
  • UserCredentials are required
  • In general hashes must match the SOAP structure exactly