Skip to main content

Webhooks

A webhook (also called a web callback or HTTP push API) is a way for Archeo to provide information. A webhook delivers data to other applications as it happens, and Archeo supports Resending and Alerts for the time being.

Create Webhook​

To create a new webhook, use the "Add new webhook" button.

img

Name​

Give it a name, only used in the portal.

Rest Endpoint​

The webhook endpoint, a REST Service Endpoint is an endpoint which services a set of REST resources.

Payload​

The payload is the body in the HTTP request and response message. If the 'Default alert/resend template' is not selected, or if it is explicitly chosen, the default template will be used. Depending on whether the webhook is utilized for alerting or resending, different default payloads are applied.

We utilize Liquid template language to define payloads. See liquid for more information. The payload need to validate as JSON when transformed. We support some properties (case-insensitive) depending on used in alerts or resend. You may define your own payload by using Liquid.

Alert payload​

Properties:

  • alertName
  • description
  • hits
  • threshold
  • alertTime
  • searchUrl
  • subscriptionName

Default alert payload:

{ 
"AlertName": "{{alertName}}",
"Description": "{{description}}",
"Hits": "{{hits}}",
"Threshold": "{{threshold}}",
"AlertTime": "{{alertTime}}",
"SearchUrl": "{{searchUrl}}",
"SubscriptionName": "{{subscriptionName}}"
}

Resend payload​

Properties:

  • transactionId
  • contentSasUri
  • resendDateTime
  • logStepMetaData.Description
  • logStepMetaData.Transaction_Type_Name
  • logStepMetaData.Message_Type_Name
  • logStepMetaData.Sender_Name
  • logStepMetaData.Reciever_Name
  • logStepMetaData.Status_Name
  • logStepMetaData.File_Name
  • logStepMetaData.Processed
  • logStepMetaData.metadata
  • logStepMetaData.metadata is a dictionary and can be used directly or by traversing and getting the Key and Value

Default resend payload:

{
"TransactionId": "{{transactionId}}",
"ContentSasUri": "{{contentSasUri}}",
"ResendDateTime": "{{resendDateTime}}",
"LogStepMetaData": {
"TransactionId": "{{transactionId}}",
"Description": "{{logStepMetaData.Description}}",
"TransactionTypeName": "{{logStepMetaData.Transaction_Type_Name}}",
"MessageTypeName": "{{logStepMetaData.Message_Type_Name}}",
"SenderName": "{{logStepMetaData.Sender_Name}}",
"RecieverName": "{{logStepMetaData.Reciever_Name}}",
"StatusName": "{{logStepMetaData.Status_Name}}",
"FileName": "{{logStepMetaData.File_Name}}",
"Processed": "{{logStepMetaData.Processed}}",
"Metadata": {
{% for metadata in logStepMetaData.metadata %}
"{{metadata.Key}}": "{{metadata.Value}}",
{% endfor %} }
}
}

Predefined templates​

For now we support and predefine Microsoft Teams template:

{
"@type": "MessageCard",
"@context": "http://schema.org/extensions",
"themeColor": "0076D7",
"summary": "Received an alert from Archeo",
"sections": [
{
"activityTitle": "{{alertName}}",
"activitySubtitle": "{{description}}",
"activityImage": "https://i.imgur.com/GYpdumD.png",
"facts": [
{
"name": "Alert Time",
"value": "{{alertTime}}"
},
{
"name": "Hits",
"value": {{hits}}
},
{
"name": "Threshold",
"value": {{threshold}}
}
],
"markdown": true
}
],
"potentialAction": [
{
"@context": "http://schema.org",
"@type": "ViewAction",
"name": "View search result",
"target": [
"{{searchUrl}}"
]
}
]
}

and Slack template:

{    
"blocks": [
{
"type": "section",
"text": {
"type": "mrkdwn",
"text": "*Received an alert from Archeo subscription* *{{subscriptionName}}*"
}
},
{
"type": "section",
"text": {
"type": "mrkdwn",
"text": " The alert {{alertName}} has been triggered at {{alertTime}}\n Description: {{description}}"
}
},
{
"type": "section",
"text": {
"type": "mrkdwn",
"text": "*Details:*\n Archeo has encountered {{hits}} hits, with a threshold of {{threshold}} "
}
},
{
"type": "section",
"text": {
"type": "mrkdwn",
"text": "Follow the link to get details <{{searchUrl}}}}|alert result>"
}
}
]
}

Apim Subscription Key​

Authorization Header Type​

NONE​

Use if no authorization is expected at REST endpoint

Basic​

img

Expects, the username to use for basic authentication against the endpoint and the password to use for basic authentication against the endpoint.

Oauth2​

img

FieldDescription
Authentication UrlThe url to use when authenticating with oauth against the endpoint
Client IdThe client id to use when contacting the endpoint
Client SecretThe client secret to use when contacting the endpoint
Grant TypeThe grant type to use when contacting the endpoint. Eg. client_credentials
ResourceThe resurce to use when contacting the endpoint.

Mange Webhooks​

All webhooks are listed, use the menu far right to edit or delete.

img