1

I'm trying to link into the mindbody API to book members in using RoR from this git: https://github.com/mindbody/API-Examples/tree/master/Ruby

Error:

Wasabi::Resolver::HTTPError in HomeController#index

According to the logs, I haven't entered the correct details. However, I have changed the source and user credentials in the home_controller controller file.

source_credentials = {:SourceName => 'MySourceName', :Password => 'MySourcePassword', :SiteIDs => site_ids } user_credentials = { :Username => 'MyUsername', :Password => 'MyUserPassword', :SiteIDs => site_ids }

Thanks in advance!

SOAP log:

_getClasses_request.xml

<?xml version="1.0" encoding="utf-8" ?> <env:Envelope xmlns:env="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <env:Body> <n1:GetClasses xmlns:n1="http://clients.mindbodyonline.com/api/0_5"> <n1:Request> </n1:Request> </n1:GetClasses> </env:Body> </env:Envelope>

_getClasses_response.xml:

<soap:Body> <GetClassesResponse xmlns="http://clients.mindbodyonline.com/api/0_5"> <GetClassesResult> <Status>InvalidCredentials</Status> <Message>SourceCredentials must be provided.</Message> <XMLDetail>Full</XMLDetail> <ResultCount>0</ResultCount> <CurrentPageIndex>0</CurrentPageIndex> <TotalPageCount>0</TotalPageCount> </GetClassesResult> </GetClassesResponse> </soap:Body> </soap:Envelope>

Paul Fioravanti
  • 16,423
  • 7
  • 71
  • 122
tgrrr
  • 706
  • 6
  • 16

1 Answers1

0

I'd probably avoid basing any Ruby code you plan on writing for your MindBody app on the code you find in their official example code repos, and instead just use the mindbody-api gem to wrap your API calls.

As for your issue, it doesn't actually look like you have passed any authentication parameters (neither source credentials, nor user credentials) into your XML request, which would explain the response that you got back.

If you haven't already, have a look at the Authentication page of the MindBody documentation, as well as the GetClasses entry in the ClassService page documentation page to see what your XML request should look like (both require a MindBody account to access).

Paul Fioravanti
  • 16,423
  • 7
  • 71
  • 122
  • It turns out the XML code in the MindBody Documentation and [MindBody gem] (https://github.com/wingrunr21/mindbody-api) is incorrectly formatted. – tgrrr Sep 09 '15 at 02:06
  • I've found the MindBody documentation in general to be quite unreliable, so that doesn't surprise me. As for the XML, I haven't had any particular issues with what's included in the [mindbody-api gem](https://github.com/wingrunr21/mindbody-api), though I did need to monkey patch some of the [services classes](https://github.com/wingrunr21/mindbody-api/tree/master/lib/mindbody-api/services) to remove `:required` parameters in order to be able to, for example, dynamically change out the credentials on a per-API callout basis. How did you solve your problem, by the way? – Paul Fioravanti Sep 09 '15 at 06:17