How to work with API response

I managed to connect to the Mind Body api and run a simple command to get all the client data

from Helper.ClientService import ClientServiceCalls

calls = ClientServiceCalls()
clients = calls.GetAllClients()
print(clients)

the server will respond with this information:

(GetClientsResult){
   Status = "Success"
   ErrorCode = 200
   XMLDetail = "Full"
   ResultCount = 4503
   CurrentPageIndex = 0
   TotalPageCount = 181
   Clients = 
      (ArrayOfClient){
         Client[] = 
            (Client){
               MobileProvider = None
               AppointmentGenderPreference = "None"
               Gender = "Female"
               IsCompany = False
               LiabilityRelease = False
               PromotionalEmailOptIn = True
               CreationDate = 2017-02-23 00:00:00
               Liability = 
                  (Liability){
                     IsReleased = False
                     AgreementDate = None
                     ReleasedBy = None
                  }
               UniqueID = 100015484
               ID = "100015484"
               FirstName = "Sdfoij"
               LastName = "[asodfj"
               EmailOptIn = True
               State = "CA"
               Country = "US"
               BirthDate = None
               FirstAppointmentDate = 2017-03-03 00:00:00
               HomeLocation = 
                  (Location){
                     SiteID = -99
                     BusinessDescription = ""The MINDBODY Health Club Demo is awesome." - Anonymous (but probably someone cool and smart)"
                     AdditionalImageURLs = ""
                     FacilitySquareFeet = None
                     TreatmentRooms = None
                     HasClasses = True
                     PhoneExtension = None
                     ID = 1
                     Name = "Clubville"
                  }
               PhotoURL = "https://clients.mindbodyonline.com/studios/DemoAPISandboxRestore/clients/100015484_large.jpg?v=98"
               IsProspect = False
               Status = "Active"
               ContactMethod = 1
            }.... **and continue printing other client informations**

     }
 }

Now the problem is that I want to extract this information from it,

Client Email, Client Name, Client Phone Number, Client Status (active or inactive), Client Birthday, Client Address, Most Recent Visit Date, Most Recent Visit Description, Start Date, Custom Field(s)

But I don’t know which library I can use to analyze this output, I think of Beautiful Soup, but I'm not sure

I am really new to working with apis, so if anyone can give me an idea of ​​how to do this, it will be really cool.

+4
source share
1 answer

, WSDL mindbody googs : https://api.mindbodyonline.com/0_5/SiteService.asmx?wsdl. API, , SOAP. :

from suds.client import Client
from Helper.ClientService import ClientServiceMethods
calls = ClientServiceMethods()
clients = calls.GetAllClients()
client_dict = Client.dict(clients)

dict.

+3

Source: https://habr.com/ru/post/1673532/


All Articles