0.0.20240507 • Published 13 days ago

@maxim_mazurok/gapi.client.doubleclicksearch-v2 v0.0.20240507

Weekly downloads
-
License
MIT
Repository
github
Last release
13 days ago

TypeScript typings for Search Ads 360 API v2

The Search Ads 360 API allows developers to automate uploading conversions and downloading reports from Search Ads 360. For detailed description please check documentation.

Installing

Install typings for Search Ads 360 API:

npm install @types/gapi.client.doubleclicksearch-v2 --save-dev

Usage

You need to initialize Google API client in your code:

gapi.load('client', () => {
  // now we can use gapi.client
  // ...
});

Then load api client wrapper:

gapi.client.load(
  'https://doubleclicksearch.googleapis.com/$discovery/rest?version=v2',
  () => {
    // now we can use:
    // gapi.client.doubleclicksearch
  }
);
// Deprecated, use discovery document URL, see https://github.com/google/google-api-javascript-client/blob/master/docs/reference.md#----gapiclientloadname----version----callback--
gapi.client.load('doubleclicksearch', 'v2', () => {
  // now we can use:
  // gapi.client.doubleclicksearch
});

Don't forget to authenticate your client before sending any request to resources:

// declare client_id registered in Google Developers Console
var client_id = '',
  scope = [
    // View and manage your advertising data in DoubleClick Search
    'https://www.googleapis.com/auth/doubleclicksearch',
  ],
  immediate = true;
// ...

gapi.auth.authorize(
  {client_id: client_id, scope: scope, immediate: immediate},
  authResult => {
    if (authResult && !authResult.error) {
      /* handle successful authorization */
    } else {
      /* handle authorization error */
    }
  }
);

After that you can use Search Ads 360 API resources:

/*
Retrieves a list of conversions from a DoubleClick Search engine account.
*/
await gapi.client.doubleclicksearch.conversion.get({
  advertiserId: 'advertiserId',
  agencyId: 'agencyId',
  endDate: 1,
  engineAccountId: 'engineAccountId',
  rowCount: 1,
  startDate: 1,
  startRow: 1,
});

/*
Retrieves a list of conversions from a DoubleClick Search engine account.
*/
await gapi.client.doubleclicksearch.conversion.getByCustomerId({
  customerId: 'customerId',
  endDate: 1,
  rowCount: 1,
  startDate: 1,
  startRow: 1,
});

/*
Inserts a batch of new conversions into DoubleClick Search.
*/
await gapi.client.doubleclicksearch.conversion.insert({});

/*
Updates a batch of conversions in DoubleClick Search.
*/
await gapi.client.doubleclicksearch.conversion.update({});

/*
Updates the availabilities of a batch of floodlight activities in DoubleClick Search.
*/
await gapi.client.doubleclicksearch.conversion.updateAvailability({});

/*
Generates and returns a report immediately.
*/
await gapi.client.doubleclicksearch.reports.generate({});

/*
Polls for the status of a report request.
*/
await gapi.client.doubleclicksearch.reports.get({reportId: 'reportId'});

/*
Downloads a report file encoded in UTF-8.
*/
await gapi.client.doubleclicksearch.reports.getFile({
  reportFragment: 1,
  reportId: 'reportId',
});

/*
Downloads a csv file(encoded in UTF-8) that contains ID mappings between legacy SA360 and new SA360. The file includes all children entities of the given advertiser(e.g. engine accounts, campaigns, ad groups, etc.) that exist in both legacy SA360 and new SA360.
*/
await gapi.client.doubleclicksearch.reports.getIdMappingFile({
  advertiserId: 'advertiserId',
  agencyId: 'agencyId',
});

/*
Inserts a report request into the reporting system.
*/
await gapi.client.doubleclicksearch.reports.request({});

/*
Retrieve the list of saved columns for a specified advertiser.
*/
await gapi.client.doubleclicksearch.savedColumns.list({
  advertiserId: 'advertiserId',
  agencyId: 'agencyId',
});
0.0.20240507

13 days ago

0.0.20240430

21 days ago

0.0.20240424

26 days ago

0.0.20240416

1 month ago

0.0.20240409

1 month ago

0.0.20240327

2 months ago

0.0.20240320

2 months ago

0.0.20240312

2 months ago

0.0.20240306

3 months ago

0.0.20240227

3 months ago

0.0.20240220

3 months ago

0.0.20240214

3 months ago

0.0.20240206

3 months ago

0.0.20240131

4 months ago

0.0.20240124

4 months ago

0.0.20240117

4 months ago

0.0.20240109

4 months ago

0.0.20240102

5 months ago

0.0.20231206

6 months ago

0.0.20231128

6 months ago

0.0.20231107

6 months ago

0.0.20230815

9 months ago

0.0.20230808

9 months ago

0.0.20230926

8 months ago

0.0.20230920

8 months ago

0.0.20231017

7 months ago

0.0.20230727

10 months ago

0.0.20230801

10 months ago

0.0.20231102

7 months ago

0.0.20231024

7 months ago

0.0.20230718

10 months ago

0.0.20230711

10 months ago

0.0.20230830

9 months ago

0.0.20230912

8 months ago

0.0.20231010

7 months ago

0.0.20230906

9 months ago

0.0.20230705

11 months ago

0.0.20230823

9 months ago

0.0.20231003

8 months ago

0.0.20230626

11 months ago

0.0.20230614

11 months ago

0.0.20230516

1 year ago

0.0.20230508

1 year ago

0.0.20230502

1 year ago

0.0.20230523

12 months ago

0.0.20230606

12 months ago

0.0.20230313

1 year ago

0.0.20230419

1 year ago

0.0.20230301

1 year ago

0.0.20230321

1 year ago

0.0.20230425

1 year ago

0.0.20230404

1 year ago

0.0.20230308

1 year ago

0.0.20230328

1 year ago

0.0.20230411

1 year ago

0.0.20230215

1 year ago

0.0.20230221

1 year ago

0.0.20230207

1 year ago

0.0.20230130

1 year ago

0.0.20221130

1 year ago

0.0.20230118

1 year ago

0.0.20230104

1 year ago

0.0.20230110

1 year ago

0.0.20230124

1 year ago

0.0.20221108

2 years ago

0.0.20221206

1 year ago

0.0.20221004

2 years ago

0.0.20221025

2 years ago

0.0.20221101

2 years ago

0.0.20221011

2 years ago

0.0.20220927

2 years ago

0.0.20221018

2 years ago

0.0.20220908

2 years ago

0.0.20220830

2 years ago

0.0.20220920

2 years ago

0.0.20220823

2 years ago

0.0.20220913

2 years ago

0.0.20220816

2 years ago

0.0.20220810

2 years ago

0.0.20220802

2 years ago