Chatbot widget

Documentation: Chatbot widget

To get our chatbot on your job-page, you need to add our HTML-code snippet. The default snippet is as follows:

<div id="chatBot"></div> 
<script>
    let donnaKnows = document.createElement("script");
    donnaKnows.setAttribute("id", "DonnaBot");
    donnaKnows.setAttribute("src", "https://{CUSTOMER_URL}/widget/js/widget.js");
    donnaKnows.setAttribute("backend", "https://{CUSTOMER_URL}/chat/{JOB_ID}");
    document.body.appendChild(donnaKnows);
</script>

Explanation of variables

FieldMandatoryDescription / behavior
CUSTOMER_DOMAINYesThe domain created for the tenant/customer. Depending of the environment you working on this domain is postfixed with .test.donnaknows.com (for test environment) or .test.donnaknows.com (for production environment).
JOB_IDYesThe unique ID for the job or personality assessment created in the DonnaKnows environment.

Extra variables

It is possible to send extra variables to the DonnaKnows backend by adding a data attribute to the the widget and add JSON-style content. An example of that possibility:

<div id="chatBot"></div>
<script>
    let donnaKnows = document.createElement("script");
    donnaKnows.setAttribute("id", "DonnaBot");
    donnaKnows.setAttribute("data", '{"tracking_id": "UA-1847-NL", "firstname": "John", "lastname": "Doe"}');
    donnaKnows.setAttribute("src", "https://{CUSTOMER_URL}/widget/js/widget.js");
    donnaKnows.setAttribute("backend", "https://{CUSTOMER_URL}/chat/{JOB_ID}");
    document.body.appendChild(donnaKnows);
</script>

Explanations of variables

FieldMandatoryDescription / behavior
firstnameNoThe first name of the candidate. If this value is set it will be filled in the first name field of the candidate record will be pre-filled. If this field is pre-filled the chatbot will not ask candidates first name.
lastnameNoThe lastname of the candidate. If this value is set it will be filled in the lastname field of the candidate record will be pre-filled. If this field is pre-filled the chatbot will not ask candidates lastname.
emailNoThe email of the candidate. If this value is set it will be filled in the email field of the candidate record will be pre-filled. If this field is pre-filled the chatbot will not ask candidates email address.
cityNoThe residence of the candidate. If this value is set it will be filled in the city field of the candidate record will be pre-filled. If this field is pre-filled the chatbot will not ask candidates residence.
Even if the chatbot settings for this field is set to ask candidate for input.
zipNoThe zip of the candidate. If this value is set it will be filled in the zip field of the candidate record will be pre-filled. If this field is pre-filled the chatbot will not ask candidates zip.
Even if the chatbot settings for this field is set to ask candidate for input.
streetNoThe street of the candidate. If this value is set it will be filled in the street field of the candidate record will be pre-filled. If this field is pre-filled the chatbot will not ask candidates street.
Even if the chatbot settings for this field is set to ask candidate for input.
house_nrNoThe house number of the candidate. If this value is set it will be filled in the house_nr field of the candidate record will be pre-filled. If this field is pre-filled the chatbot will not ask candidates house number.
Even if the chatbot settings for this field is set to ask candidate for input.
phoneNoThe phone of the candidate. If this value is set it will be filled in the phone field of the candidate record will be pre-filled. If this field is pre-filled the chatbot will not ask candidates phone.
Even if the chatbot settings for this field is set to ask candidate for input.

Extra fields

The data attribute may also be used to provide custom data you need for your own proces like a tracking ID or other internal identification. You are free to provide these values as key-value-pairs via the data attribute. These values don’t affect the functionality of the chatbot or internal working of DonnaKnows.

We store these values in as extra_fields in the candidate record and provide them back via the API.

Example of candidate response (call: [CUSTOMER_DOMAIN]/api/v1/job/[JOB_ID]/candidates/[CANDIDATE_ID]):

{
    "data": {
        "id": "639b8f20-7b3e-4a0f-93b6-819e9704b47c",
        "firstname": "John",
        "lastname": "Doe",
        "email": "john.doe@donnaknows.com",
        "phone": null,
        "street": null,
        "house_nr": null,        
        "zip": null,
        "city": null,
        "humanskills_match": 87.5,
        "hardskills_match": 75,
        "total_match": 81.25,
        "documents": {
            "match": true
        },
        "extra_fields": {
            "tracking_id": "ABC133"
        }
    }
}

Use chatbot as form

It is also possible – not recommended – to use the chatbot as a normal application form. All questions the chatbot normally ask will now be present in a form. To use the chatbot as form you can simply set the asForm parameter to true:

<div id="chatBot"></div>
<script>
    let donnaKnows = document.createElement("script");
    donnaKnows.setAttribute("id", "DonnaBot");
    donnaKnows.setAttribute("asform", "true");
    donnaKnows.setAttribute("src", "https://{CUSTOMER_URL}/widget/js/widget.js");
    donnaKnows.setAttribute("backend", "https://{CUSTOMER_URL}/chat/{JOB_ID}");
    document.body.appendChild(donnaKnows);
</script>

When you use the chatbot as form, the color you supply for the chatbot will also be present in buttons colors etc.