Use GoogleAds API from Google Spreadsheet
is there a way to easily call a GoogleAds API (TargetingIdeaService to be more precise) from Google Spreadsheet scripts? It looks like there should be an integratation of them but I'm missing it.
I can make calls to others APIs with no issues. I have registered myself on Google Ads and got a test token, which should be changed when I get the definitive one.
Thanks in advance.
Well, "easily" could be considered a relative term. Having said that, there is an example script on Apps Scripts execution, which shows how to call the Google Ads API.
NoticeIn the previous script, you will also need to insert the OAuth2.0 library script.
I am pretty sure that you are unable to trigger a Google Ads Scripts from an Apps Scripts. I know for sure you can trigger an Apps Script from another Apps Script/Google Ads Script.
You have two options:
Connect to the Google Ads API through an Apps Script URLFetchAppUse Google Ads Scripts and take advantage of the SpreadsheetApp class
If you choose to connect to the Google Ads API through URLFetchApp, you'll need to use Google Ads Beta REST API, linked here.
You are able to use Google Ads Scripts to pull the TargetingIdeaService elements you want into a Google Sheets Spreadsheet & it could also have inputs. The Google Sheet API usage used in Google Ads Scripts is linked here