Check an account

Have a great idea for extending Zimbra? Share ideas, ask questions, contribute, and get feedback.
kalop
Posts: 2
Joined: Wed Jan 23, 2019 4:40 pm

Check an account

Postby kalop » Wed Jan 23, 2019 4:51 pm

I'm trying to get the status from an accont: zimbraAccountStatus but I don't know how to do it with soap.

I'm able to change the value with "ModifyAccountRequest" and set it to active, maintenance, closed or locked. However, I don't know how to check it.

Any help is welcome!


kalop
Posts: 2
Joined: Wed Jan 23, 2019 4:40 pm

Re: Check an account

Postby kalop » Thu Jan 24, 2019 8:05 am

I've found the solution:
You have to do a GetAccountRequest with attrs="zimbraAccountStatus" like this:

Code: Select all

<?xml version="1.0" ?><soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope">
<soap:Header><context xmlns="urn:zimbra"><format type="xml"/><authToken>%s</authToken>
</context></soap:Header><soap:Body>
<GetAccountRequest applyCos="1" attrs="zimbraAccountStatus" xmlns="urn:zimbraAdmin">
<account by="name">%s</account>
</GetAccountRequest>
</soap:Body></soap:Envelope>' % (self.TOKEN, account)

Return to “Developers”

Who is online

Users browsing this forum: No registered users and 3 guests