You are here

Access the connectwise API via Python

There is not a lot of documentation regarding the Connectwise API and access via SUDS. A sample connection object has been included bwelow. For further details and access to the full API documentation please fered to the developer website

from suds.client import Client
from suds.sax.element import Element
url = 'https://<cw-site-name>/v4_6_release/apis/1.5/CompanyApi.asmx?wsdl'
client = Client(url)

ApiCredentials = client.factory.create('ApiCredentials')
ApiCredentials.CompanyId = '<connectwise-company-name>'
ApiCredentials.IntegratorLoginId = '<api-integrator-username>'
ApiCredentials.IntegratorPassword = '<api-password>'

conditions = "Territory = 'XYZ'"

result = client.service.FindCompanies(ApiCredentials, conditions)

print result