add contact to gmail contacts via script

1,597 views
Skip to first unread message

swoop80

unread,
Jan 3, 2009, 1:49:34 PM1/3/09
to Google Contacts API
HI. I know that this is possible, but I really don't know "how" to
achieve it...

I have some PHP5 scripts on my Linux website now - and they work just
fine. I also have the cURL extension available.

In a new script I will write, I want to take a email address and place
that into my Gmail "contacts".

Should that be done via API?

Can someone explain the process to me and provide examples?

Thanks so much.

Gary

Julian (Google)

unread,
Jan 7, 2009, 1:11:23 PM1/7/09
to Google Contacts API
Hi Gary,

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

We do not have good samples available, but in this groups you can find
different PHP code snippets.

Cheers,
Julian

On Jan 3, 6:49 pm, swoop80 <mymo...@gmail.com> wrote:
> HI.  I know that this is possible, but I really don't know "how" to
> achieve it...
>
> I have some PHP5 scripts on my Linux website now - and they work just
> fine.  I also have the cURL extension available.
>
> In a new script I will write, I want to take a email address and place
> that into myGmail"contacts".

swoop80

unread,
Jan 8, 2009, 2:01:24 AM1/8/09
to Google Contacts API
Julian - thanks so much. I looked at the doc, but I'm afraid that I'm
so novice at this that without examples, it will be an exercise in
frustration. I will search for the snippets you mentioned. Also - a
couple more things: my site is hosted at Godaddy (I'm questioning the
decision to host there now that I've seen some of the articles on
their terrible support and also their tunneling approach for doing
some of these mail functions). Are you aware of any Godaddy issues
that would mean that I cannot use the APIs from google?

One more: My process needs to
a) look through all unread mails in an inbox
b) add some of those 'sender' email addresses to my 'contacts'
c) flag some of the seen emails as 'read' (but not all of them)

This doesn't seem like rocket science (and several claim to have this
sort of thing working) but I really want to use a solution that is
from Google since I think it'll be more likely to last for some time.

I appreciate any advice you can supply.

Gary

On Jan 7, 12:11 pm, "Julian (Google)" <j...@google.com> wrote:
> Hi Gary,
>
> You can use cURL to make calls to the Contacts API:http://code.google.com/apis/contacts/docs/2.0/developers_guide_protoc...
>
> We do not have good samples available, but in this groups you can find
> different PHP code snippets.
>
> Cheers,
> Julian
>
> On Jan 3, 6:49 pm, swoop80 <mymo...@gmail.com> wrote:
>
>
>
> > HI.  I know that this is possible, but I really don't know "how" to
> > achieve it...
>
> > I have some PHP5 scripts on my Linux website now - and they work just
> > fine.  I also have the cURL extension available.
>
> > In a new script I will write, I want to take a email address and place
> > that into myGmail"contacts".
>
> > Should that be done via API?
>
> > Can someone explain the process to me and provide examples?
>
> > Thanks so much.
>
> > Gary- Hide quoted text -
>
> - Show quoted text -

Julian (Google)

unread,
Jan 16, 2009, 12:01:30 PM1/16/09
to Google Contacts API
Hi Gary,

You can try to use examples like the ones in this thread to create
users using cURL and PHP:
http://groups.google.com/group/google-contacts-api/browse_thread/thread/f6dcf92775f8549/9dc962ddd20af598

You can read a user's email programmatically via:

- IMAP
- POP3
- Atom feed

None of these can use SSO for authentication, so you would need to
have
each user's Google Apps password.

IMAP and POP3 have the disadvantage in that the user must enable the
protocol in Gmail settings before it can be used. Read more about the
Atom feed:

http://mail.google.com/support/bin/answer.py?answer=13474

The feed URL for Google Apps domains is slightly different:

https://mail.google.com/a/domain.com/feed/atom

All three approaches have the limitation in that if too many
authentications are coming from a single IP address, e.g. the case
with a
web application reading this data, then the IP address may be flagged
for
a CAPTCHA. Read about CAPTCHAs here:

http://code.google.com/apis/apps/faq.html#authentication

Cheers,
Julian

On Jan 8, 7:01 am, swoop80 <mymo...@gmail.com> wrote:
> Julian - thanks so much.  I looked at the doc, but I'm afraid that I'm
> so novice at this that without examples, it will be an exercise in
> frustration.  I will search for the snippets you mentioned.  Also - a
> couple more things:  my site is hosted at Godaddy (I'm questioning the
> decision to host there now that I've seen some of the articles on
> their terrible support and also their tunneling approach for doing
> some of these mail functions).  Are you aware of any Godaddy issues
> that would mean that I cannot use the APIs from google?
>
> One more: My process needs to
> a) look through all unread mails in an inbox
> b)addsome of those 'sender' email addresses to my 'contacts'
> c) flag some of the seen emails as 'read' (but not all of them)
>
> This doesn't seem like rocket science (and several claim to have this
> sort of thing working) but I really want to use a solution that is
> from Google since I think it'll be more likely to last for some time.
>
> I appreciate any advice you can supply.
>
> Gary
>
> On Jan 7, 12:11 pm, "Julian (Google)" <j...@google.com> wrote:
>
> > Hi Gary,
>
> > You can use cURL to make calls to theContactsAPI:http://code.google.com/apis/contacts/docs/2.0/developers_guide_protoc...
Reply all
Reply to author
Forward
0 new messages