views:

366

answers:

4

Hi, 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.

A: 

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 :(

Eugen
Your solution worked (I set a setMaxResults(10))!Many thanks!As you I need to pull a group too: I'll keep you updated.
Paolo
Same problem here with setParam('group', ... ).
Paolo
A workaround is putting the query param in the URL:$query = new Zend_Gdata_Query('http://www.google.com/m8/feeds/contacts/default/full?group=http://www.google.com/m8/feeds/groups/[email protected]/base/s0mething');
Paolo
A: 

Thanks, Paolo! :) Putting "group" parameter into query string solved my problem! :)

Eugen
A: 

I;m having trouble with this as well and agree that it seems to be with zend but the proclaimed fixes do not seem to work for me, and i am left still returning only 25 results every-time.

thanks.

benjaminlotan
I cannot get the max-results param to work? and i tried the things the two of you mentioned. :-(
benjaminlotan
A: 

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'