Groups keyboard shortcuts have been updated
Dismiss
See shortcuts

Portable contacts api not giving contacts in alphabetical order

288 views
Skip to first unread message

abhay kumar

unread,
Dec 14, 2011, 3:08:59 AM12/14/11
to portable...@googlegroups.com
Hi,

I am using this path to grab contacts from google after user is oauth2 authenticated.

Strangely the sortBy name is not working.

It gives:

1) First a list of unordered contacts with no order.

2) Then it gives contacts with name in alphabetical order.

I want all contact names sorted by alphabetical order.

What is the work around for this problem ?

A quick reply will be appreciated.

Joseph Smarr

unread,
Dec 14, 2011, 1:21:39 PM12/14/11
to portable...@googlegroups.com
Have you tried sortBy=displayName?

--
You received this message because you are subscribed to the Google Groups "PortableContacts" group.
To view this discussion on the web visit https://groups.google.com/d/msg/portablecontacts/-/JjQG3KvBpOgJ.
To post to this group, send email to portable...@googlegroups.com.
To unsubscribe from this group, send email to portablecontac...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/portablecontacts?hl=en.

abhay kumar

unread,
Dec 15, 2011, 1:48:20 AM12/15/11
to portable...@googlegroups.com, jsm...@stanfordalumni.org
Yes I tried sortBy = displayName also.


It's giving some random order.
looking at the data I guess it's giving default sort i.e. sort by relevency .

Thanks
Abhay

Joseph Smarr

unread,
Dec 15, 2011, 1:51:38 AM12/15/11
to portable...@googlegroups.com, jsm...@stanfordalumni.org

Might just not be implemented, but according to the spec, it should at least respond with sorted: false (did it?). Lemme see what I can do...

abhay kumar

unread,
Dec 15, 2011, 1:59:58 AM12/15/11
to portable...@googlegroups.com, jsm...@stanfordalumni.org
I analyzed the data i am receiving from google for this url:
1) There are a few emails which user do not define the name for, they are by default taken by Gmail as their username. Ex: jos...@gmail.com becomes jospeh.

2) During fetching of contacts with sortBy=name, this list comes first. Then it gives alphabetical order list. 

Let me know if it helps.


Joseph Smarr

unread,
Dec 15, 2011, 12:57:43 PM12/15/11
to portable...@googlegroups.com
Ah, I bet it thinks the name is empty-string so it sorts it to the top. I will investigate and file a bug, thanks for the report! :)

abhay kumar

unread,
Dec 15, 2011, 1:27:02 PM12/15/11
to PortableContacts
Let me know when it's fixed!

Abhay
Senior Software Engineer
www.fab.com

On Dec 15, 12:57 pm, Joseph Smarr <jsm...@gmail.com> wrote:
> Ah, I bet it thinks the name is empty-string so it sorts it to the top. I
> will investigate and file a bug, thanks for the report! :)
>
>
>
>
>
>
>
> On Wed, Dec 14, 2011 at 10:59 PM, abhay kumar <abhay...@gmail.com> wrote:
> > I analyzed the data i am receiving from google for this url:
>

> >http://www-opensocial.**googleusercontent.com/api/**
> > people/@me/@all/?count=500&**fields=name,displayName,**emails&sortBy=name<http://www-opensocial.googleusercontent.com/api/people/@me/@all/?coun...>

Reply all
Reply to author
Forward
0 new messages