Change Account status

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

Change Account status

Postby zimbrauser20 » Fri May 28, 2021 2:29 pm

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)

Postby zimbrauser20 » Fri Jun 04, 2021 1:30 pm

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.

Return to “Developers”

Who is online

Users browsing this forum: No registered users and 2 guests