// 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.orders.gettestordertemplate({
// The country of the template to retrieve. Defaults to `US`.
country: 'placeholder-value',
// The ID of the account that should manage the order. This cannot be a multi-client account.
merchantId: 'placeholder-value',
// The name of the template to retrieve.
templateName: 'placeholder-value',
});
console.log(res.data);
// Example response
// {
// "kind": "my_kind",
// "template": {}
// }
}
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.orders.gettestordertemplate({
// The country of the template to retrieve. Defaults to `US`.
country: 'placeholder-value',
// The ID of the account that should manage the order. This cannot be a multi-client account.
merchantId: 'placeholder-value',
// The name of the template to retrieve.
templateName: 'placeholder-value',
});
console.log(res.data);
// Example response
// {
// "kind": "my_kind",
// "template": {}
// }
}
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.orders.createtestorder({
// The ID of the account that should manage the order. This cannot be a multi-client account.
merchantId: 'placeholder-value',
// Request body metadata
requestBody: {
// request body parameters
// {
// "country": "my_country",
// "templateName": "my_templateName",
// "testOrder": {}
// }
},
});
console.log(res.data);
// Example response
// {
// "kind": "my_kind",
// "orderId": "my_orderId"
// }
}
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.orders.createtestorder({
// The ID of the account that should manage the order. This cannot be a multi-client account.
merchantId: 'placeholder-value',
// Request body metadata
requestBody: {
// request body parameters
// {
// "country": "my_country",
// "templateName": "my_templateName",
// "testOrder": {}
// }
},
});
console.log(res.data);
// Example response
// {
// "kind": "my_kind",
// "orderId": "my_orderId"
// }
}
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.orders.getbymerchantorderid({
// The ID of the account that manages the order. This cannot be a multi-client account.
merchantId: 'placeholder-value',
// The merchant order ID to be looked for.
merchantOrderId: 'placeholder-value',
});
console.log(res.data);
// Example response
// {
// "kind": "my_kind",
// "order": {}
// }
}
main().catch(e => {
console.error(e);
throw e;
});