How to import iCloud contacts in php

2019-03-31 20:59发布

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

标签: php icloud
1条回答
Lonely孤独者°
2楼-- · 2019-03-31 21:33

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

查看更多
登录 后发表回答