Mindbody获取每个客户的详细信息

2024-10-04 11:31:37 发布

您现在位置:Python中文网/ 问答频道 /正文

现在我有一个非常昂贵的(API密集型)方法来获取每个客户的访问历史。 首先获取每个客户机的ID,然后调用getclientvists获取每个客户机的历史记录。有没有一种API强度较低的方法可以做到这一点?你知道吗

参见下面的代码:

    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)

Tags: 方法nameselfapiiddatetime客户机class
1条回答
网友
1楼 · 发布于 2024-10-04 11:31:37

据我所知,目前提供的API没有这种方法。实际上,对我来说,这似乎是mindbodyapi的主要缺点之一。你知道吗

我只知道在这种情况下有两种可能的方法。你知道吗

第一种方法是等待API的更新被实现。最近MINDBODY向dev帐户发送了一份调查报告,其中提出了可能的API改进相关问题。因此,随着时间的推移,API有可能得到改进。你知道吗

第二种方法是联系API支持人员,请求实现满足您需要的特定功能。据我所知,这几天你方(或贵公司)可能会额外付款。你知道吗

希望有帮助。我也很高兴听到其他可能的解决办法。可能我错过了什么。你知道吗

相关问题 更多 >