Internal error encountered when trying to fetch payments from an adsense child account

89 views
Skip to first unread message

Ntinos Mavrakis

unread,
Jul 13, 2021, 11:13:30 AM7/13/21
to AdSense API Forum
Environment details
  • OS: Linux
  • PHP version: 7.4.1
  • Package name and version: google-api-php-client-services / v0.174.0
Code example: 
$this->service = new \Google_Service_AdSense($this->client); 
$payments = $this->service->accounts_payments->listAccountsPayments('accounts/pub-1111111111111')->getPayments();

When trying to retrieve the list of payments from a child adsense account, we get the following error:
{ "error":{ "code":500, "message":"Internal error encountered.", "status":"INTERNAL" }}

Ad Sense API

unread,
Jul 13, 2021, 12:03:09 PM7/13/21
to adsen...@googlegroups.com
Hi,

What user are you using to authenticate your API requests? Does this user have access to the child account?

If it's not an issue with the user's permissions, then can you send me the full API request/response? With PHP, you can follow these instructions for how to debug your HTTP requests.

Google Logo
Donovan McMurray
AdSense API Team
 


ref:_00D1U1174p._5004Q2KbsgL:ref

Ntinos Mavrakis

unread,
Jul 14, 2021, 10:51:51 AM7/14/21
to AdSense API Forum
Hello,

We are using our main account to authenticate through a service account json file. Before version 2, we could retrieve information regarding our child accounts without any issues.

With version 2 of the AdSense API, we can't and we receive the error mentioned above: { "error":{ "code":500, "message":"Internal error encountered.", "status":"INTERNAL" }}

You can replicate it even from the "Try this API" right panel here: https://developers.google.com/adsense/management/reference/rest/v2/accounts.payments/list

If we use the child account through here: https://developers.google.com/adsense/management/reference/rest/v1.4/accounts.payments/list  we get a response. 

Ad Sense API

unread,
Jul 14, 2021, 4:20:09 PM7/14/21
to adsen...@googlegroups.com
Hi,

Thanks for providing that additional information. I checked our API server logs, and I found this error happened 5 different times (for different publisher codes). Can you provide the publisher code so I can see which one is yours? You used the placeholder "pub-1111111111111" earlier. Also, if you're not comfortable sharing this value publicly, you can email us at adsense...@google.com.

In the meantime, I've already alerted an AdSense engineer about this issue, so they'll look into it to see if something is wrong on our side.

Ntinos Mavrakis

unread,
Jul 19, 2021, 11:41:28 AM7/19/21
to AdSense API Forum
Hello,

I've just sent an email with our main account and a child account. 

Thanks a lot. 

Ad Sense API

unread,
Jul 19, 2021, 12:02:09 PM7/19/21
to adsen...@googlegroups.com
Hi,

Thanks for sending your publisher code. Our engineers were able to look into this issue and write a fix for it. Can you try again to verify that the fix is working for you? (There is a separate issue making Payments requests fail intermittently on both v1.4 and v2, so you may have to retry your request.)

Ntinos Mavrakis

unread,
Jul 23, 2021, 11:18:27 AM7/23/21
to AdSense API Forum
Hello, we did some testing and it works as expected. 

Thanks a lot! 

Ad Sense API

unread,
Jul 23, 2021, 6:02:46 PM7/23/21
to adsen...@googlegroups.com
Hi,

I'm glad to hear this is working as expected now. Thanks for bringing this issue to our attention!
Reply all
Reply to author
Forward
0 new messages