To get lead data or any data from your site you need to create an automation with a Webhook trigger.
- On your computer, go to your Account
- Click Automation in the left-side menu.
- Click on the Create button.
- Select Webhook from the trigger.
- Click the Webhook gear icon to open webhook settings to obtain the webhook URL.
- And now call a Post request to this Webhook URL, with the required data (firstName, lastName, email, and phone).
- Click Save.
Do not delete the the Webhook and ensure you use the RBG WP Plugin or use your custom script to send lead data by POST request.
Request Body (JSON):
{
"firstName": "John",
"lastName": "Doe",
"email": "[email protected]",
"phone": "9876540000"
}
Validation Rules:
firstName → required, string
lastName → required, string
email → required, valid email format
phone → required, valid phone number
:point_right: If any field is missing or invalid → API should return 400 Bad RequestImportant Notes
- Content-Type must be: application/json
- All fields are mandatory
- Do not send empty strings ("")
- Ensure proper email & phone format
Example: Using Fetch (JavaScript)
fetch(Endpoint: webhook URL, {
method: "POST",
headers: {
"Content-Type": "application/json",
},
body: JSON.stringify({
firstName: "John",
lastName: "Doe",
email: "[email protected]",
phone: "9876543210",
}),
}).then((res) => res.json())
.then((data) => console.log(data))
.catch((err) => console.error(err));
Expected Success Response
{
"success": true,
"message": "Execution successfully"
}Summary
- Method → POST
- Endpoint → Red belt gym webhook url
- Body → JSON with 4 required fields
- Response → success or validation error