TypeScript typings for Search Ads 360 Reporting API v0
The Search Ads 360 API allows developers to automate downloading reports from Search Ads 360.
For detailed description please check documentation.
Installing
Install typings for Search Ads 360 Reporting API:
npm install @types/gapi.client.searchads360-v0 --save-dev
Usage
You need to initialize Google API client in your code:
gapi.load('client', () => {
});
Then load api client wrapper:
gapi.client.load(
'https://searchads360.googleapis.com/$discovery/rest?version=v0',
() => {
}
);
gapi.client.load('searchads360', 'v0', () => {
});
Don't forget to authenticate your client before sending any request to resources:
var client_id = '',
scope = [
'https://www.googleapis.com/auth/doubleclicksearch',
],
immediate = true;
gapi.auth.authorize(
{client_id: client_id, scope: scope, immediate: immediate},
authResult => {
if (authResult && !authResult.error) {
} else {
}
}
);
After that you can use Search Ads 360 Reporting API resources:
await gapi.client.searchads360.customers.listAccessibleCustomers({});
await gapi.client.searchads360.searchAds360Fields.get({
resourceName: 'resourceName',
});
await gapi.client.searchads360.searchAds360Fields.search({});