I've been working for days trying to figure out how receive a simple XML response from the mindbody API. Their example code seems riddled with errors, and I've been slowly working my way through them. I have finally figured out how to authenticate and send an XML request without getting an error. However, there is a $startDate and $endDate variable that is not being populated correctly and I can't figure out why.
Here is the portion of the XML dump for the sent request that is confusing me:
<ns9:StartClassDateTime>1969-12-31T16:33:33-08:00</ns9:StartClassDateTime>
<ns10:EndClassDateTime>1969-12-31T16:33:03-08:00</ns10:EndClassDateTime>
The truncated function I'm calling is this:
public function GetClassDescriptions(array $classDescriptionIDs, array $staffIDs, array $locationIDs, $startDate, $endDate, $PageSize = NULL, $CurrentPage = NULL, $XMLDetail = XMLDetail::Full, $Fields = NULL, SourceCredentials $credentials = null)
{
...
if (isset($startDate))
{
$additions['StartClassDateTime'] = $startDate;
}
if (isset($endDate))
{
$additions['EndClassDateTime'] = $endDate;
}
...
}
And my call is:
$result = $classService->GetClassDescriptions(array(), array(), array(), 2014-08-01, 2014-08-31, 9, 0);
I'm just totally confused as to why the XML request would show that different format than what I'm passing it?
No comments:
Post a Comment