Hi, An example of how to use the ClientLogin API is available in the Java client library:
http://code.google.com/p/google-api-adwords-java/source/browse/trunk/src/com/google/api/adwords/lib/AuthToken.java Best, - Eric On Mar 31, 4:53 pm, "Joshua J. Kugler" <[email protected]> wrote: > The ClientLogin API require a POST request. It appears you are making a > GET request. > > j > > On Wednesday 31 March 2010, J elucidated thus: > > > > > > > Hello, > > > I am trying to make call to ClientLogin API using the code below. > > However, I always keep getting 403 -- even when I pass correct > > credentials. Is there anything that I am missing here. Please help. > > > String data = "accountType=GOOGLE&Email="+this.getUserName() > > +"&Passwd="+ this.getPassword()+"&service=adwords&source=something"; > > try{ > > URL url = new URL("https://www.google.com/accounts/ > > ClientLogin"); > > HttpsURLConnection conn = > > (HttpsURLConnection)url.openConnection(); > > conn.setDoOutput(true); > > conn.setDoInput(true); > > conn.setUseCaches(false); > > conn.setRequestProperty("Content-Type", > > "application/x-www- form-urlencoded"); > > OutputStreamWriter wr = new > > OutputStreamWriter(conn.getOutputStream()); > > wr.write(data); > > wr.flush(); > > wr.close(); > > > BufferedReader rd = new BufferedReader(new > > InputStreamReader(conn.getInputStream())); > > String line; > > while ((line = rd.readLine()) != null) { > > //todo > > } > > rd.close(); > > > } catch (Exception e){ > > e.printStackTrace(); > > } > > } > > -- > Joshua Kugler > Part-Time System Admin/Programmerhttp://www.eeinternet.com > PGP Key:http://pgp.mit.edu/ID 0x73B13B6A -- =~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~ Have you migrated to v200909 yet? The v13 sunset is on April 22, 2010. Also find us on our blog and discussion group: http://adwordsapi.blogspot.com http://groups.google.com/group/adwords-api =~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~ You received this message because you are subscribed to the Google Groups "AdWords API Forum" 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/adwords-api?hl=en To unsubscribe, reply using "remove me" as the subject.
