-->

import contacts from gmail/hotmail/yahoo to php

2019-05-10 07:11发布

问题:

i would like to import contacts from gmail/hotmail/yahoo to my php applications just like those found in social network.

i've read how gmail does it but im still not very clear about it. it says i would need to do a http request like this https://www-opensocial.googleusercontent.com/api/people/@me/@self

but how should i send this info?? i tried running this on the browser and it returns "Cannot make anonymous request without explicit user ID in the URL" so how can i pass the correct user ID then??

for yahoo, the Yahoo! Address Book API is deprecated and now we should use Contacts API. have anyone use this b4??

回答1:

It looks like that URL corresponds to osapi.people, which suggests that you can replace the token @me with a profile name.

I verified this by visiting that URL and replacing the @me with my own Google login.

The JSON-RPC documentation suggests that you can replace the @self token with @friends to get a friend list, assuming the application making the request is authorized to pull down this data.

Unfortunately this is all I know, discovered through a few minutes in Google finding the docs.



回答2:

import user contacts form google, yahoo, and AOL in php check here. It explains how one can register for OAuth 2.0 and download contacts from google