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.
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.
Create a New Typeform, click on Start from scratch, name your form and click on continue:
⏬
⏬Add a first question via the "+" button at the top left of the screen, then choose Short text :
Change the title of the question as desired to find out the title of the project the client wants to add:
Delete the other questions present by default on the form.
Add a second question of type Number in order to know the number of pax in the project:
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):
Do the same for the end date of the project.
Finally, add a Number question to find out your client's initial budget :
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 :
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:
Log in or create a free account at Zapier.com
Click on "MAKE A ZAP":
Give your "Zap" a name
Search for Typeform in the Trigger field, then select it.
Choose New entry for the Trigger event field and click continue.
Sign in to your Typeform account and click Continue :
In the Set up trigger menu, choose the form you have just created from the list of available forms (see previous chapter) :
Then click on Test trigger, then Continue.
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.
Fill in the fields in the Actions section exactly like this :
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
returnReplace the values <YOUR_API_KEY>, <YOUR_EMAIL> and <YOUR_PASSWORD> in 'Your credentials' with your own.
Then click on Continue, Test & continue.
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.
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:
Fill in the form.
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.
🚀 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.