**Version:** 1.0 | **Last Updated:** 18/12/2024
### Overview
- **Integration Name:** Webhook Push
- **Purpose:** Allows sending alerts to MoovingON AI platform via webhook integration using Basic Authentication.
- **Audience:** Support team, TAM
- **Prerequisites:** Administrator role in MoovingON AI
---
## Table of Contents
- [[#Setup Instructions]]
- [[#Configuration]]
- [[#Testing the Integration]]
- [[#Troubleshooting]]
- [[#FAQs]]
- [[#Related Links]]
---
### Setup Instructions
1. From the left-hand side of the UI, click on **Settings** > **Integrations** > **Plugins**.
![[Integrations-Plugins.png]]
2. On the right-hand side of the screen, select **Integrations** and then click on **Add Webhook**.
![[Webhook.png]]
3. Add a name for the incoming API and press **Submit**.
****
4. After submission, a **Username** and **Password** will be generated.
****
5. Generate the Basic Authentication Header from the Username and Password using [this tool](https://www.blitter.se/utils/basic-authentication-header-generator/).
6. Use the following API endpoint to send alerts:
- **URL:** {ENDPOINT}
- **Method:** POST
---
### **Configuration**
**Mandatory Fields:**
- `host`: The device name.
- `service`: The metric check.
- `severity`: The alert severity (e.g., critical).
- `recovery`: Boolean (true or false). Defaults to false if not provided.
**Optional Fields:**
- `value`: Use for alert metrics like trends.
- Any other fields will be added as tags in the alert for viewing.
**Example JSON Payload:**
```
{
"severity": "critical",
"recovery": true,
"host": "website",
"service": "HTTP Request",
"customer_id": "1",
"Fail_msg": "Connection Timeout"
}
```
---
### Testing the Integration
1. Use the following **cURL** command to test the integration:
```
curl --location --request POST 'https://<Username>:<Token>@{ENDPOINT}' \
--header 'Content-Type: application/json' \
--data-raw '{
"severity": "critical",
"recovery": true,
"host": "SecurityDAM website",
"service": "HTTP Request",
"customer_id": "1",
"Fail_msg": "Connection Timeout"
}'
```
2. Expected result: **HTTP 200 OK** response.
---
### Troubleshooting
**Common Issues:**
- **401 Unauthorized:** Ensure the Basic Authentication Header is generated correctly.
- **400 Bad Request:** Check for missing mandatory fields in the payload.
- **500 Internal Server Error:** Verify the API endpoint and payload format.
---
### FAQs
**Q:** What happens if the `recovery` field is not sent?
**A:** The system defaults to `false`.
**Q:** Can I include additional custom fields?
**A:** Yes, additional fields will be added as tags and can be used for viewing alert information.
---
### Related Links
**External Resources:** [Basic Authentication Header Generator](https://www.blitter.se/utils/basic-authentication-header-generator/)