如何在php中导入iCloud联系人 [英] How to import iCloud contacts in php
问题描述
如何使用iCloud API或任何其他使用PHP作为服务器端语言的方法从iCloud导入联系人.我知道有iCloud支持cardDav,通过它我们可以导入iCloud联系人,但是如何?这对我来说仍然是一个问题
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
推荐答案
iCloud支持cardDAV客户端/服务器协议,通过该协议我们可以向iCloud服务器发出请求并从iCloud获取保存的联系人.
iCloud support cardDAV client/server protocol through which we can make a request to iCloud server and get the saved contacts from iCloud.
要实现cardDAV客户端/服务器协议,您需要使用第三方API,并且可以使用 Roundcube-CardDAV 使用非常有用且易于使用的API来完成此任务,您可以使用此链接.
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.
要使用 Roundcube-CardDAV ,您需要使用 PEAR.php 文件.
To use Roundcube-CardDAV you need to use PEAR.php file.
RoundCube-CardDAV返回Vcard格式的联系人,因此也需要使用
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.
您还需要在其上进行请求的iCloud服务器,因此它是 https://p01-contacts.icloud.com/1603801586/carddavhome/card/ ,其中p01是服务器编号,例如p02,p03,p04 ... p06等
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联系人的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!