0.0.20241029 • Published 8 months ago

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

Weekly downloads
-
License
MIT
Repository
github
Last release
8 months 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.20241025

8 months ago

0.0.20241029

8 months ago

0.0.20241015

9 months ago

0.0.20240924

10 months ago

0.0.20241001

9 months ago

0.0.20241008

9 months ago

0.0.20240904

10 months ago

0.0.20240917

10 months ago

0.0.20240827

10 months ago

0.0.20240530

1 year ago

0.0.20240806

11 months ago

0.0.20240723

12 months ago

0.0.20240605

1 year ago

0.0.20240618

1 year ago

0.0.20240814

11 months ago

0.0.20240731

11 months ago

0.0.20240611

1 year ago

0.0.20240709

12 months ago

0.0.20240625

1 year ago

0.0.20240820

11 months ago

0.0.20240717

12 months ago

0.0.20240507

1 year ago

0.0.20240430

1 year ago

0.0.20240424

1 year ago

0.0.20240416

1 year ago

0.0.20240409

1 year ago

0.0.20240327

1 year ago

0.0.20240320

1 year ago

0.0.20240312

1 year ago

0.0.20240306

1 year ago

0.0.20240227

1 year ago

0.0.20240220

1 year ago

0.0.20240214

1 year ago

0.0.20240206

1 year ago

0.0.20240131

1 year ago

0.0.20240124

1 year ago

0.0.20240117

1 year ago

0.0.20240109

1 year ago

0.0.20240102

2 years ago

0.0.20231206

2 years ago

0.0.20231128

2 years ago

0.0.20231107

2 years ago

0.0.20230815

2 years ago

0.0.20230808

2 years ago

0.0.20230926

2 years ago

0.0.20230920

2 years ago

0.0.20231017

2 years ago

0.0.20230727

2 years ago

0.0.20230801

2 years ago

0.0.20231102

2 years ago

0.0.20231024

2 years ago

0.0.20230718

2 years ago

0.0.20230711

2 years ago

0.0.20230830

2 years ago

0.0.20230912

2 years ago

0.0.20231010

2 years ago

0.0.20230906

2 years ago

0.0.20230705

2 years ago

0.0.20230823

2 years ago

0.0.20231003

2 years ago

0.0.20230626

2 years ago

0.0.20230614

2 years ago

0.0.20230516

2 years ago

0.0.20230508

2 years ago

0.0.20230502

2 years ago

0.0.20230523

2 years ago

0.0.20230606

2 years ago

0.0.20230313

2 years ago

0.0.20230419

2 years ago

0.0.20230301

2 years ago

0.0.20230321

2 years ago

0.0.20230425

2 years ago

0.0.20230404

2 years ago

0.0.20230308

2 years ago

0.0.20230328

2 years ago

0.0.20230411

2 years ago

0.0.20230215

2 years ago

0.0.20230221

2 years ago

0.0.20230207

2 years ago

0.0.20230130

2 years ago

0.0.20221130

3 years ago

0.0.20230118

2 years ago

0.0.20230104

2 years ago

0.0.20230110

2 years ago

0.0.20230124

2 years ago

0.0.20221108

3 years ago

0.0.20221206

3 years ago

0.0.20221004

3 years ago

0.0.20221025

3 years ago

0.0.20221101

3 years ago

0.0.20221011

3 years ago

0.0.20220927

3 years ago

0.0.20221018

3 years ago

0.0.20220908

3 years ago

0.0.20220830

3 years ago

0.0.20220920

3 years ago

0.0.20220823

3 years ago

0.0.20220913

3 years ago

0.0.20220816

3 years ago

0.0.20220810

3 years ago

0.0.20220802

3 years ago