Zimbra PHP API!!

Have a great idea for extending Zimbra? Share ideas, ask questions, contribute, and get feedback.
Jhonmicky
Posts: 31
Joined: Tue Aug 06, 2019 7:38 pm

Zimbra PHP API!!

Postby Jhonmicky » Tue Nov 05, 2019 1:27 am

Using https://github.com/zimbra-api/zimbra-api/

Successfully querying and getting data back using the api just don't know how use the data being passed back... can someone post an example of how I should be using data passed back from the response.fedloan irs.gov easybib


User avatar
rcardozo1987
Posts: 23
Joined: Tue Sep 10, 2019 9:14 pm
ZCS/ZD Version: NETWORK edition, Patch 8.8.15_P11

Re: Zimbra PHP API!!

Postby rcardozo1987 » Tue Aug 18, 2020 12:16 pm

Jhonmicky wrote:Using https://github.com/zimbra-api/zimbra-api/

Successfully querying and getting data back using the api just don't know how use the data being passed back... can someone post an example of how I should be using data passed back from the response.fedloan irs.gov easybib


Jhonmicky, it seems you need some help with PHP... not Zimbra... right?
User avatar
barrydegraaff
Zimbra Employee
Zimbra Employee
Posts: 95
Joined: Tue Jun 17, 2014 3:31 am
Contact:

Re: Zimbra PHP API!!

Postby barrydegraaff » Thu Sep 03, 2020 7:40 am

After setting up the php soap as described in https://github.com/zimbra-api/zimbra-api/ it can be used like so:

Code: Select all

<?php

ini_set('display_errors', 1);
ini_set('display_startup_errors', 1);
error_reporting(E_ALL);

// This file is generated by Composer
require_once 'zimbra-api/vendor/autoload.php';

$api = \Zimbra\Admin\AdminFactory::instance('https://zimbra.EXAMPLE.COM:7071/service/admin/soap');
$api->auth('soapapi', 'YOUR ADMIN PASSWORD HERE');
$account = new \Zimbra\Struct\AccountSelector(\Zimbra\Enum\AccountBy::NAME(), 'soapapi');
$accountInfo = $api->getAccountInfo($account);

print_r($accountInfo);

phpinfo();
--
Barry de Graaff
Admin of Zimbra-Community Github: https://github.com/orgs/Zimbra-Community/
Developer of Zimbra OpenPGP Zimlet, Zimbra ownCloud Zimlet and more.
A Zetalliance Founder http://www.zetalliance.org/

Return to “Developers”

Who is online

Users browsing this forum: No registered users and 4 guests