younifyd
Menu

Preview Webhook Request

Preview Webhook Request

POST/hubs/{hubId}/webhooks/{webhookId}/requests/{requestId}/preview

Use it in a workflow

  1. Add a step and choose the Amplience connector.
  2. Pick the Preview Webhook Request action (under Webhooks).
  3. Fill in the fields below, then reference the result from later steps as {{previewWebhookRequest.response.data}}.

Request

Path parameters

hubIdstringrequired

Hub ID

webhookIdstringrequired

Webhook ID

requestIdstringrequired

Webhook Request ID

Request body

Enter the body as JSON in the step's Body field.

urlstringrequired

Webhook handler URL

methodstringrequired

Webhook HTTP method

One ofPOSTPUTPATCHDELETE

secretstringrequired

Shared secret between the handler and DC

filtersarray<object>
typestringrequired

Type of filter

headersarray<object>

List of additional headers

keystringrequired

header key

valuestring

header value

secretboolean

Indicates thats this header value is sensitive

customPayloadobject

Custom Payload

typestringrequired

Type of Custom Payload

One oftext/x-handlebars-template

valuestringrequired
errorobject1 fields
json
{
  "url": "http://example.com/webhook",
  "method": "POST",
  "secret": "my-subscription-secret",
  "filters": [
    {
      "type": "equal",
      "arguments": [
        {
          "jsonPath": "$.payload.id"
        },
        {
          "value": "abc"
        }
      ]
    },
    {
      "type": "in",
      "arguments": [
        {
          "jsonPath": "$.payload.id"
        },
        {
          "value": [
            "abc",
            "def"
          ]
        }
      ]
    },
    {
      "type": "equal",
      "arguments": [
        {
          "jsonPath": "$.payload.not_present"
        },
        {
          "value": "123"
        }
      ]
    }
  ],
  "headers": [
    {
      "key": "X-Additional-Header",
      "value": "abc123",
      "secret": true
    }
  ],
  "customPayload": {
    "type": "text/x-handlebars-template",
    "value": "{{#withDeliveryContentItem contentItemId=payload.rootContentItem.id account=\"account-name\" stagingEnvironment=\"staging-environment-url\"}} ... {/withDeliveryContentItem}}",
    "error": {
      "message": "string"
    }
  }
}

Response

Returns 200 with an object. Read it in later steps with {{previewWebhookRequest.response.data.<field>}}.

previewStatestring

One ofSUCCESSPROCESSING_FAILEDFILTERED

requestobject
urlstring
headersobject
customHeadersarray<object>3 fields
bodystring
evaluatedFiltersobject
filtersarray<object>1 fields
resultsarray<object>1 fields
customPayloadobject

Custom Payload

typestringrequired

Type of Custom Payload

One oftext/x-handlebars-template

valuestringrequired
errorobject1 fields
_linksobject
requestobject1 fields
json
{
  "previewState": "SUCCESS",
  "evaluatedFilters": {
    "filters": [
      {
        "type": "equal",
        "arguments": [
          {
            "jsonPath": "$.payload.id"
          },
          {
            "value": "abc"
          }
        ]
      },
      {
        "type": "in",
        "arguments": [
          {
            "jsonPath": "$.payload.id"
          },
          {
            "value": [
              "abc",
              "def"
            ]
          }
        ]
      },
      {
        "type": "equal",
        "arguments": [
          {
            "jsonPath": "$.payload.not_present"
          },
          {
            "value": "123"
          }
        ]
      }
    ],
    "results": [
      {
        "status": "UNMATCHED"
      },
      {
        "status": "MATCHED",
        "index": 1
      },
      {
        "status": "IGNORED"
      }
    ]
  },
  "_links": {
    "request": {
      "href": "https://api.amplience.net/v2/content/hubs/00112233445566778899aabb/webhooks/00112233445566778899aabb/requests/00112233445566778899aabb"
    }
  },
  "request": {
    "url": "string",
    "headers": {},
    "customHeaders": [
      {
        "key": "X-Custom-Header",
        "value": "123",
        "secret": false
      }
    ],
    "body": "string"
  },
  "customPayload": {
    "type": "text/x-handlebars-template",
    "value": "{{#withDeliveryContentItem contentItemId=payload.rootContentItem.id account=\"account-name\" stagingEnvironment=\"staging-environment-url\"}} ... {/withDeliveryContentItem}}",
    "error": {
      "message": "string"
    }
  }
}

Need more? See the Amplience guide for connection setup and behaviour shared by every action.