RE: 403 Error When Calling Local Services API From Apps Script in Google Sheet

224 views
Skip to first unread message

Google Ads API Forum Advisor

unread,
Dec 2, 2021, 1:30:43 AM12/2/21
to basil...@gmail.com, adwor...@googlegroups.com
Hi Basil,

Thank you for reaching out to our team.

Could you confirm if you are using the Google Ads API inside the Google spreadsheet and encountered the error PERMISSION_DENIED? If yes, then USER_PERMISSION_DENIED occurs when the authorized customer does not have access to the operating customer or authenticating as a user with access to a manager account but not specifying login-customer-id in the request. With this, you will need to specify the login-customer-id as the manager account ID without hyphens (-). Client libraries have built in support for this, or see our guide.

Also, when we say customer and manager accounts, we are referring here, not the Google API console.

Regards,
Google Logo
Ernie John Blanca Tacata
Google Ads API Team
 


ref:_00D1U1174p._5004Q2RxWIP:ref

Basil Latif

unread,
Dec 2, 2021, 8:36:17 PM12/2/21
to AdWords API and Google Ads API Forum

Hi Ernie, 

So I get the PERMISSION_DENIED error message when running the API for myself. When the person who created the API in API console runs it, he gets back a blank response. 

Here is the API request. Is there anything else I need to include in here? 

function makeRequest() {
var adsService = getAdsService();
console.log(adsService.getAccessToken())
headers: {
Authorization: 'Bearer ' + adsService.getAccessToken(),
Accept: 'application/json'
},
'method' : 'GET',
'contentType' : 'application/json'
});
console.log(response)

I am following the documentation for calling the Local Services API exactly as they had written in the example call: https://services.google.com/fh/files/helpcenter/lsa_api_dev_guide.pdf

Why am I not getting a response from the API???

Google Ads API Forum Advisor

unread,
Dec 3, 2021, 11:05:55 AM12/3/21
to basil...@gmail.com, adwor...@googlegroups.com
Hi Basil,

Thanks for providing that additional information. I see that you are using Apps Scripts with the Local Services API. The Local Services API is out of scope for our team, as we specialize in the Ads and AdWords APIs. You may want to reach out to the Local Service Ads help center for more assistance on this.

Regards,
Matt
Google Ads API Team


Reminder: Share your feedback about the Google Ads (AdWords) API! Take the 2021 Google Ads API and AdWords API Annual Survey
 
Google Logo
Matt
Google Ads API Team
 


ref:_00D1U1174p._5004Q2RxWIP:ref
Reply all
Reply to author
Forward
0 new messages