Skip to content

Triggering surveys with nps.today

This chapter will focus on different ways to trigger surveys with nps.today. Here we will go through API, sFTP, and the use of middleware systems like Zapier and Power Automate.

A trigger is what we refer to when an action in a certain system calls our API to add a respondent to nps.today which will send out a survey. This can be set up by calling our API or with a Webhook connector.

Triggering a survey though our API will usually be done with a trigger in a third-party system.

Embedded Flow

Below you see different examples of a system trigger:

  • Online

    • Web shop (at check-out)
  • CRM

    • Before/after meetings (e.g. Appointment created/completed)
    • Offer sent (e.g. Sales stage = offer sent + 1 day)
    • New customer/onboarding (Account Type changed to customer)
  • ERP/financial system

    • Order (order completed)
    • Invoice (Invoiced)
  • Delivery and project

    • Delivery (delivery completed)
    • Project (e.g. project stage = halfway)
  • Customer Service

    • Case completed (e.g. Case Closed + 2 hours)

Trigger surveys with our API

Our API has a lot of different endpoints that you can use to connect with nps.today. To access our API you need an nps.today subscription and our API module.

Using our API to add a respondent to a campaign in nps.today the most used endpoint is:

https://api.nps.today/campaigns/{{campaignId}}/respondents

Reading the documentation for this endpoint you will find a full example of a request and a JSON raw body. The different fields are also explained. Please notice the custom field in the body. This field accepts any valid JSON and is often used to contain external system-related data that is important to the respondent and for your Business Intelligence department for further analysis of your nps.today data.

The most used Authorization is an API Key which can be created on your nps.today application.

Below is an example of a POST request to our endpoint, that adds a respondent named Ross, from the company Ajaxx, and a responsible employee named Janne.

curl --location 'https://api.nps.today/campaigns/111112/respondent' \
--header 'Content-Type: application/json' \
--header 'Authorization: apikey ZfdghsUdgffafgodWdadfDugzfaygWdfgfgdajgdaeg' \
--data-raw '    {
        "respondent": {
            "emailAddress": "ross@npstoday.com",
            "firstName": "Ross",
            "lastName": "Doe",
            "phoneNumber": "4512345678",
            "externalId": "Ext12386"
        },
        "employee": {
            "firstName": "Janne",
            "phoneNumber": "+4512345678",
            "externalId":"ext12345"
        },
        "company": {
            "name": "Ajaxx"
        },
        "custom": {
            "Unique Key": "asgjuas07g0as44",
            "Area": "East"
        }
    }'

You have no Authorization header

If your framework has no option of setting the Authorization header you can use the following endpoint as a fallback option:

https://api.nps.today/campaigns/{{campaignId}}/respondentInlineAuth
Here the nps.today API Key can be used inside the raw body. See documentation here.

Collect responses with pop-up

If you want to collect responses on your website or web application a pop-up is a very valuable channel to use. To understand more about the pop-up and understanding the technical set-up please go to this pop-up documentation site

Get customer feedback In App

If you want to collect feedback inside of an App you can use this endpoint to add a respondent and a response at the same time. Using this endpoint. Your App Developers can build the UI and call you API.

https://api.nps.today/popup/{{campaignId}}/response
Below is an example of the body in this request.
{
    "respondent": {
        "emailAddress": "example@example.com",
        "firstName": "John",
        "lastName": "Doe",
        "phoneNumber": "+4571202003",
                "externalId": "Ext12386"
    },
    "response":{
        "rating": 8,
        "userComment": "Some important comment",
        "ratingTime": "2020-01-01 13:37:45"
    }
}

See the below example of an App using this endpoint to collect feedback. Dansk Erhverv eksempel.gif

Embedded survey

An embedded survey is a nps.today survey that exists inside in an email sent from a third-party system. There are many cases where this is relevant if the system provides its own ‘send email’ solution.

Below is a simple flow of an embedded survey.

Embedded Flow

Below is an example of an embedded survey in a newsletter.
Embedded Flow

When setting up an embedded email you need to create a link for each of the boxes (0-10) the respondent can click on.
See here how you can generate links with a script.

Once you have the links, you can create boxes and add “&rating=“ and the box number.
See example below on a rating 8:

URL example on &rating=8

https://r.nps.today/?cid=12810&firstName=John&lastName=Doe&email=jd@email.com&
phone=+4587654321&ext=cd1234567&employee=agent@email.com&id=b77063db-181c-4084-957f-590c04de255c&sha=530fa9fc7441cda800091458b9e912efaebbbf1a563b1ea292571b22b8dde6b8&rating=8

Button example

Styling

Styling of the embedded survey needs to be done in the third-party system if the system has a HTML designer for their emails.
Below is an HTML example so you do not need to start from nothing.

HTML example for embedded survey
<td style="border: 1px solid #000000; direction: ltr; font-size: 0px; text-align: center; vertical-align: top;">
<div style="Margin: 0px auto; max-width: 538px;">
    <table width="100%" align="center" border="0" cellpadding="0" cellspacing="0" style="width: 100%;" class="devicewidth">
    <tbody>
        <tr>
        <td style="direction: ltr; font-size: 0px; padding: 20px 0; text-align: center; vertical-align: top;">
            <div class="outlook-group-fix" style="font-size: 13px; text-align: left; direction: ltr; display: inline-block; vertical-align: top; width: 100%;">
            <table border="0" cellpadding="0" cellspacing="0" style="vertical-align: top;" width="100%" class="devicewidthtext">
                <tbody>
                <tr>
                    <td align="center" style="font-size: 0px; padding: 10px 25px; word-break: break-word;">
                    <div style="font-family: Arial, Helvetica, sans-serif; font-size: 20px; font-weight: 600; line-height: 1; text-align: center; color: #000000;">
                        <div class="QUESTION_TEXT">How likely is it that you would recommend nps.today to others?
                        <div class="QUESTION_TEXT">
                    </div>
                    </td>
                </tr>
                </tbody>
            </table>
            </div>
        </td>
        </tr>
    </tbody>
    </table>
</div>
<div>
    <div class="donotremove">
    <div class="NPSTODAYSURVEY">
<table class="rating" cellspacing="0" cellpadding="0" style="margin: 0 auto;">
    <tbody>
        <tr>
            <td class="box" align="center" width="8.5%" height="40" bgcolor="#000000">
                <a href="{REPLY_URL}&amp;rating=0" style="font-size: 16px; font-weight: bold; font-family: sans-serif; text-decoration: none; line-height: 40px; width: 100%; display: inline-block;">
                    <span style="color: #ffffff;">0</span>
                </a>
            </td>&nbsp
            <td class="boxspacing" width="10px"></td>
            <td class="box" align="center" width="8.5%" height="40" bgcolor="#000000">
                <a href="{REPLY_URL}&amp;rating=1" style="font-size: 16px; font-weight: bold; font-family: sans-serif; text-decoration: none; line-height: 40px; width: 100%; display: inline-block;">
                    <span style="color: #ffffff;">1</span>
                </a>
            </td>&nbsp
            <td class="boxspacing" width="10px"></td>
            <td class="box" align="center" width="8.5%" height="40" bgcolor="#000000">
                <a href="{REPLY_URL}&amp;rating=2" style="font-size: 16px; font-weight: bold; font-family: sans-serif; text-decoration: none; line-height: 40px; width: 100%; display: inline-block;">
                    <span style="color: #ffffff;">2</span>
                </a>
            </td>&nbsp
            <td class="boxspacing" width="10px"></td>
            <td class="box" align="center" width="8.5%" height="40" bgcolor="#000000">
                <a href="{REPLY_URL}&amp;rating=3" style="font-size: 16px; font-weight: bold; font-family: sans-serif; text-decoration: none; line-height: 40px; width: 100%; display: inline-block;">
                    <span style="color: #ffffff;">3</span>
                </a>
            </td>&nbsp
            <td class="boxspacing" width="10px"></td>
            <td class="box" align="center" width="8.5%" height="40" bgcolor="#000000">
                <a href="{REPLY_URL}&amp;rating=4" style="font-size: 16px; font-weight: bold; font-family: sans-serif; text-decoration: none; line-height: 40px; width: 100%; display: inline-block;">
                    <span style="color: #ffffff;">4</span>
                </a>
            </td>&nbsp
            <td class="boxspacing" width="10px"></td>
            <td class="box" align="center" width="8.5%" height="40" bgcolor="#000000">
                <a href="{REPLY_URL}&amp;rating=5" style="font-size: 16px; font-weight: bold; font-family: sans-serif; text-decoration: none; line-height: 40px; width: 100%; display: inline-block;">
                    <span style="color: #ffffff;">5</span>
                </a>
            </td>&nbsp
            <td class="boxspacing" width="10px"></td>
            <td class="box" align="center" width="8.5%" height="40" bgcolor="#000000">
                <a href="{REPLY_URL}&amp;rating=6" style="font-size: 16px; font-weight: bold; font-family: sans-serif; text-decoration: none; line-height: 40px; width: 100%; display: inline-block;">
                    <span style="color: #ffffff;">6</span>
                </a>
            </td>&nbsp
            <td class="boxspacing" width="10px"></td>
            <td class="box" align="center" width="8.5%" height="40" bgcolor="#000000">
                <a href="{REPLY_URL}&amp;rating=7" style="font-size: 16px; font-weight: bold; font-family: sans-serif; text-decoration: none; line-height: 40px; width: 100%; display: inline-block;">
                    <span style="color: #ffffff;">7</span>
                </a>
            </td>&nbsp
            <td class="boxspacing" width="10px"></td>
            <td class="box" align="center" width="8.5%" height="40" bgcolor="#000000">
                <a href="{REPLY_URL}&amp;rating=8" style="font-size: 16px; font-weight: bold; font-family: sans-serif; text-decoration: none; line-height: 40px; width: 100%; display: inline-block;">
                    <span style="color: #ffffff;">8</span>
                </a>
            </td>&nbsp
            <td class="boxspacing" width="10px"></td>
            <td class="box" align="center" width="8.5%" height="40" bgcolor="#000000">
                <a href="{REPLY_URL}&amp;rating=9" style="font-size: 16px; font-weight: bold; font-family: sans-serif; text-decoration: none; line-height: 40px; width: 100%; display: inline-block;">
                    <span style="color: #ffffff;">9</span>
                </a>
            </td>&nbsp
            <td class="boxspacing" width="10px"></td>
            <td class="box" align="center" width="8.5%" height="40" bgcolor="#000000">
                <a href="{REPLY_URL}&amp;rating=10" style="font-size: 16px; font-weight: bold; font-family: sans-serif; text-decoration: none; line-height: 40px; width: 100%; display: inline-block;">
                    <span style="color: #ffffff;">10</span>
                </a>
            </td>
        </tr>
    </tbody>
</table>
<div class="donotremove">
</div>
<div style="Margin: 0px auto; max-width: 538px;">
    <table align="center" border="0" cellpadding="0" cellspacing="0" style="width: 100%;" class="devicewidth">
    <tbody>
        <tr>
        <td style="direction: ltr; font-size: 0px; padding: 20px 0; padding-top: 0px; text-align: center; vertical-align: top; width:100%">
            <div class="outlook-group-fix rating" style="font-size: 13px; text-align: left; direction: ltr; vertical-align: top; float: left; width:100%">
            <table border="0" cellpadding="0" cellspacing="0" style="vertical-align: top;" width="100%" class="">
                <tbody>
                <tr>
                    <td align="left" width="50%" style="font-size: 0px; padding: 0px; word-break: break-word; min-width: 50%;">
                    <div style="font-family: Arial, Helvetica, sans-serif; font-size: 16px; font-weight: 600; line-height: 24px; text-align: left;color: #000000;">
                        <div class="NOT_LIKELY">Not likely
                        <div class="NOT_LIKELY">
                    </div>
                    </td>
                    <td align="right" width="50%" style="font-size: 0px; padding: 0px; word-break: break-word; min-width: 50%;">
                    <div style="font-family: Arial, Helvetica, sans-serif; font-size: 16px; font-weight: 600; line-height: 24px; text-align: right; color: #000000;">
                        <div class="VERY_LIKELY">Very likely
                        <div class="VERY_LIKELY">
                    </div>
                    </td>
                </tr>
                </tbody>
            </table>
            </div>
        </td>
        </tr>
    </tbody>
    </table>
</div>
</td>

Use Webhook

If your system provide you with webhooks, please read this webhook guide.

Connect with Power Automate

nps.today has built a nps.today connector in Power Automate. For this, you will need a Microsoft 365 Licence. Read more about our connector here.

Connect with Zapier

nps.today has built a Zap in Zapier for you to connect nps.today with other systems. For this, you will need your own Zapier account. Read more about our Zapier integration here.

Add respondent with sFTP server

sFTP is used for systems unable to work with more modern integrations, but are able to dump .csv or .xls(x) files to an FTP folder. To trigger a survey you can set up a Power Automate flow that reads the file(s) with a recurring frequency, sets certain conditions, and adds the respondents from the files to a campaign in nps.today. nps.today will be able to assist you with this.

NOTE! that these files transferred to the FTP folder must be type UTF-8.