Quantcast
Channel: Zimbra Forums
Viewing all articles
Browse latest Browse all 174

Developers • Re: Zimbra API for Admin Error

$
0
0
Hi,

In order to create an account using zimbra soap APIs, you would first need to send a request to fetch zimbra Admin Auth token.
Refer the below XML request packet, you would need to create the same packet and send the request to
https://domain.com:7071/service/admin/soap/

Add the {zimbraAdminAccount} / {zimbraAdminAccount Password} as per your configuration below

Code:

<soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope">  <soap:Header>    <context xmlns="urn:zimbra">      <nosession/>      <userAgent name="" version=""/>      <authTokenControl voidOnExpired="0"/>    </context>  </soap:Header>  <soap:Body>    <AuthRequest xmlns="urn:zimbraAdmin">      <name>{zimbraAdminAccount}</name>      <password>{zimbraAdminAccount Password}</password>    </AuthRequest>  </soap:Body></soap:Envelope>
In Response to the above, you would get an authToken which you can use to create an account.

To Create an Account, again send the request to, https://domain.com:7071/service/admin/soap/ OR you can sent it to "service/admin/soap/CreateAccountRequest"

Code:

<soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope">  <soap:Header>    <context xmlns="urn:zimbra">      <authToken>{authToken Received} </authToken>      <nosession/>      <userAgent name="" version=""/>      <authTokenControl voidOnExpired="1"/>    </context>  </soap:Header>  <soap:Body>    <CreateAccountRequest password="test123" name="test3@xvz.com" xmlns="urn:zimbraAdmin"/>  </soap:Body></soap:Envelope>
There are multiple parameters that you can add to the request, you can refer to AuthRequest / CreateAccount in the API documentation available here. https://files.zimbra.com/docs/soap_api/ ... index.html

Hope this helps.

Best Regards

Statistics: Posted by tarun.mishra — Wed Aug 02, 2023 11:01 am



Viewing all articles
Browse latest Browse all 174

Trending Articles