列出 Zend GData 组中的联系人

发布于 2024-09-04 18:22:02 字数 734 浏览 18 评论 0原文

感谢您的阅读。

我的问题是我正在尝试使用 Zend_Gdata_Query 获取属于 GData 中某个组的联系人列表。

使用

$query = new Zend_Gdata_Query('http://www.google.com/m8/feeds/contacts/default/full/?group=http://www.google.com/m8/feeds/groups/xxx...xxx/base/XXX');
$feed = $gdata->getFeed($query);

给我一个“未知的授权标头”。

$query = new Zend_Gdata_Query('http://www.google.com/m8/feeds/contacts/default/full/');
$query->setParam('group', 'http://www.google.com/m8/feeds/groups/XXX...XXX/base/XXX');
$feed = $gdata->getFeed($query);

是一样的。

显然,如果没有该参数,我就可以获得所有联系人。

我已经尝试使用 URL 中的参数和对 CakePHP 核心 HttpSocket 的修改扩展的第一种方法,并且它正在工作。所以我想问题出在 Zend 从 url 中删除参数,但我没有运气查看这些库。

感谢您的任何帮助。

and thanks for reading.

My problem is that I'm trying to get a list of contacts belonging to a group in GData using Zend_Gdata_Query.

Using

$query = new Zend_Gdata_Query('http://www.google.com/m8/feeds/contacts/default/full/?group=http://www.google.com/m8/feeds/groups/xxx...xxx/base/XXX');
$feed = $gdata->getFeed($query);

give me an "Unknown authorization header".

$query = new Zend_Gdata_Query('http://www.google.com/m8/feeds/contacts/default/full/');
$query->setParam('group', 'http://www.google.com/m8/feeds/groups/XXX...XXX/base/XXX');
$feed = $gdata->getFeed($query);

is the same.

Obviously without that parameter I get all the contacts.

I already tried the first method with the parameter in the URL with a modified Extension to CakePHP core HttpSocket and it was working. So I suppose the problem is with Zend stripping out parameters from the url but I had no luck looking at the libraries.

Thanks for any help.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

染墨丶若流云 2024-09-11 18:22:02
$query->setParam('group', 'http://www.google.com/m8/feeds/groups/myemail%40gmail.com/base/xxxxxxxxxxxxxx');

xxxxxxxxxxxxxxx = 组 ID

$query->setParam('group', 'http://www.google.com/m8/feeds/groups/myemail%40gmail.com/base/xxxxxxxxxxxxxx');

xxxxxxxxxxxxxx = group ID

本宫微胖 2024-09-11 18:22:02

如上所述,如果将最大结果添加到查询字符串中,则它也会起作用,如下所示:
http://www.google.com/m8/feeds /contacts/default/full?max-results=1000

请注意,即使在 Google 文档中,获取所有结果的唯一方法也是为返回的结果数“设置一个较高的数字”。所以你永远不能明确指定“ALL”

As above the max-results also works if you add it to the query string like so:
http://www.google.com/m8/feeds/contacts/default/full?max-results=1000

Note that even in the google documentation the only way of getting ALL results is by 'setting a high number' for the number of results returned. So you can never explicitly specify 'ALL'

陌路黄昏 2024-09-11 18:22:02

我猜你正在使用 3 足 OAuth。然后您需要在调用 getFeed() 之前添加下一行:
$gdata->getHttpClient()->setRequestScheme(Zend_Oauth::REQUEST_SCHEME_QUERYSTRING);
它将解决“未知授权标头”错误。

对我来说使用
$query->setParam('group', ' http://www.google.com/m8/feeds/groups/XXX...XXX/base/XXX');
返回另一个错误:“组参数值无效:XXXXXXXXXXXX”,我仍然不知道如何修复它:(

I guess you are using 3-legged OAuth. Then you need to add next line before getFeed() called:
$gdata->getHttpClient()->setRequestScheme(Zend_Oauth::REQUEST_SCHEME_QUERYSTRING);
It will solve "Unknown authorization header" error.

For me using
$query->setParam('group', 'http://www.google.com/m8/feeds/groups/XXX...XXX/base/XXX');
returns another error: "Invalid value for group parameter: XXXXXXXXXX" and I still dunno how to fix it :(

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文