Change Account status

Have a great idea for extending Zimbra? Share ideas, ask questions, contribute, and get feedback.
Post Reply
zimbrauser20
Posts: 2
Joined: Fri May 28, 2021 11:54 am

Change Account status

Post by zimbrauser20 »

Hi,
I am using ZCS SOAP API 8.6.0 for creating accounts in Zimbra.
Is it possible to implement changing account's status in "Closed"?
Thanks,
Iulia
zimbrauser20
Posts: 2
Joined: Fri May 28, 2021 11:54 am

Re: Change Account status (Resolved)

Post by zimbrauser20 »

I found the answer to my question :D

I can change the account status using the ModifyAccount method and the zimbraAccountStatus attribute.
This is how i form the soap message in c# for the request.

Code: Select all

string retVal = string.Format(
	@"<soapenv:Envelope xmlns:soapenv=""http://schemas.xmlsoap.org/soap/envelope/""
			xmlns:urn=""urn:zimbra"" xmlns:urn1=""urn:zimbraAdmin"">
		<soapenv:Header>
				<urn:context>
				<urn:authToken>{0}</urn:authToken>
			</urn:context>
		</soapenv:Header>
		<soapenv:Body>
			<urn1:ModifyAccountRequest id=""{1}"">
				<urn1:a n=""zimbraAccountStatus"">{2}</urn1:a>
			</urn1:ModifyAccountRequest>
		</soapenv:Body>
	</soapenv:Envelope>",
	authToken, account, newStatus);
Here is a list with the attributes in ZCS.
https://wiki.zimbra.com/wiki/Zimbra_Attributes_ZCS6

I posted the solution in case somebody else needs it.
Post Reply