Sunday, January 01, 2012

Google API using cURL or wget or plain http

I was researching to use Google API for certain activities.
There are 2 kinds of access
  1. oauth 
  2. clientlogin (username and password) 
I am mostly interested in clientlogin.

Client Login:

Thing to Note:
  1.     Service Type: More here for contacts, service type is "cp"
  2. There are 2 request to fetch the actua value
    1. First Request URL:  curl --data-urlencode --data-urlencode Passwd=PASSWORD -d accountType=GOOGLE -d source=Google-cURL-Example -d service=cp
    2. Response for the above Request will be: SID=DQ...........A
    3. Make second Request by using Auth param from the above response: 
      1. curl --silent --header "Authorization: GoogleLogin auth=AUTH_TOKEN_FROM_ABOVE_RESPONSE" ""
  3. Second response will be the address details, thats it. 

No comments:

Post a Comment

Thanks for reading and welcome for commenting...