{"id":1009,"date":"2022-08-30T15:10:52","date_gmt":"2022-08-30T15:10:52","guid":{"rendered":"https:\/\/unknownerror.org\/index.php\/2013\/11\/09\/list-contacts-from-a-group-from-zend-gdata-collection-of-common-programming-errors\/"},"modified":"2022-08-30T15:10:52","modified_gmt":"2022-08-30T15:10:52","slug":"list-contacts-from-a-group-from-zend-gdata-collection-of-common-programming-errors","status":"publish","type":"post","link":"https:\/\/unknownerror.org\/index.php\/2022\/08\/30\/list-contacts-from-a-group-from-zend-gdata-collection-of-common-programming-errors\/","title":{"rendered":"List Contacts from a group from Zend GData-Collection of common programming errors"},"content":{"rendered":"<p>and thanks for reading.<\/p>\n<p>My problem is that I&#8217;m trying to get a list of contacts belonging to a group in GData using Zend_Gdata_Query.<\/p>\n<p>Using<\/p>\n<pre><code>$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');\n$feed = $gdata-&gt;getFeed($query);\n<\/code><\/pre>\n<p>give me an &#8220;Unknown authorization header&#8221;.<\/p>\n<pre><code>$query = new Zend_Gdata_Query('http:\/\/www.google.com\/m8\/feeds\/contacts\/default\/full\/');\n$query-&gt;setParam('group', 'http:\/\/www.google.com\/m8\/feeds\/groups\/XXX...XXX\/base\/XXX');\n$feed = $gdata-&gt;getFeed($query);\n<\/code><\/pre>\n<p>is the same.<\/p>\n<p>Obviously without that parameter I get all the contacts.<\/p>\n<p>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.<\/p>\n<p>Thanks for any help.<\/p>\n<ol>\n<li>\n<pre><code>$query-&gt;setParam('group', 'http:\/\/www.google.com\/m8\/feeds\/groups\/myemail%40gmail.com\/base\/xxxxxxxxxxxxxx');\n<\/code><\/pre>\n<p>xxxxxxxxxxxxxx = group ID<\/p>\n<\/li>\n<li>\n<p>I guess you are using 3-legged OAuth. Then you need to add next line before getFeed() called: $gdata-&gt;getHttpClient()-&gt;setRequestScheme(Zend_Oauth::REQUEST_SCHEME_QUERYSTRING); It will solve &#8220;Unknown authorization header&#8221; error.<\/p>\n<p>For me using $query-&gt;setParam(&#8216;group&#8217;, &#8216;http:\/\/www.google.com\/m8\/feeds\/groups\/XXX&#8230;XXX\/base\/XXX&#8217;); returns another error: &#8220;Invalid value for group parameter: XXXXXXXXXX&#8221; and I still dunno how to fix it \ud83d\ude41<\/p>\n<\/li>\n<\/ol>\n<p id=\"rop\"><small>Originally posted 2013-11-09 23:13:06. <\/small><\/p>","protected":false},"excerpt":{"rendered":"<p>and thanks for reading. My problem is that I&#8217;m trying to get a list of contacts belonging to a group in GData using Zend_Gdata_Query. Using $query = new Zend_Gdata_Query(&#8216;http:\/\/www.google.com\/m8\/feeds\/contacts\/default\/full\/?group=http:\/\/www.google.com\/m8\/feeds\/groups\/xxx&#8230;xxx\/base\/XXX&#8217;); $feed = $gdata-&gt;getFeed($query); give me an &#8220;Unknown authorization header&#8221;. $query = new Zend_Gdata_Query(&#8216;http:\/\/www.google.com\/m8\/feeds\/contacts\/default\/full\/&#8217;); $query-&gt;setParam(&#8216;group&#8217;, &#8216;http:\/\/www.google.com\/m8\/feeds\/groups\/XXX&#8230;XXX\/base\/XXX&#8217;); $feed = $gdata-&gt;getFeed($query); is the same. Obviously without that parameter I [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-1009","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/1009","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/comments?post=1009"}],"version-history":[{"count":0,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/1009\/revisions"}],"wp:attachment":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/media?parent=1009"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/categories?post=1009"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/tags?post=1009"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}