Results 1 to 7 of 7

Thread: Delete an account via SOAP, how to find zimbraId ?

  1. #1
    Join Date
    May 2011
    Posts
    13
    Rep Power
    4

    Default Delete an account via SOAP, how to find zimbraId ?

    Hi,

    I have been able to successfully add an account via SOAP and I am now looking to delete one. However, I need the zimbraId to do that and can't find how to get this id via SOAP. Is there any other way to find it than the command line?

    Thanks

  2. #2
    Join Date
    Dec 2006
    Location
    Minneapolis MN
    Posts
    777
    Rep Power
    9

    Default

    You can get it with GetAccountRequest
    01 Networks, LLC / Cybernetik.net
    Zimbra NE and OSS Cloud Hosting
    Shared Web Hosting
    Consulting Services

  3. #3
    Join Date
    Apr 2012
    Posts
    29
    Rep Power
    3

    Default

    When using Java API, how do I get zimbraId?

    I also use SoapProvisioning, but can't find it...

    In the code:
    Account c = sp.getAccountByName("account@domain");

    Inspecting "c" variable above in Eclipse IDE, I can see that there's an attribute called "mID" which seems to be zimbraId, but which method from Account class get this value? I tried getId() but it is blank, getUid() is from the email adress,... just don't know!

  4. #4
    Join Date
    Nov 2008
    Location
    Grand Rapids, MI
    Posts
    123
    Rep Power
    7

    Default

    Quote Originally Posted by Roger75 View Post
    When using Java API, how do I get zimbraId?
    The XML you would need to send is:
    Code:
    <GetAccountRequest attrs="zimbraId" xmlns="urn:zimbraAdmin">
      <account by="name">address@domain.tld</account>
    </GetAccountRequest>
    The trick here is passing the attrs= attribute to tell it you want the zimbraId, although from the response output, I'm guessing you probably get that back with every request anyway as the id= attribute of the account object in the response.

    The above will give you back something like this:
    Code:
    <GetAccountResponse xmlns="urn:zimbraAdmin">
      <account id="53738983-181d-44a0-baec-26ddbc224d54" name="address@domain.tld">
        <a n="zimbraId">53738983-181d-44a0-baec-26ddbc224d54</a>
      </account>
    </GetAccountResponse>

  5. #5
    Join Date
    Apr 2012
    Posts
    29
    Rep Power
    3

    Default

    Quote Originally Posted by justdave View Post
    The XML you would need to send is:
    Code:
    <GetAccountRequest attrs="zimbraId" xmlns="urn:zimbraAdmin">
      <account by="name">address@domain.tld</account>
    </GetAccountRequest>
    The trick here is passing the attrs= attribute to tell it you want the zimbraId, although from the response output, I'm guessing you probably get that back with every request anyway as the id= attribute of the account object in the response.

    The above will give you back something like this:
    Code:
    <GetAccountResponse xmlns="urn:zimbraAdmin">
      <account id="53738983-181d-44a0-baec-26ddbc224d54" name="address@domain.tld">
        <a n="zimbraId">53738983-181d-44a0-baec-26ddbc224d54</a>
      </account>
    </GetAccountResponse>
    But using the Java API, getId method from Account class is returning an empty value:

    Account c = sp.getAccountByName("address@domain.tld");
    String id=c.getId(); // this is returning a blank string!!

    So I can't get zimbraId!
    Is it a problem from SoapProvisioning API?
    What's the other way to send the XML you showed above using Java?

  6. #6
    Join Date
    Nov 2008
    Location
    Grand Rapids, MI
    Posts
    123
    Rep Power
    7

    Default

    I haven't ever done it from Java so hopefully someone else can step in and help here. I've always done it from Perl, or using the zmsoap commandline tool.

  7. #7
    Join Date
    Apr 2012
    Posts
    29
    Rep Power
    3

    Default

    Quote Originally Posted by justdave View Post
    I haven't ever done it from Java so hopefully someone else can step in and help here. I've always done it from Perl, or using the zmsoap commandline tool.
    Please, how do you send the xml request using perl? Could you show the command line?

Similar Threads

  1. Deleting account from cli does not delete mailbox?
    By momohteks in forum Administrators
    Replies: 8
    Last Post: 02-03-2012, 09:36 AM
  2. [SOLVED] Can't delete domains with wiki account
    By lindworm in forum Administrators
    Replies: 13
    Last Post: 04-08-2011, 03:40 PM
  3. zmzimletctl deploy zimbra_posixaccount.zip - ERROR -
    By todd_dsm in forum Administrators
    Replies: 0
    Last Post: 04-02-2009, 02:41 PM
  4. Replies: 8
    Last Post: 04-21-2007, 11:29 PM
  5. Delete Account (zcs-3.0.0_M3_436a.FC3)
    By chanck in forum Installation
    Replies: 2
    Last Post: 01-17-2006, 06:26 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •