All Collections
Advanced
Realtime Webhook
Realtime Webhook
Patrick avatar
Written by Patrick
Updated over a week ago

If your webhook isn't able to respond immediately, you may need to trigger a custom request to Frontly's Realtime Webhook endpoint to return data back to the app in real-time.

Here are the steps:

1. Make your Webhook request

Note: Frontly will automatically include instance_id and app_id fields to the body of your outgoing webhook request. These act as unique identifiers for this specific instance of a request. You will need to collect the instance_id and app_id from the initial request and send them in the return it back when you make your request to Frontly's Realtime Webhook endpoint.

In your Webhook action step, turn on the 'Wait For Realtime Webhook' toggle, which tells Frontly to wait for you to make a request to the Realtime Webhook endpoint before continuing to the next steps.


2. Make a request to the Realtime Webhook endpoint

To return data back to Frontly in real-time, you will make a POST request to the https://api.frontly.ai/realtime_webhook/ endpoint.

Example Request Body:

{
"app_id": "790",
"instance_id": "h507tmp3j8j0",
"api_key": "9kd28hf28hf92jf29j",
"data": {"your_custom_field": "some_value"}
}

app_id - Included in the initial webhook request sent from Frontly

instance_id - Included in the initial webhook request sent from Frontly

api_key - Your Frontly API Key found in settings

data - A custom object including data to return to Frontly in real-time


3. Using the response

Any step that follows your Webhook request will can access the response, which includes your custom data.

For example, if your response data object is {"your_custom_field": "some_value"} then you could access the value with the {{ actionSteps.1.your_custom_field }} variable.

Did this answer your question?