5

I cannot seem to get a search of Google Contacts using a query parameter to work.

I can successfully authenticate the user, get a list of Contacts Groups, and get a list of contacts within a group, but cannot get a search to work.

From the documentation, I'd assume that my URI would have to look something like this to do a search for "tracy" in the default user's contacts (assuming I've already been authenticated via OAuth2):

https://www.google.com/m8/feeds/default/full?q=tracy

However, I get a "Bad Request" response (_rc = 400)

I suppose that I could download all the contacts and then do the search myself, but I can't imagine there's no way for GOOGLE(!) to do this search on the server.

Any help greatly appreciated! Thanks!

threecee
  • 53
  • 4

2 Answers2

17

I ran into a similar problem with the q parameter being ignored. I had to add version parameter, v=3.0, for the q to be recognized as illustrated by this post.

Your full URL should be:

https://www.google.com/m8/feeds/contacts/default/full?q=tracy&v=3.0

Note the corrected URL as mentioned by Blake O.

For my use, I also added the access_token parameter that I get after gapi.auth.authorize from the Google API Client JS library

Foo L
  • 10,977
  • 8
  • 40
  • 52
1

Bad URL.

www.google.com/m8/feeds/contacts/default/full?q=tracy

Blake O'Hare
  • 1,863
  • 12
  • 16
  • 1
    DOH! you're right. i figured this out myself sometime ago. it's crazy how many times one can look at code and JUST.NOT.SEE.ERRORS. thanks! – threecee Aug 08 '14 at 03:37