Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
async function main() {
const customer = client.Customer({
customer_account_id: '',
refresh_token: '',
})
// Bonus: If you're using Typescript, set the type here to "types.Campaign" for autocomplete
const campaign = {
name: 'new-campaign',
campaign_budget: 'customers/{customer_id}/campaignBudgets/{campaign_budget_id}',
advertising_channel_type: enums.AdvertisingChannelType.SEARCH,
status: enums.CampaignStatus.PAUSED,
}
try {
const { results } = await customer.campaigns.create(campaign)
/*
The newly created campaign will have a resource name in the following format:
"customers/{customer_id}/campaigns/{campaign_id}"
*/
} catch (err) {
console.log(err)
}
}