Skip to content

Instantly share code, notes, and snippets.

@deitrick
Created August 30, 2012 19:56
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save deitrick/3539316 to your computer and use it in GitHub Desktop.
Save deitrick/3539316 to your computer and use it in GitHub Desktop.
Mindbody API Integration
<?php
include_once('MINDBODY_API_v0.5.php');
$mb = new MINDBODY_API();
$tomorrow = date('Y-m-d\TH:i:s', strtotime("tomorrow")); // note for MINDBODY you have to format your dates in the standard ISO 8601 format but without the timezone offset
$thirtydays = strtotime(date("Y-m-d", strtotime($tomorrow)) . " +30 days");
$params = array(
"StartDateTime"=>$tomorrow,
"EndDateTime"=> $thirtydays
);
$mbResult = $mb->getClasses($params);
foreach($mbResult->GetClassesResult->Classes->Class as $class) {
// echo gettype($class);
echo $class->StartDateTime;
echo " | ";
echo $class->Staff->Name;
echo '<br />';
}
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment