Scaling API-first – The story of a global engineering organization
Kopdar Zimbra-ID , How to use Zimbra SOAP API
1. How to Use Zimbra SOAP API
by: Imam Omar mochtar
kopdarZimbraID#1
31-08-2019 @kedaiJadoel
2. > whoami
● 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 certificates one of them is Zimbra Admin.
3. What Is SOAP anyway ?
and how it related to
Zimbra ?
4. 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
11. 3. Get SOAP End Point
● Admin namespace
https://[SERVER]/:7071/service/admin/soap
● Non admin namespace
https://[SERVER]/service/soap
Under the hood
14. 1. Get the token
Request
Response
Login
Token
Lifetime in milliseconds, 12 hours as default
Namespace
Note:
● You can extend token lifetime by modify
zimbraAdminAuthTokenLifetime
● zmprov using zimbra_user and
zimbra_ldap_password for login
● We will use token for next request, if it was
expired then refetch again.
18. Hint: zmsoap can be useful
Note:
● 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.
21. 1. Scripting, Usecase: Bulk Set User Attributes and Renaming Account.
The sequences are:
1. Loop through csv file, first 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.
22. Hint: Java is Fast But it Slow to Start.
It’s Fast brah ….