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

Get Client Visits #43

Open Durkheim opened 6 years ago

Durkheim commented 6 years ago

Hi There,

I'm trying to follow the example for get_client_visits listed in the ReadMe.

First, I use get_clients to fetch the desired client

client = MindBody::Services::ClientService.get_clients('UserCredentials' => { 'Username' => username, 'Password' => password, 'SiteIDs' => { 'int' => [site_ids] } }, 'SearchText' => client_name, site_id: site_ids).result[:clients]

From there, I'm grabbing the client id and passing that to get_client_visits as an integer.

client_id = client.id
MindBody::Services::ClientService.get_client_visits(client_id).result[:visits]

I get a response from the MindBody api with a 200 status code, but the result for visits is nil. I checked the clients visit history in the MindBody web app and they have several visits in there visit history.

Should I be passing the client_it in a different format?