0

I have added one custom attribute as "category". It's values should be 'Sales','Support' etc. I have to retrieve only those contacts who have category as custom attributes. I tried using below code. But It is not giving the excepted results.

ContactFeed profileFeed = contactService.getFeed(new URL("https://www.google.com/m8/feeds/contacts/"+domain+"/full/?xoauth_requestor_id="+adminEmail+"&start-index="+startIndex+"&q="+searchText),ContactFeed.class); 

can anyone tell me ? Is there any way to retrieve only those contacts who have 'Category' as custom attribute.?

RBP
  • 481
  • 1
  • 9
  • 29

1 Answers1

0

Yes its possible, ive done ot before with some tricks. If you include a unique string in the properties, you can then search custom properties. For example prepend @ to all your custom properties, then search cor those properties that contain "@". Ive done this from apps script though not fhe raw http api.

Zig Mandel
  • 19,571
  • 5
  • 26
  • 36
  • where to add special character,for Custom Key or Custom value.? – RBP Oct 17 '13 at 05:15
  • In the value since it only searches values. – Zig Mandel Oct 17 '13 at 12:52
  • if you are using extended properties, you can query them with projections and use the q param to search for your special string (@ for example). Else, not sure how to do it with the http api. In Apps script you can use https://developers.google.com/apps-script/reference/contacts/contacts-app#getContactsByCustomField(Object,ExtendedField) and use the trick I told you, as in ContactsApp.getContactsByCustomField('@', 'Category'); – Zig Mandel Oct 17 '13 at 13:18