mindbody-api icon indicating copy to clipboard operation
mindbody-api copied to clipboard

Get Client Visits

Open Durkheim opened this issue 7 years ago • 0 comments

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?

Durkheim avatar Mar 08 '18 21:03 Durkheim