logo

Introduction

Our webhooks make it easy to receive real-time user response data from 1Flow, and for your systems to communicate back.
Enabling webhook alerts means that each time a new survey response is collected by 1Flow, we will send you the response data, along with contextual information such as the user's identity and details of the trigger event.
For example, let's say you are developing a meditation 🧘‍♀️ app, and have implemented a post-meditation survey for user to rate their experience (expand to read more).

Subscribing to Alerts

To receive events, you must first define the URL to which we should send the HTTP POST requests. The POST requests will have a content-type of application/json.
  • Go to your 1Flow dashboard's Settings page.
  • Click on the Project Settings tab. On this page, navigate to the Project webhook alerts section.
  • Enter the URL to which we should send the HTTP POST requests.
  • Check the checkbox to enable us to send you alerts.
  • Click the “Save” button to confirm your alerts.
⚠️
Make sure to check the box that enables us to send alerts to you. If the checkbox is un-selected, you will not receive any alerts.

Responding to Alerts

To ensure successful receipt of webhook events/alerts, your server must respond within 10 seconds with an HTTP 200 status code. In case of any other response, or if there is no response within 10 seconds, we will retry the call to your webhook URL every 60 minutes for a maximum of 3 days.

Webhook Payload

Here is an example of webhook data you can expect to receive from our server.
json
{ "alert_name": "submitted_survey", "alert_id": "6425124d1b026625c189cac0", "project_name": "Survey Responses", "survey_id": "30cc805f1f0c541d4dcfccef", "platform": "windows", "survey_info": { "name": "Net Promoter Score (NPS)", "screens": [ { "title": "How likely are you to recommend us to a friend or co-worker?", "answer": "10", "type": "nps" }, { "title": "What's the reason for this score?", "answer": "best user experience", "type": "text" } ] }, "user": { "user_system_id": "sdk_system_id_1680151080658", "parameters": { "firstName": "John", "lastName": "Wick" } }, "timestamp": "2022-09-30T03:26:24.894Z", "trigger_event": { "event_name": "complete_meditation", "parameters": { "content_id": "1234abcdef56", "session_id": "4abcdef56" } } }
Field Name
Type
Description
survey_id
string
The ID of the submitted survey
alert_id
string
The unique identifier for this webhook alert
project_name
string
The name of the project associated with the survey
platform
string
The platform on which the survey was submitted
survey_info.name
string
The name of the submitted survey
survey_info.screens[].title
string
The title of the survey question
survey_info.screens[].answer
string
The answer provided by the user
survey_info.screens[].type
string
The type of question shown to the user Supported screen types text , nps, mcq, checkboxrating-numerical, rating-5-star ,rating-emojis
user.user_system_id
string
The user's unique identifier in your app system
user.parameters
object
Custom values in the key and value pair
timestamp
date
ISO timestamp when user submitted the survey
trigger_event.event_name
string
The name of the event that triggered the survey
trigger_event.parameters
object
Custom values in the key and value pair