0.0.20241030 • Published 8 months ago

@maxim_mazurok/gapi.client.css-v1 v0.0.20241030

Weekly downloads
-
License
MIT
Repository
github
Last release
8 months ago

TypeScript typings for CSS API v1

Programmatically manage your Comparison Shopping Service (CSS) account data at scale. For detailed description please check documentation.

Installing

Install typings for CSS API:

npm install @types/gapi.client.css-v1 --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://css.googleapis.com/$discovery/rest?version=v1',
  () => {
    // now we can use:
    // gapi.client.css
  }
);
// 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('css', 'v1', () => {
  // now we can use:
  // gapi.client.css
});

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 = [
    // Manage your product listings and accounts for Google Shopping
    'https://www.googleapis.com/auth/content',
  ],
  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 CSS API resources:

/*
Retrieves a single CSS/MC account by ID.
*/
await gapi.client.css.accounts.get({name: 'name'});

/*
Lists all the accounts under the specified CSS account ID, and optionally filters by label ID and account name.
*/
await gapi.client.css.accounts.listChildAccounts({parent: 'parent'});

/*
Updates labels assigned to CSS/MC accounts by a CSS domain.
*/
await gapi.client.css.accounts.updateLabels({name: 'name'});
0.0.20241030

8 months ago

0.0.20241029

8 months ago

0.0.20241028

8 months ago

0.0.20241027

8 months ago

0.0.20241022

8 months ago

0.0.20241023

8 months ago

0.0.20241021

8 months ago

0.0.20241020

8 months ago

0.0.20241016

9 months ago

0.0.20241015

9 months ago

0.0.20241004

9 months ago

0.0.20241001

9 months ago

0.0.20240924

9 months ago

0.0.20240930

9 months ago

0.0.20240921

9 months ago

0.0.20240923

9 months ago

0.0.20240918

10 months ago

0.0.20240916

10 months ago

0.0.20240908

10 months ago

0.0.20240909

10 months ago

0.0.20240827

10 months ago

0.0.20240828

10 months ago

0.0.20240830

10 months ago

0.0.20240826

10 months ago

0.0.20240825

10 months ago

0.0.20240821

10 months ago

0.0.20240815

11 months ago

0.0.20240814

11 months ago

0.0.20240813

11 months ago

0.0.20240812

11 months ago

0.0.20240811

11 months ago

0.0.20240807

11 months ago

0.0.20240806

11 months ago

0.0.20240805

11 months ago

0.0.20240804

11 months ago

0.0.20240731

11 months ago

0.0.20240730

11 months ago

0.0.20240729

11 months ago

0.0.20240728

11 months ago

0.0.20240724

11 months ago

0.0.20240723

11 months ago

0.0.20240719

11 months ago

0.0.20240712

12 months ago

0.0.20240709

12 months ago

0.0.20240614

12 months ago