Integration with Typeform
Automatic creation and distribution of diplomas and certificates from Typeform after completing a survey. Any data obtained in the survey will be inserted into a ready-made diploma or certificate.
Adding variables
Open the required survey in Typeform, and within it, the question to which you need to add the answer to the document. Then copy its ID from the address bar (the text following block=).
The question ID in Typeform
Then, in the document, add a text field, in which you insert a variable equal to this ID (i.e. add a percentage sign before the ID without a space). The answer to this question will be placed in that space. You can format the text in advance to make it look the way you need.
The document in DiMaker with the question ID
You can add any number of text blocks and variables. DiMaker can insert data from the following Typeform fields: Short Text, Long Text, Phone Number, Email, Website, Number, Date, Ranking, Option Scale, Rating, Matrix, Multiple Choice, Yes/No.
Human-readable IDs
To make working with variables more convenient, publish the survey in Typeform. Then, in the settings, click on "Block references" and set understandable IDs (for example, last_name or first_name).
Block references in Typeform
In this case, in the DiMaker document, you can use these variables (with the % sign before the ID, for example %last_name).
The document in DiMaker with the question ID
Creating a webhook
In order for Typeform to send data after completing a survey, you need to add a webhook. To do this, while in the necessary survey, click "Connect" - "Webhooks". Then - "Add a webhook".
Adding a webhook in Typeform
When adding a webhook, it is important to correctly specify the Endpoint (access point).
https://dimaker.app/api/v1/typeform-create/
In addition, you need to add several variables:
-
secure*
A token (string, 36 characters) from the "API Tokens" page.
-
doc_id*
The document ID (string, 36 characters) that will be used to create the file. The ID can be obtained from the address bar when the document is open. The document should not be in the trash, but can be in any Folder.
-
mail_id
The ID of the email template (string, 36 characters) to be sent by email. The ID can be obtained from the address bar when the template is open. If the variable is not passed, the email will not be sent.
-
email_send
The time to send the file by email. Can take the following values:
onfinish - Send all emails after all files are created (by default)
oncreate - Send emails immediately after the file is created. When creating only one file, onfinish and oncreate are identical.
timeout - Send emails after a period of time. In this case, you need to pass two more parameters:
email_timeout_value - numerical value of the period of time in which to send emails, integer value
email_timeout_value - unit of measurement of the period of time. Can take the values "m" (minutes), "h" (hours), "d" (days).
Or, to specify the exact time of sending, you need to pass the time in unix time format to email_timeout_timestamp. If both timeout and email_timeout_timestamp are passed, the latter will have priority. -
folder_id
The ID of the folder in Drive (string, 36 characters) to save the files. If the folder does not exist, it will be automatically created when the first file is created.
-
page_id
The ordinal number of the sheet (number or string), if there are multiple sheets in the document. You can pass one number (the first sheet is 0), or numbers (separated by commas) of sheets that should be used to create the file.
If you need to insert the current date, a random number, or other data - you should use functions.
Creating an Access Point
Now, we can create an access point. It's better to do this in any text editor and then copy it to the Endpoint field in the add webhook window. The URL can look like this (colors for convenience):
Let's break down the string in order:
- https://dimaker.app/api/v1/typeform-create/? - endpoint address
- doc_id=b75b01cf-c732-49c6-80a0-77dd051a8299 - Document ID
- folder_id=5a390b28-9845-4c01-b94a-7d252b115e2e - Folder ID on Drive
- mail_id=fb5eff48-4c08-4df7-a9e6-29e17896317c - Template Email ID
- secure=8453bc41-с34у-4ead-80e8-c4e76175a11b - API Token
The sign & is used between variables. Spaces cannot be used. Carefully compose the string, substituting your data and not missing any characters. After pasting the URL, save the webhook.
Everything is ready! It remains to check how everything works. To do this, fill out your survey. If everything is set up correctly, a diploma or certificate file will appear in the folder on Drive. If you specified mail_id, the file will be sent to your email. If the file did not appear, check the webhook history in Typeform and in the "View deliveries" section, the "Response" tab will indicate the reason.