Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 12 Next »

A webhook integration allows you to send BloxOne notifications to a designated application by using a unique URL. When setting up your webhook service, you can choose to use the default webhook template or construct a custom template for a specific payload for your webhook notification.  

In this dialog, you will be configuring a webhook integration that allows you to send BloxOne notifications to a designated application using a unique URL.

Complete the following to set up the webhook service:

  • Type: From the drop-down menu, select Custom to set up a webhook integration.
  • Name: Enter the name of the webhook service. BloxOne uses this name on the Notification Settings page, for configuration purposes. For more information, see Configuring Notification Settings.
  • URL: Enter the URL of the application to which you want BloxOne to send notifications. Email notifications in a standardized JSON format are sent to this URL.
  • Authentication: From the drop-down menu, choose the authentication method for this webhook integration:
    • None: No authentication is required for this integration.
    • Basic: Enter the username and password for basic authentication.
    • Token: Enter the access token to be used for authentication.  
  • Template: A template determines the output of your webhook notification. You can create a custom webhook template in the editor provided here.  BloxOne supports the Go template format: a standard template used to generate textual output. For information about Go templates, see https://pkg.go.dev/text/template. If you do not provide a custom template, BloxOne generates the payload according to the supported fields in the default template. For more information, see Default Webhook Template and Supported Keys.

    Note the following when creating a custom webhook template:

  • You can include actions in your template by specifying user-defined key-value pairs in Webhook Context. When generating the payload, BloxOne uses the keys and values you define. 

  • If you compose a valid template but have not defined any key-value pairs in Webhook Context, then BloxOne obtains the values from the database, if the values exist. For the keys that do not have values, only the key names with empty values will appear in the payload.

  • If you compose a valid template but do not include certain keys you have defined in Webhook Context, BloxOne ignores those key-value pairs, so they will not appear in the payload.

  • If your custom template includes supported keys from the default template, and if you have defined key-value pairs for them in Webhook Context, the user-defined values will override the default values, if applicable.

The following is an example of a simple Go template: 

Customer: {{ .customer_name}} 
Application: {{ .application_name}} 
Message: {{ .message}}

You define values for customer_name and application_name in the Webhook Context field. Note that Message is an Infoblox-defined field.

The following is an example of how to use the actionable_redirect_action and actionable_redirect_label keys:

{{if $url:=.actionable_redirect_action}}
ActionableRedirectUrl: {{$url}}
{{if $text:=.actionable_redirect_label}}
ActionableRedirectText: {{$text}}
{{else}}ActionableRedirectText: {{$url}}  {{end}}
{{end}}

For more information about the default template and supported keys, see Default Webhook Template and Supported Keys.

You can also use the BloxOne API to create a custom template. For more information about using the notification APIs, see BloxOne Cloud > Notifications config in 
https://csp.infoblox.com/apidoc.

  • Webhook Context: In the JSON editor, specify key-value pairs for the actions in your webhook template. You can also specify HTTP header overrides used to generate the webhook notification.

Based on the template example above, you might define the following key-value pairs:


{

    "customer_name": “John Doe”,

    "application_name": "BloxOne DDI",

    "Authorization": ["Basic YWxhZGRpbjpvcGVuc2VzYW1l", "http-header:true"],

    "Content-type": ["application/xml", "http-header:true "]

	“actionable_redirect_action”: “https://actionable.redirect.url.com”,

	“actionable_redirect_label”: “actionable redirect link text”

}

Note that the actionable_redirect_label key is optional. If it is missing, the default value would be the value in actionable_redirect_action. In addition, if actionable_redirect_action is missing, neither ActionableRedirectUrl nor ActionableRedirectText will show up in the HTTP payload.

The webhook context must be in a valid, non-nested JSON format.

Based on the examples given in the Template and Webhook Context fields, BloxOne generates the following:

 HTTP headers:

"Authorization": ["Basic YWxhZGRpbjpvcGVuc2VzYW1l"]    

"Content-type": ["application/xml"]

HTTP payload:

Customer:  John Doe,

Application:  BloxOne DDI

Message:  Internal error occurred. For more details, see log for request 1a94821f-0f7a-48ab-b1cf-b137d628afd4

ActionableRedirectUrl: https://actionable.redirect.url.com

ActionableRedirectText: actionable redirect link text

Click Validate after you complete the template and webhook context. BloxOne validates the JSON schema you have entered and sends an error if the template or webhook context is not in a valid JSON format.

Click Save & Close.


Note

After you have added or configured new services, they will appear in the Application Notifications section of the Notification Settings page. Ensure that you select the new services if you want to send notifications to them. For information on how to configure notification settings, see Configuring Notification Settings.
  • No labels