API error: The remote server returned an error: (404) Not Found.

537 views
Skip to first unread message

Tony John

unread,
Jul 22, 2013, 10:08:47 AM7/22/13
to adsen...@googlegroups.com
Here are the sequence of APIs I call:

1. Authenticate using oAuth 2.0 (https://accounts.google.com/o/oauth2/auth)


3. AssociationSessions.Verify (https://www.googleapis.com/adsensehost/v4.1/associationsessions/verify)
(In this step, I am getting the status ACCEPTED, but ProductCodes is null. I am getting a valid Account Id - pub-744xxxxxxxxx)

4. Accounts.get (https://www.googleapis.com/adsensehost/v4.1/accounts/pub-744xxxxxxxxx)
(In this API call, the pub id is part of the url and not passed as a query string, isn't it the way to call it? Or, should I call it like this:
https://www.googleapis.com/adsensehost/v4.1/accounts/?AccountId=pub-744xxxxxxxxx ?)

Even though I get an ACCEPTED status in the .Verify call, I am getting an exception when I call Accounts.get. The exception says:
"The remote server returned an error: (404) Not Found."

Am I missing any steps between #3 and #4 ? Or, any other reason for this error?





Tony John

unread,
Jul 22, 2013, 1:40:29 PM7/22/13
to adsen...@googlegroups.com
I think I got some idea how this error happens. I have been trying to associate the same sandbox account as a publisher, which is used as the host account as well. In that case, I am not taken to the steps to create a new AdSense account, instead, I am prompted at the Google website to "Start showing Ads in www......com website". (This is because Sandbox account is already an AdSense account) After this step, I am taken back to the callback page in the host website with the status "ACCEPTED". However, I get the error when I call further APIs if the host and publisher are the same Google account.

If I create a new Google account and try to associate that with the sandbox host site, it goes through the steps to create a new AdSense account. And if I make further API calls for this publisher, it is working fine. So, it works as expected if I am working with 2 different accounts as Host and Publisher.

Jose Alcérreca (AdSense API Team)

unread,
Jul 23, 2013, 8:06:01 AM7/23/13
to adsen...@googlegroups.com
Hi Tony,

Yes, try not to mix sandbox and productions accounts. Glad to hear that you were able to sort it out.

Cheers!
Jose


---
Jose Alcérreca
Developer Relations

Google UK Limited
Registered Office: Belgrave House, 76 Buckingham Palace Road, London SW1W 9TQ
Registered in England Number: 3977902
Reply all
Reply to author
Forward
0 new messages