Last active
August 29, 2015 14:20
-
-
Save VerosK/bf51f96c26acb1ac0962 to your computer and use it in GitHub Desktop.
Connect to zimbra with SOAP
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
from pythonzimbra.tools import auth | |
from pythonzimbra.communication import Communication | |
SOAP_URL = 'https://zimbra.random.eu/service/soap/' | |
SOAP_ADMIN_URL = 'https://zimbra.random.eu:7071/service/admin/soap/' | |
USER = 'admin' | |
PASSWORD = 'password' | |
comm = Communication(SOAP_URL) | |
token =auth.authenticate( | |
SOAP_URL, USER, PASSWORD, | |
use_password=True, raise_on_error=True | |
) | |
print token | |
admin_comm = Communication(SOAP_ADMIN_URL) | |
admin_token =auth.authenticate( | |
SOAP_URL, USER, PASSWORD, | |
admin_auth=True, | |
use_password=True, raise_on_error=True, | |
) | |
print admin_token |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment