# Form Completion Webhooks

{% embed url="<https://youtu.be/7FTw-dRMYKY?si=bKscULqhRL_4MwoV>" %}

### Types of Webhooks

There are two types of webhooks which will be sent off depending on the number of Prompts your Smart Form has. If your form only contains a single prompt, it will use the Legacy Webhook. If it contains more than one prompt, it will use the Prompt Chaining Webhook. **This is automatically determined based on the number of Logic Steps your form contains.**

* [Legacy Webook](#setting-up-your-webhook)
* [Prompt Chaining Webhook](#prompt-chaining-webhook)

## Legacy Webhook

After adding your webhook to the input field, you will receive an output similar to one below.

Webhook Fields

<table><thead><tr><th>Field name</th><th>Meaning</th><th data-hidden></th></tr></thead><tbody><tr><td>form_name</td><td>Form Title</td><td></td></tr><tr><td>creator_email</td><td>Your email</td><td></td></tr><tr><td>submission_date</td><td><p>The date which the form was submitted by </p><p>the user</p></td><td></td></tr><tr><td>processing_time</td><td>The time in seconds that it took from the user to hit submit to the time which the form results were displayed to them</td><td></td></tr><tr><td>ai_response</td><td>The AI result</td><td></td></tr><tr><td>personality</td><td>The form's personality name</td><td></td></tr><tr><td>form_data</td><td>The questions and answers of the form, formatted as a json object</td><td></td></tr></tbody></table>

Sample response

{% code overflow="wrap" %}

```json
{
    "form_name": "Marketing Feedback Form",
    "creator_email": "<creator_email>",
    "submission_date": "Mar 24, 2023 3:20 pm",
    "processing_time": 15,
  	"ai_response": "Digital Marketing Campaign Ideas: 
                        1. Create an Instagram account for Formwise and post content related to marketing tips, strategies, and advice. This will help to establish Formwise as an authority in the marketing industry and will help to build trust with potential customers. 

                        2. Utilize Instagram Ads to target small businesses in the marketing industry. This will help to increase brand awareness and reach a larger audience. 

                        3. Create a series of Instagram stories that feature customer testimonials and success stories. This will help to build trust with potential customers and show them the value of Formwise's services. 

                        4. Utilize influencer marketing to reach a larger audience and increase brand awareness. This can be done by partnering with influencers in the marketing industry who have a large following on Instagram. 

                        5. Create an Instagram hashtag for Formwise and encourage customers to use it when posting about their experiences with the company. This will help to increase engagement and reach a larger audience. 
                      
                      Outline for Proposal: 
                      I. Introduction 
                      A. Overview of Formwise 
                      B. Overview of Digital Marketing Campaign 
                      II. Goals & Objectives 
                      A. Increase Brand Awareness 
                      B. Increase Engagement 
                      C. Reach a Larger Audience 
                      III. Strategies & Tactics 
                      A. Create an Instagram Account 
                      B. Utilize Instagram Ads 
                      C. Create a Series of Instagram Stories 
                      D. Utilize Influencer Marketing 
                      E. Create an Instagram Hashtag 
                      IV. Timeline & Budget 
                      A. Timeline for Implementation 
                      B. Budget for Campaign 
                      V. Conclusion",
    "personality": "John the Marketing Guy",
	"form_data": {
        "Email": "usersemail@gmail.com",
        "Phone": "5555555555",
        "Industry": "Marketing",
        "Channels": "Instagram",
        "Target": "Small Businesses",
        "Business Name": "Formwise",
    }
}
```

{% endcode %}

## Prompt Chaining Webhook

After adding your webhook to the input field, you will receive an output similar to one below.

Webhook Fields

<table><thead><tr><th>Field name</th><th>Meaning</th><th data-hidden></th></tr></thead><tbody><tr><td>form_name</td><td>Form Title</td><td></td></tr><tr><td>submission_id</td><td>The unique ID associated with the user's response</td><td></td></tr><tr><td>creator_email</td><td>Your email</td><td></td></tr><tr><td>submission_date</td><td><p>The date which the form was submitted by </p><p>the user</p></td><td></td></tr><tr><td>ai_response</td><td>A list of "Logic Steps" which correspond to the individual personalities as well as their individual answers</td><td></td></tr><tr><td>personality</td><td>The last personality in the Prompt chain</td><td></td></tr><tr><td>form_data</td><td>The questions and answers of the form, formatted as a json object</td><td></td></tr></tbody></table>

{% code overflow="wrap" %}

```json
{
  "form_name": "Facebook ad generator",
  "submission_id": "1684524905152x380754831786239360",
  "logic_step": 3,
  "creator_email": "test@test.com",
  "submission_date": "2023-05-19T19:35:23.436Z",
  "ai_response": {
    "@Step_1": "\"Revolutionize your business with Formwise - AI Software Development experts based in Georgia. Transform the way you work with smart automation tools built to streamline your processes and boost productivity. Say goodbye to manual data entry and paperwork and hello to effortless efficiency. Discover Formwise today!\"",
    "@Step_2": "\"Streamline Your Business with Formwise - AI Software Development Experts\"",
    "@Step_3": "Revolutionize your business workflow with Formwise - AI Software Development experts based in Georgia. Transform your day-to-day operations with cutting-edge automation tools specifically built to streamline your business processes and maximize productivity. Say goodbye to manual data entry and paperwork and say hello to smooth sailing. Experience the power of Formwise today!"
  },
  "personality": "Intake 2",
  "form_data": {
    "Company name": "Formwise",
    "Location": "Georgia",
    "Phone number": "1231232321",
    "Company type": "AI Software Development",
    "Email": "test@test.com",
    "Phone": "1232322122"
  }
}
```

{% endcode %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://manual.formwise.ai/formwise/integrations/formwise-api/form-completion-webhooks.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
