GetCourse Integration
Automatic creation and distribution of diplomas and certificates from GetCourse after completing a training or webinar. The link to the completed diploma will be saved in the student's data in GetCourse.
Creating a process
To send requests for file creation in DiMaker, you need to create a process in GetCourse. To do this, open "Tasks" - "Processes". Then click "Create process", fill in the name and select "Object type" - "Users".
Process creation window
Next, in the process, you need to select the "Process" tab and on the right, click "Add Block" - "Operation".
Process creation window - adding URL call
In the window that appears, select "Call URL" (the very last item) and click "Save".
Process creation window - task window
This is the main window. You need to select the POST method and in the URL field, specify the request string, which should contain:
- Request address - https://dimaker.app/api/v1/create/?
- API token - secure (taken from the settings in DiMaker)
- Document ID - doc_id The document that the certificate or diploma will be based on
- Folder ID - folder_id The folder on the Drive to which the file will be saved
- Mail ID - mail_id The email template that will be used to send the file
- Replacement data, every variable starting with mask_
First, let's take a closer look at all these details, and then - how the request string should ultimately look.
Variables
There should be variables in the script that provide access to the account in DiMaker, indicate which document to use, which folder in Drive to save the file, and so on.
Mandatory form variables are marked with an asterisk.
-
secure*
A token (string, 36 characters) from the "API Tokens" page in DiMaker.
-
doc_id*
The ID of the document (string, 36 characters) to be used for creating the file. The ID can be obtained from the address bar when the document is open. The document must not be in the trash, but can be in any folder in Documents.
-
email_send
The time to send the email with the file. Can take the following values:
onfinish - Send all emails after creating all files (default)
oncreate - Send emails immediately after creating the file. When creating a single file, onfinish and oncreate are identical.
timeout - Send emails after a period of time. In this case, two additional parameters are required:
email_timeout_value - the numerical value of the interval to send emails, an integer value
email_timeout_unit - the unit of measurement of the interval. Can take the values "m" (minutes), "h" (hours), "d" (days).
Alternatively, to specify the exact sending time, the time in Unix time format can be passed in email_timeout_timestamp. If both timeout and email_timeout_timestamp are passed, the latter will take 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 created automatically when the first file is created.
-
page_id
The sequence number of the sheet (number or string) if there are multiple sheets in the document. Can pass one number (first sheet - 0), or numbers (comma-separated) of sheets to use for creating the file.
-
result
Determines how to return the result. Can take the values:
- Not present. A JSON string with the result of the script will be returned (see below)
- link. Upon successful completion of the script, a string containing a link to the created file will be returned (if multiple files were created in the script, a link to the first file is returned). To access the file itself, you need to follow the link provided. It takes time to prepare the files themselves - from 1 to 5 seconds per file. Until the file is created, the script at this address will return a 404 error. If the script does not result in the creation of a file, a JSON string with an error will be returned (see below).
- file. Upon successful completion of the script, the ready-made file itself will be returned (if multiple files were created in the script, only the first file is returned). Because creating the file takes 1-5 seconds, the return will only happen after the file is created. With a large number of script calls to the API, the file creation time will increase. If the file is not prepared within 30 seconds, the API will return a 404 error (although the script itself for creating the file will eventually be executed). If more than one script is expected to be called for the API in 5 seconds, do not use this parameter.
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, no email will be sent.
Variables
There should be at least one variable in the DiMaker document for replacement, for example %name or %city. The variable should be written in Latin script. Cyrillic %fullname or %class cannot be used. Email - %email.
When composing URLs in processes, the variable name must begin with the word mask_, followed by the variable from the Document. For example, if the document has the variable %name, then the variable name in the URL is mask_name, and if the document has the variable %city, then the variable name is mask_city. The data specified for these variables will be delivered to the Document in DiMaker when the file is created.
The data itself can be taken from what GetCourse provides, the list is on this page (section Variables for the "Users" object). The value should be in curly braces, with the prefix object., for example {object.first_name}
If you need to send a ready-made file by email, then you should use the variable mask_email, and the value - {object.email}, and if you set the name of the ready-made file - mask_filename.
There can be any number of such variables in the document. You can pass any data from the user profile in GetCourse to DiMaker, including from additional fields, in order to then apply them to the finished file.
If you need to insert the current date, a random number, or other data, you should use functions.
Forming the request string
So now you can create a URL string for the Task. It is better to do this in any editor, and then copy it into the URL field in the Task. The URL of the request can look like this (colors for convenience):
Let's look at the string in order:
- https://dimaker.app/api/v1/create/? - request address
- mask_name={object.last_name}%20{object.first_name} - the name and surname of the user from the profile in GetCourse will be substituted into the %name variable in the document. Note that a space is needed between the name and surname. Its symbol - %20
- mask_city={object.city} - the city from the profile in GetCourse will be substituted into the %city variable in the document
- mask_level={object.Уровень} - the value from the additional field "Level" from the profile in GetCourse will be substituted into the %level variable in the document
- mask_email={object.email} - visitor's email address from the profile in GetCourse
- doc_id=b75b01cf-c732-49c6-80a0-77dd051a8299 - ID of the Document in DiMaker
- folder_id=5a390b28-9845-4c01-b94a-7d252b115e2e - ID of the folder on the Disk in DiMaker
- mail_id=fb5eff48-4c08-4df7-a9e6-29e17896317c - ID of the email template in DiMaker
- secure=8453bc41-с34у-4ead-80e8-c4e76175a11b - API secret code from DiMaker
The symbol between variables is &. Spaces cannot be used. The string must be carefully composed, substituting your data and not losing any symbols. After saving the Task, connect "Start work" and "Task".
The process of creating a certificate - process
In the DiMaker settings, you need to enable receiving requests through API and then perform testing. To do this, in GetCourse, in the Process itself, click "Test", select an account, and check the box "Execute actions for real". If everything is correct, as a result, a diploma or certificate file will appear in the folder on the Disk. If you specified mail_id, the file will be sent to your email. If the file did not appear, the test window will indicate the reason why the request was not executed.
Completion of process setup
If the testing is successful, the file has been created and all the data has been filled in, you can complete the process setup. To do this, go back to the "Main" tab. In the "Bulk task creation" panel, select "Periodic checking", and in the "Object entry rule" - when to trigger the certificate issuance process. For example - "Training participant", select which training, and "Completed". As a result, GetCourse will check all visitors who have completed the specified training, and if that is the case, run the specified process. In the GetCourse Training settings, be sure to specify when the training is considered completed. After the process is launched, new tasks will be added for those visitors who meet the search criteria. Note that GetCourse checks the data every 5-15 minutes. This means that if a visitor completes a training, they will receive the certificate within 15 minutes (DiMaker processes the request immediately).
How to ensure that all current visitors who have already received a diploma through GetCourse or manually do not fall under the process? In the "Object entry rule", add another condition by clicking "and", and, for example, "Registration date", specifying the required date or visitor group.
Adding to a group after issuing the certificate
If necessary, in GetCourse you can create a group "Certificate issued" in "Users" - "Groups" and add all users who received a certificate through DiMaker to this group. To do this, in the process, after executing the URL request, add another block, operation, "Add to group", and specify this group. Then link the URL request and the addition to the group. As a result, after completing the request, the visitor will be added to the necessary group.
Saving the certificate link in the GetCourse user profile
If necessary, in GetCourse, you can save the link to the diploma or certificate in the profile of the user who received the certificate. To do this, add an additional field "Certificate" in "Users" - "Additional fields" - "Add field" - "String". Then, in the URL request in DiMaker, add &result=link, and below in the same window - "Write the result to an additional field" and select this field. As a result, after the request is completed, the link to the diploma will be added to the visitor's profile.
Manual approval of certificate issuance
If you want to manually check the name or other data before issuing a certificate, you can do it in two ways.
The first way: in the process, in the window with the URL, check the "Manager must confirm launch" box. As a result, the manager will have to approve the task for a specific visitor.
The second way: create three groups "Certificate waiting", "Issue certificate" and "Certificate issued". Then, in the processes - two processes. The first process should be triggered when the visitor completes the training and should be added to the "Certificate waiting" group, and the second process is a request in DiMaker, provided that the visitor is in the "Issue certificate" group. In the same process, you need to add two more operations - remove from the "Issue certificate" group and add to "Certificate issued". As a result, after completing the course, the visitor will be added to the "Certificate waiting" group, then the manager will have to check all the data and move the visitor to the "Issue certificate" group. As soon as the task is created, the visitor will be moved to the "Certificate issued" group.