0

This Suddenly Happed , Mindbody started to returning next class schedule date , instead of returning startdate and enddate of given class .

like this .

[StartDateTime] => 2016-05-09T17:15:00 [EndDateTime] => 2016-05-09T18:15:00

this is like for every classes i get from function GetClasses() .

  • Did you end up solving your problem? This was a particularly difficult one for me when I was working with the API, so if you have a different solution from the one I posted, I'd be very interested in seeing it. – Paul Fioravanti May 25 '16 at 02:14
  • HI i talked with them . apparently you have run another api command get the correct startdatetime and enddate time . [getSchedules()] . getClasses api operation will return the class date – coolfuturefbiagent May 25 '16 at 14:29

1 Answers1

1

The MindBody API has quite a lot of issues with regards to the GetClasses API call in my experience (I used it in a project in mid-late 2015, so perhaps things have changed since then...). Here are a list of gotchas/issues that I found when trying to get the details of a class that will hopefully assist you:

  • When you make a GetClasses API request, if you pass in a ClassID only, any StartDateTime and EndDateTime parameters seem to just get ignored, meaning you can't actually find a class in the future
  • The API seems to ignore the time part of a datetime, so when you make the call, you'll get back a list of classes held throughout the day of the datetime. The times you'll get back for each of those classes will be timezoned classes, but they'll incorrectly declare themselves to be in UTC format, rather than their actual timezone
  • Don't attempt to add in a specified dateTime type parameter in your API call params as that will cause the datetimes you have in those parameters to be ignored

So, basically, what I had to do was use only ever three parameters in the call:

  • ClientID
  • StartDateTime (which I made 24 hours before the class I wanted's actual start time)
  • EndDateTime (which I made 24 hours after the class I wanted's actual end time)

The 24 hours before and after the actual class dates were because, as I mentioned above, I couldn't trust the timezones returned for each of the classes. Anyway, this would obviously return a collection of classes rather than a single class, and from there, I'd just iterate over the collection find the class I actually wanted.

The above findings were gained as a result of copious trial and error and pouring over documentation that was frequently incorrect, if it even existed at all. Good luck.

Paul Fioravanti
  • 16,423
  • 7
  • 71
  • 122