// Before running the sample:
// - Enable the API at:
// https://console.developers.google.com/apis/api/content.googleapis.com
// - Login into gcloud by running:
// `$ gcloud auth application-default login`
// - Install the npm module by running:
// `$ npm install googleapis`
const {google} = require('googleapis');
const content = google.content('v2');
async function main() {
const auth = new google.auth.GoogleAuth({
// Scopes can be specified either as an array or as a single, space-delimited string.
scopes: ['https://www.googleapis.com/auth/content'],
});
// Acquire an auth client, and bind it to all future calls
const authClient = await auth.getClient();
google.options({auth: authClient});
// Do the magic
const res = await content.productstatuses.list({
// If set, only issues for the specified destinations are returned, otherwise only issues for the Shopping destination.
destinations: 'placeholder-value',
// Flag to include full product data in the results of the list request. The default value is false.
includeAttributes: 'placeholder-value',
// Flag to include the invalid inserted items in the result of the list request. By default the invalid items are not shown (the default value is false).
includeInvalidInsertedItems: 'placeholder-value',
// The maximum number of product statuses to return in the response, used for paging.
maxResults: 'placeholder-value',
// The ID of the account that contains the products. This account cannot be a multi-client account.
merchantId: 'placeholder-value',
// The token returned by the previous request.
pageToken: 'placeholder-value',
});
console.log(res.data);
// Example response
// {
// "kind": "my_kind",
// "nextPageToken": "my_nextPageToken",
// "resources": []
// }
}
main().catch(e => {
console.error(e);
throw e;
});
// Before running the sample:
// - Enable the API at:
// https://console.developers.google.com/apis/api/content.googleapis.com
// - Login into gcloud by running:
// `$ gcloud auth application-default login`
// - Install the npm module by running:
// `$ npm install googleapis`
const {google} = require('googleapis');
const content = google.content('v2');
async function main() {
const auth = new google.auth.GoogleAuth({
// Scopes can be specified either as an array or as a single, space-delimited string.
scopes: ['https://www.googleapis.com/auth/content'],
});
// Acquire an auth client, and bind it to all future calls
const authClient = await auth.getClient();
google.options({auth: authClient});
// Do the magic
const res = await content.productstatuses.get({
// If set, only issues for the specified destinations are returned, otherwise only issues for the Shopping destination.
destinations: 'placeholder-value',
// Flag to include full product data in the result of this get request. The default value is false.
includeAttributes: 'placeholder-value',
// The ID of the account that contains the product. This account cannot be a multi-client account.
merchantId: 'placeholder-value',
// The REST ID of the product.
productId: 'placeholder-value',
});
console.log(res.data);
// Example response
// {
// "creationDate": "my_creationDate",
// "dataQualityIssues": [],
// "destinationStatuses": [],
// "googleExpirationDate": "my_googleExpirationDate",
// "itemLevelIssues": [],
// "kind": "my_kind",
// "lastUpdateDate": "my_lastUpdateDate",
// "link": "my_link",
// "product": {},
// "productId": "my_productId",
// "title": "my_title"
// }
}
main().catch(e => {
console.error(e);
throw e;
});
// Before running the sample:
// - Enable the API at:
// https://console.developers.google.com/apis/api/content.googleapis.com
// - Login into gcloud by running:
// `$ gcloud auth application-default login`
// - Install the npm module by running:
// `$ npm install googleapis`
const {google} = require('googleapis');
const content = google.content('v2');
async function main() {
const auth = new google.auth.GoogleAuth({
// Scopes can be specified either as an array or as a single, space-delimited string.
scopes: ['https://www.googleapis.com/auth/content'],
});
// Acquire an auth client, and bind it to all future calls
const authClient = await auth.getClient();
google.options({auth: authClient});
// Do the magic
const res = await content.accountstatuses.list({
// If set, only issues for the specified destinations are returned, otherwise only issues for the Shopping destination.
destinations: 'placeholder-value',
// The maximum number of account statuses to return in the response, used for paging.
maxResults: 'placeholder-value',
// The ID of the managing account. This must be a multi-client account.
merchantId: 'placeholder-value',
// The token returned by the previous request.
pageToken: 'placeholder-value',
});
console.log(res.data);
// Example response
// {
// "kind": "my_kind",
// "nextPageToken": "my_nextPageToken",
// "resources": []
// }
}
main().catch(e => {
console.error(e);
throw e;
});
// Before running the sample:
// - Enable the API at:
// https://console.developers.google.com/apis/api/content.googleapis.com
// - Login into gcloud by running:
// `$ gcloud auth application-default login`
// - Install the npm module by running:
// `$ npm install googleapis`
const {google} = require('googleapis');
const content = google.content('v2');
async function main() {
const auth = new google.auth.GoogleAuth({
// Scopes can be specified either as an array or as a single, space-delimited string.
scopes: ['https://www.googleapis.com/auth/content'],
});
// Acquire an auth client, and bind it to all future calls
const authClient = await auth.getClient();
google.options({auth: authClient});
// Do the magic
const res = await content.products.list({
// Flag to include the invalid inserted items in the result of the list request. By default the invalid items are not shown (the default value is false).
includeInvalidInsertedItems: 'placeholder-value',
// The maximum number of products to return in the response, used for paging.
maxResults: 'placeholder-value',
// The ID of the account that contains the products. This account cannot be a multi-client account.
merchantId: 'placeholder-value',
// The token returned by the previous request.
pageToken: 'placeholder-value',
});
console.log(res.data);
// Example response
// {
// "kind": "my_kind",
// "nextPageToken": "my_nextPageToken",
// "resources": []
// }
}
main().catch(e => {
console.error(e);
throw e;
});
// Before running the sample:
// - Enable the API at:
// https://console.developers.google.com/apis/api/content.googleapis.com
// - Login into gcloud by running:
// `$ gcloud auth application-default login`
// - Install the npm module by running:
// `$ npm install googleapis`
const {google} = require('googleapis');
const content = google.content('v2.1');
async function main() {
const auth = new google.auth.GoogleAuth({
// Scopes can be specified either as an array or as a single, space-delimited string.
scopes: ['https://www.googleapis.com/auth/content'],
});
// Acquire an auth client, and bind it to all future calls
const authClient = await auth.getClient();
google.options({auth: authClient});
// Do the magic
const res = await content.products.list({
// The maximum number of products to return in the response, used for paging.
maxResults: 'placeholder-value',
// The ID of the account that contains the products. This account cannot be a multi-client account.
merchantId: 'placeholder-value',
// The token returned by the previous request.
pageToken: 'placeholder-value',
});
console.log(res.data);
// Example response
// {
// "kind": "my_kind",
// "nextPageToken": "my_nextPageToken",
// "resources": []
// }
}
main().catch(e => {
console.error(e);
throw e;
});