contacts API example with curl, and no ZEND

776 views
Skip to first unread message

Sebastian

unread,
Aug 14, 2009, 10:22:04 AM8/14/09
to Google Contacts API
Hi,

My ISP doesn't handle ZEND, and I'm stocked, I can't manage to see the
public contacts. I pass the point of getting the token back.

could someone post a little example?

Thanks
Sebastian

Julian (Google)

unread,
Aug 14, 2009, 10:30:42 AM8/14/09
to Google Contacts API
Hi,

You can use cURL to make calls to the Contacts API Protocol directly:
http://code.google.com/apis/contacts/docs/3.0/developers_guide_protocol.html

Maybe this old thread can help:
http://groups.google.com/group/google-contacts-api/browse_thread/thread/f6dcf92775f8549/9dc962ddd20af598

Cheers,
Julian.

sebastian de comocomo

unread,
Aug 15, 2009, 7:58:58 AM8/15/09
to google-co...@googlegroups.com
Hi Julian,

I click to get the token:

https://www.google.com/accounts/AuthSubRequest?scope=http%3A%2F%2Fwww.google
.com%2Fm8%2Ffeeds%2F&session=1&secure=0&next=http%3A%2F%2Fallmybookings.com/
viewcontacts.php&hd=default

The token sends me to this site, I specified:

http://allmybookings.com/viewcontacts.php?token=CK3iteHqChDYwMin-_____8B

Which has this code:

http://paste-it.net/public/wba38a6/

I get a white page,

I can't use ZEND, only curl.

If possible, I'd like to get peole, withough token. Like if I was browsing
through facebook, finding friends, is this possible?

What am I doing wrong?

Thanks
Sebastian

Julian (Google)

unread,
Aug 17, 2009, 8:41:15 AM8/17/09
to Google Contacts API
Hi Sebastian,

Here is an example of AuthSub using Libcurl:
http://gdatatips.blogspot.com/2008/07/authsub-using-phps-libcurl.html

You should use Client Login or AuthSub, I see both in your code. For
Google accounts that are not in Google Apps you need the AuthSub token
to get authorization from the user.

--Julian


On Aug 15, 12:58 pm, sebastian de comocomo <sebast...@comocomo.com>
wrote:
> Hi Julian,
>
> I click to get the token:
>
> https://www.google.com/accounts/AuthSubRequest?scope=http%3A%2F%2Fwww...
> .com%2Fm8%2Ffeeds%2F&session=1&secure=0&next=http%3A%2F%2Fallmybookings.com/
> viewcontacts.php&hd=default
>
> The token sends me to this site, I specified:
>
> http://allmybookings.com/viewcontacts.php?token=CK3iteHqChDYwMin-_____8B
>
> Which has this code:
>
> http://paste-it.net/public/wba38a6/
>
> I get a white page,
>
> I can't use ZEND, only curl.
>
> If possible, I'd like to get peole, withough token. Like if I was browsing
> through facebook, finding friends, is this possible?
>
> What am I doing wrong?
>
> Thanks
> Sebastian
>
> On 14/08/09 16:30, "Julian (Google)" <j...@google.com> wrote:
>
>
>
> > Hi,
>
> > You can use cURL to make calls to the Contacts API Protocol directly:
> >http://code.google.com/apis/contacts/docs/3.0/developers_guide_protoc...
>
> > Maybe this old thread can help:
> >http://groups.google.com/group/google-contacts-api/browse_thread/thre...

sebastian de comocomo

unread,
Aug 17, 2009, 11:35:48 AM8/17/09
to google-co...@googlegroups.com
Hi Julian,

I copy paste the code you sent me,

However, it's requesting access to Google Calendar, instead of to Contacts.

I grant access any how, and then I get this:

Single use token: CK3iteHqChD5j6L5-f____8B Session token:
CK3iteHqChClufOg_f____8B

Shouldn't I get my contacts?

Thanks
Sebastian

Julian (Google)

unread,
Aug 19, 2009, 6:36:11 AM8/19/09
to Google Contacts API
Hi,

You should use set the Scope according to the service you want to
access.

--Julian.

On Aug 17, 4:35 pm, sebastian de comocomo <sebast...@comocomo.com>

sebastian de comocomo

unread,
Aug 24, 2009, 7:59:35 AM8/24/09
to google-co...@googlegroups.com
Perfect,

I changed the spope to m8 (= contacts).

But I can't get passed this message, in curl?

Single use token: CK3iteHqChChy4LkAQ Session token: CK3iteHqChDU9OjHAw

How do I get public contacts info?

Thanks
Sebastian


On 19/08/09 12:36, "Julian (Google)" <j...@google.com> wrote:

>
> Hi,
>
Reply all
Reply to author
Forward
0 new messages