2
https://www.google.com/m8/feeds/groups/default/full/6

これにより、システムグループの[マイ連絡先]内のすべての連絡先のリストが返されますが、「グループが見つかりません」と表示されます。

すべての連絡先グループのリストを要求すると、ユーザー定義のグループのみが返されます。

すべての連絡先のリストをリクエストすると、すべての連絡先が表示されますが、ユーザー定義のグループでない限り、どのグループに属しているかはわかりません。

私が間違っていることについて何か考えはありますか?

編集:ここにリダイレクトします

https://accounts.google.com/o/oauth2/auth?client_id=819467938951.apps.googleusercontent.com&redirect_uri=http://subomain.website.com/back.html&scope=https://www.google.com/m8/feeds/&response_type=code

そしてこれがback.htmlのソースです(http://php.dzone.com/news/execute-http-post-using-php-cuから変更)

<?php
$token = $_GET["code"];

$url = 'https://accounts.google.com/o/oauth2/token';
$fields = array(
        'code'=>urlencode($token),
        'client_id'=>urlencode("819467938951.apps.googleusercontent.com"),
        'client_secret'=>urlencode("secret key"),
        'redirect_uri'=>urlencode("http://subdomain.website.com/back.html"),
        'grant_type'=>urlencode("authorization_code")
    );

//url-ify the data for the POST
foreach($fields as $key=>$value) { $fields_string .= $key.'='.$value.'&'; }
rtrim($fields_string,'&');

//open connection
$ch = curl_init();

//set the url, number of POST vars, POST data
curl_setopt($ch,CURLOPT_URL,$url);
curl_setopt($ch,CURLOPT_POST,count($fields));
curl_setopt($ch,CURLOPT_POSTFIELDS,$fields_string);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);


//execute post
$result = curl_exec($ch);

//close connection
curl_close($ch);

$result=json_decode($result, true);

$access_token = $result["access_token"];

print_r(file_get_contents("https://www.google.com/m8/feeds/groups/default/full/6?access_token=" . $access_token));
?>
4

1 に答える 1

4

PHP のグループからすべての連絡先を取得する

v=2 に設定すると、システム グループが表示されました。

https://www.google.com/m8/feeds/groups/default/full?v=2

グループ内の連絡先を取得するには、group = グループの URL を設定します

https://www.google.com/m8/feeds/contacts/default/full?v=2&group=http://www.google.com/m8/feeds/groups/default/base/6
于 2011-08-29T09:29:01.120 に答える