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.
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 |
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>
| 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. |
dc-cli webhook export ./myDirectory/content
dc-cli webhook export ./myDirectory/content --id 1111111111
dc-cli webhook export ./myDirectory/content --id 1111111111 --id 2222222222
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>
| 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. |
dc-cli webhook import ./myDirectory/webhooks
dc-cli webhook import ./myDirectory/webhooks --mapFile ./myDirectory/mappingFile.json
Deletes webhooks from the targeted Dynamic Content hub.
dc-cli webhook delete
| 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. |
dc-cli webhook delete
dc-cli webhook delete foo
or
dc-cli webhook delete --id foo
dc-cli webhook delete --id foo --id bar