All Collections
Integrations
How to integrate Typeform with Ezus?
How to integrate Typeform with Ezus?

Give your customers the ability to create their own travel plans in Ezus via a custom Typeform.

Charles Gombert avatar
Written by Charles Gombert
Updated over a week ago

Summary:

An Ezus API key is necessary to perform the automation so make sure to have one before doing the tutorial (more information about Ezus public API can be found here.)


1. Creating the Typeform

In the first part, we will create the form to send to your customers so that they can create their project in 30 seconds.

  1. Log in to your Typeform account.
    If you don't have an account yet, you can create one in a few clicks directly on their website.

  2. Create a New Typeform, click on Start from scratch, name your form and click on continue:




  3. Add a first question via the "+" button at the top left of the screen, then choose Short text :

  4. Change the title of the question as desired to find out the title of the project the client wants to add:


  5. Delete the other questions present by default on the form.

  6. Add a second question of type Number in order to know the number of pax in the project:

  7. Create a new question of type Date to find out the start date of the project (you can change the date format in the right sidebar):


  8. Do the same for the end date of the project.

  9. Finally, add a Number question to find out your client's initial budget :

  10. You can customize the appearance of your form via the Design section. You can also customize the end page of the form which is located at the bottom left of the workspace :

  11. When finished, click on Publish at the top right of the workspace.

Please note that if you have chosen a paid template, Typeform may ask you to update your plan before you can continue.

Your Typeform form is now created and online! All that remains is to connect it to Ezus using the Zapier automation tool.



2. Automation with Zapier

To send the answers to the form directly to Ezus by creating a new project, we will use the Zapier tool:

  1. Log in or create a free account at Zapier.com

  2. Click on "MAKE A ZAP":

  3. Give your "Zap" a name

  4. Search for Typeform in the Trigger field, then select it.

  5. Choose New entry for the Trigger event field and click continue.

  6. Sign in to your Typeform account and click Continue :


  7. In the Set up trigger menu, choose the form you have just created from the list of available forms (see previous chapter) :

  8. Then click on Test trigger, then Continue.

  9. In the Actions section, search for "**Code by Zapier**" and select it. In the Action Event drop-down menu, choose Run Python. Click on Continue.

  10. Fill in the fields in the Actions section exactly like this :

  11. Copy the text lines from this file and replace the Code field as follows :

    import requests 
    import uuid
    import json

    ## Your credentials - modify this with your credentials
    API_KEY = "<YOUR_API_KEY>"
    EMAIL = "<YOUR_EMAIL>"
    PASSWORD = "<YOUR_PASSWORD>"
    ## END

    url = "https://api.ezus.app/login"
    payload = {"email": EMAIL, "password": PASSWORD}
    headers = {'X-API-KEY': API_KEY}
    response = requests.request("POST", url, headers=headers,
    data=json.dumps(payload, default=str)).json()
    token = response["token"]
    url2 = "https://api.ezus.app/projects-upsert"
    payload2 = {
    "reference": str(uuid.uuid4()),
    "info_title": input_data['info_title'],
    "trip_people": input_data['trip_people'],
    "trip_budget": input_data['trip_budget'],
    "trip_date_in": input_data['trip_date_in'],
    "trip_date_out": input_data['trip_date_out'], }

    headers2 = {'Authorization': 'Bearer ' + token, 'X-API-KEY': API_KEY}
    try:
    requests.request("POST", url2, headers=headers2, data=json.dumps(payload2, default=str), timeout=0.001)
    except:
    pass
    return

  12. Replace the values <YOUR_API_KEY>, <YOUR_EMAIL> and <YOUR_PASSWORD> in 'Your credentials' with your own.

  13. Then click on Continue, Test & continue.

  14. If you have followed the tutorial correctly, Zapier will return the following message :

    If this is not the case, you can start the tutorial of this chapter again.

  15. Finally click on Turn on Zap to bring your configuration online.


And that's it, Typeform is integrated to your Ezus account!


3. Functional test

Here is the test you have to do in order to check if Typeform is well integrated to your account:

  1. Fill in the form.

  2. Then go to your ezus account, or reload the page if you are already connected. The created project should appear!
    If it is not the case, check that you have followed the tutorial correctly, or start again if you can't find the error.

  3. 🚀 To share the form, simply copy the form link that you can find on Typeform to send it to your customers.

🚒 If you get an error message: On free Zapier plans, execution is limited to 1 second so you may get "Your code had an error! Traceback (most recent call last): XXXX Task timed out after 1.00 seconds." If this is the case then you need to go through a paid plan or another application than Zapier for the code to run.

Did this answer your question?