wingrunr21 / mindbody-api

A Ruby interface to the MindBody API v0.5
http://wingrunr21.github.com/mindbody-api
MIT License
29 stars 46 forks source link

AppointmentService.get_schedule_items doesn't always return appointments #40

Closed brian-kephart closed 4 years ago

brian-kephart commented 7 years ago

Request:

response = MindBody::Services::AppointmentService.get_schedule_items(
      'UserCredentials' => {
        'Username'      => username,
        'Password'      => password,
        'SiteIDs'       => {
          'int'         => MindBody.configuration.site_ids
        }
      },
      'StartDate'       => @date.to_date.beginning_of_week,
      'EndDate'         => @date.to_date.end_of_week,
      'StaffIDs'        => {
        'long'          => [100000000]
      }
    )

Bad behavior:

response.result[:staff_members][:appointments]
=> NoMethodError

Workaround:

response.response.hash[:envelope][:body][:get_schedule_items_response][:get_schedule_items_result][:staff_members][:appointments]
=> bunch of appointments

(expected behavior)

Weird stuff: