How to import iCloud contacts in php

2019-03-31 21:46发布

问题:

How to import contacts from iCloud using a iCloud API or any other method which use PHP as server side language. I know there iCloud support cardDav through which we can import iCloud contacts but how? it still a question for me

If any one have an idea it will be very helpful

回答1:

iCloud support cardDAV client/server protocol through which we can make a request to iCloud server and get the saved contacts from iCloud.

To implement cardDAV client/server protocol one need to use third party API and there is very useful and easy to use API available to accomplished this task using Roundcube-CardDAV you can download this library using this link.

To use Roundcube-CardDAV you need to use PEAR.php file.

RoundCube-CardDAV returns contacts in Vcard format so need to parse it also which can be done using Contact_Vcard_Parse class found by here.

You also need iCloud server on which you would make request so it is https://p01-contacts.icloud.com/1603801586/carddavhome/card/ where p01 is server number goes further like p02,p03,p04...p06 etc



标签: php icloud