[turba] Managing Turba objects

Michael J Rubinsky mrubinsk at horde.org
Mon Jul 16 12:04:55 UTC 2018


Quoting Luca Bertoncello <lucabert at lucabert.de>:

> Zitat von Sebastian Birnbach <birnbacs at gmail.com>:
>
> Hi Sebastian,
>
>> I share your grief with hard-to-get Horde documentation - at large.
>> In this case, however, all the information you need seems to be readily
>> available:
>> https://fossies.org/dox/horde-groupware-5.2.22/classTurba__Api.html
>> The fossies server is of course just for showing off the doxygen tool. You
>> probably want to start with building your local documentation for whichever
>> Horde version you have.
>
> Thank you very much for your answer.
>
> Maybe can you help me again...
>
> I wrote a little test script to retrieve all contacts in an addressbook.
> Problem: I can only get some data using:
>
> $results = $registry->call('contacts/listUids', array('sources' =>  
> array('wwjt5jzQBHOo8sUGli7BkdQ')));
>
> But so I get a list of UIDs...
> Unfortunately, to get the contact data I need the "objectId", not  
> the "objectUid", and I didn't found any function to convert it or to  
> search the contacts using the UID...
> Do you have a suggestion what can I do?
>
> My little code:
>
> $results = $registry->call('contacts/listUids', array('sources' =>  
> array('wwjt5jzQBHOo8sUGli7BkdQ')));
> foreach($results as $r)
> {
>   $x = $registry->call('contacts/getContact', array('source' =>  
> 'wwjt5jzQBHOo8sUGli7BkdQ', 'objectUid' => $r));
> }
>
> What works is:
>
> $x = $registry->call('contacts/getContact', array('source' =>  
> 'wwjt5jzQBHOo8sUGli7BkdQ', 'objectId' => '29dx3S0htUR7YLA6o3cnquN'));
>
> the last parameter is the objectId of the contact, but I can't  
> "find" it using the API...


Use can use either contacts/getContacts (note the plural) to retrieve  
all contacts from a single source, OR you can use contacts/export to  
get a contact by UID - set $contentType to 'array' to retrieve a hash  
of contact properties - unless of course you want one of the other  
formats.



> Thanks for your help!
> Luca Bertoncello
> (lucabert at lucabert.de)
>
> -- 
> turba mailing list
> Frequently Asked Questions: http://wiki.horde.org/FAQ
> To unsubscribe, mail: turba-unsubscribe at lists.horde.org



-- 
mike
The Horde Project
http://www.horde.org
https://www.facebook.com/hordeproject
https://www.twitter.com/hordeproject
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-keys
Size: 9272 bytes
Desc: PGP Public Key
URL: <https://lists.horde.org/archives/turba/attachments/20180716/7819c3cc/attachment.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 821 bytes
Desc: PGP Digital Signature
URL: <https://lists.horde.org/archives/turba/attachments/20180716/7819c3cc/attachment-0001.bin>


More information about the turba mailing list