How to Use Zimbra SOAP API
by: Imam Omar mochtar
● Father of one beloved daughter and wife (for now).
● Working as IT consultant with “PALUGADA” oriented.
● Love to Code, commonly Python chosen as my swiss army knife.
● Hold several IT certiﬁcates one of them is Zimbra Admin.
What Is SOAP anyway ?
and how it related to
SOAP (Simple Object Access Protocol)
● (Old) A Web Service.
● Through HTTP and POST method to exchange the data.
● Commonly using XML for message format.
*In a glance
1. Get the token
Lifetime in milliseconds, 12 hours as default
● You can extend token lifetime by modify
● zmprov using zimbra_user and
zimbra_ldap_password for login
● We will use token for next request, if it was
expired then refetch again.
Hint: zmsoap can be useful
● Use argument -vv to print out the SOAP request and response.
● You can also change the format to JSON instead XML by argument --json.
● -z is for authenticated as admin, you can specify user & password too by -a for user
and -p for password.
● Use -t to specify the scoop / namespace, the default is admin.
● Set “as user” by using argument -m.
1. Scripting, Usecase: Bulk Set User Attributes and Renaming Account.
The sequences are:
1. Loop through csv ﬁle, ﬁrst column is existing email, the second one is new email.
2. Make sure the account is exist.
3. Rename account for prevent duplicated account while in process.
4. Add existing email as alias.
5. Set existing email in canonical address (outgoing email masking).
6. Rename account to actual new email.
Hint: Java is Fast But it Slow to Start.
It’s Fast brah ….
2. Identity and Access Management (IAM) Integration.