Skip to content

Latest commit

 

History

History
144 lines (90 loc) · 8.83 KB

File metadata and controls

144 lines (90 loc) · 8.83 KB

webhook

Description

The webhook command category includes a number of interactions with webhooks.

These commands can be used to export, import and delete webhooks from an individual hub.

Run dc-cli webhook --help to get a list of available commands.

Return to README.md for information on other command categories.

Common Options

The following options are available for all webhook commands.

Option Name Type Description
--version [boolean] Show version number
--clientId [string]
[required]
Client ID for the source hub
--clientSecret [string]
[required]
Client secret for the source hub
--hubId [string]
[required]
Hub ID for the source hub
--config [string]
[default: "~/.amplience/dc-cli-config.json"]
Path to JSON config file
--help [boolean] Show help

Commands

export

Exports webhooks from the targeted Dynamic Content hub into a folder called exported_webhooks at the user specified file path.

Note: No secret or auth header values will be exported.

dc-cli webhook export <dir>

Options

Option Name Type Description
--id [string] The ID of the webhook to be exported.
If no --id option is given, all webhooks for the hub are exported.
A single --id option may be given to export a single webhook.
Multiple --id options may be given to export multiple webhooks at the same time.
--logFile [string]
[default: (generated-value)]
Path to a log file to write to.
-s
--silent
[boolean] If present, no log file will be produced.
-f
--force
[boolean] Export webhooks without asking.

Examples

Export all webhooks from a hub

dc-cli webhook export ./myDirectory/content

Export a single webhook from a hub

dc-cli webhook export ./myDirectory/content --id 1111111111

Export multiple webhooks from a hub

dc-cli webhook export ./myDirectory/content --id 1111111111 --id 2222222222

import

Imports webhooks from the specified filesystem location to the targeted Dynamic Content hub.

Note: The following values will be stripped out / not included during the import:

  • secret - this will be recreated for the webhook in the destination hub during import.
  • createdDate - this will be assigned during import (if webhook is being created).
  • lastModifiedDate - this will be assigned during import (if webhook is being updated).
  • any header objects that are secrets - these need to be manually assigned for the webhook in the destination hub.

Please see the content-management API reference for Webhooks for more information.

For any customPayload the following property values will be replaced by those in the destination hub:

  • account
  • stagingEnvironment
dc-cli webhook import <dir>

Options

Option Name Type Description
--mapFile [string] Mapping file to use when updating content that already exists.
Updated with any new mappings that are generated. If not present, will be created.
For more information, see mapping files.
--logFile [string]
[default: (generated-value)]
Path to a log file to write to.
-s
--silent
[boolean] If present, no log file will be produced.
-f
--force
[boolean] Overwrite webhooks without asking.

Examples

Import content from the filesystem

dc-cli webhook import ./myDirectory/webhooks

Specify a mapping file when importing

dc-cli webhook import ./myDirectory/webhooks --mapFile ./myDirectory/mappingFile.json

delete

Deletes webhooks from the targeted Dynamic Content hub.

dc-cli webhook delete

Options

Option Name Type Description
--id [string] The ID of an Webhook to be deleted.
If no --id option is given, all webhooks for the hub are deleted.
A single --id option may be given to delete a single webhook.
Multiple --id options may be given to delete multiple webhooks at the same time.
-f
--force
[boolean] Delete webhooks without asking.
--logFile [string]
[default: (generated-value)]
Path to a log file to write to.

Examples

Delete all webhooks from a Hub

dc-cli webhook delete

Delete a single webhook with the ID of 'foo'

dc-cli webhook delete foo

or

dc-cli webhook delete --id foo

Delete multiple webhooks with the IDs of 'foo' & 'bar'

dc-cli webhook delete --id foo --id bar