简体   繁体   English

Mindbody获取每次客户拜访的详细信息

[英]Mindbody get details of every client visit

Right now I have a very expensive (API intense) way to get every single client's visit history. 现在,我有一种非常昂贵(API密集型)的方法来获取每个客户的访问历史。 First I get each Client ID, then I call GetClientVisits to get each client's history. 首先,我获得每个客户端ID,然后调用GetClientVisits以获取每个客户端的历史记录。 Is there a less API intense way to do this? 有没有那么少使用API​​的方法?

See code below: 参见下面的代码:

    clientService = ClientServiceCalls()

    clientResponse = clientService.GetClientsByString(self.USER_NAME, self.USER_PASSWORD, self.SITE_IDS, '')
    clientList = clientResponse.Clients.Client

    clientVisitsDict = []

    for c in clientList:
        clientResponseVisits = clientService.GetClientVisits(self.USER_NAME, self.USER_PASSWORD, self.SITE_IDS, str(c.ID), oneMonthAgo, datetime.today())

        if clientResponseVisits.Visits:
            visitsList = clientResponseVisits.Visits.Visit
            for v in visitsList:
                q = {}
                q['cust_id'] = str(c.ID)
                q['timeframe'] = str(datetime.now().month) + '-' + str(datetime.now().year)
                q['profile'] = str(self.PROFILE)
                q['cust_name'] = str(c.FirstName) + ' ' + str(c.LastName)
                q['class_id'] = str(v.ClassID)
                q['class_time'] = str(v.ClassID)
                q['class_name'] = str(v.Name)
                q['class_location'] = str(v.Location.Name)
                q['class_instructor_id'] = str(v.Staff.ID)
                q['class_instructor_name'] = str(v.Staff.Name)

                print q['class_instructor_name']

                clientVisitsDict.append(q)

To my best knowledge, there's no such way with the currently provided API. 据我所知,当前提供的API尚无此方法。 And, actually, to me, it seems to be one of the major drawbacks of the MINDBODY API. 而且,实际上,对我来说,这似乎是MINDBODY API的主要缺点之一。

I'm only aware of two possible ways with this situation. 我只知道这种情况的两种可能方式。

First one is to wait when updates to the API are implemented. 首先是等待对API的更新实现。 Recently MINDBODY sent a survey to the dev accounts with possible API improvements related questions. 最近,MINDBODY向开发人员帐户发送了一项调查,调查可能涉及API改进的问题。 So there's some chance the API is going to be improved with time. 因此,随着时间的推移,API很有可能会得到改进。

The second is to contact API support and to request implementing a specific function for your needs. 第二个是联系API支持并请求实现您所需的特定功能。 According to what I know, this might be possible these days with an additional payment from your (or your company) side. 据我所知,这几天可能需要您(或您的公司)方面的额外付款。

Hope it helps. 希望能帮助到你。 I'd be happy to hear about other possible workarounds too. 我也很高兴听到其他可能的解决方法。 Might be there's something I've missed. 可能是我想念的东西。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM