Hi Thomas, I think the problem is in the Service parameter when you retrieve the token, it should be "cp" for the Contacts API (instead of cl for Calendar).
objHttp.send "[email protected]&Passwd=mypw&Service=cp" Cheers, Julian. On Mar 23, 11:01 pm, Thomas Adrian <[email protected]> wrote: > Hello, I am trying to get my contacts from the Google Contacts API: > The first lines of code works fine, I recieve the token from Google > and extract it correctly. > > When I after that use my token to get my contacts feed I get "Token > Invalid" and a 401 error. > Anyone know what is wrong in my code > > == Working Code == > > Dim objHttp As Variant,token as string > Set objHttp = CreateObject("Microsoft.XMLHTTP") > > objHttp.open "POST", "https://www.google.com/accounts/ClientLogin", > False > objHttp.setRequestHeader "Content-Type", "application/x-www-form- > urlencoded" > objHttp.send "[email protected]&Passwd=mypw&Service=cl" > > token = Strrightback(objHttp.responseText,"Auth=") > > == NOT WORKING CODE == > > objHttp.open "GET", "http://www.google.com/m8/feeds/contacts/defult/ > full", False > objHTTP.setRequestHeader "Authorization", "GoogleLogin auth=" + token > objHTTP.setRequestHeader "Content-Type", "application/atom+xml" > objHttp.send Null > print objHttp.responseText > > ======================= > > Thank you > Thomas Adrianhttp://www.notessidan.se --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Google Contacts API" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/google-contacts-api?hl=en -~----------~----~----~----~------~----~------~--~---
