Connecting to the SOAP API using Python
Use the connection to the SOAP API to test your calls and perform various tasks, such as sending email and retrieving tracking information.
Download both the latest version of Python Python and the Zolera SOAP infrastructure and follow the appropriate instructions to install the service on your computer. Marketing Cloud also provides a full Python SDK for use in connecting your environment and developing your projects:
Generating Client Stubs
Use the wsdl2py tool to generate Python stubs based on the Marketing Cloud WSDL.
When generating stubs for a service called PartnerAPI, the tool generates the necessary files using the command below:
Use the client.py script below to generate the Python stubs, add security headers, and sends and receives a SOAP message by calling the PersonServices's getEmail() method. You must modify this code to interact with the SOAP API.
Use the following command to run the client: