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/Programmer
http://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.