The experience feedback setup

Useful information:

The use of the placeholder {access_token} is in reference to the JWT token you get back when you authenticate against the eTrusted servers. Visit the Setup and Authentication section of the docs to learn how to generate one if you haven't already.


eTrusted touchpoint Illustration

What are Touchpoints?

Touchpoints in eTrusted terms refer to any part of your site where you decide to start the experience feedback process.

These are usually parts your user interacts with, like the checkout or cart section of your website. It can also be a physical interaction point such as a customer walking into your store.

Once you identify all touchpoints relevant to your experience feedback process, it is now time to trigger the eTrusted system through events to continue the rest of the process.

Creating touchpoints

You can think of events as webhooks, We provide you a URL to which you can both trigger and send context to, the moment a user steps into or completes one of your identified touchedpoints

The way you represent your touchpoints within the eTrusted system is by creating them as event-types.

So for example, say you want to save your checkout touchpoint as an event-type within eTrusted, you will do so using the event-type endpoint

Here is an example of what this will look like in CURL:


      curl --location --request POST 'https://api.etrusted.com/event-types' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer {access_token}' \
--data-raw '{
    "active": true,
    "name": "checkout"
}'

    

Once successfully created you should get back a JSON response similar to this:


      {
    "id": "ety-dff2efe0-3903-47e0-bc35-501fd10a5509",
    "createdAt": "2021-07-22T13:05:28.709Z",
    "updatedAt": "2021-07-22T13:05:28.709Z",
    "active": true,
    "name": "checkout"
}

    

You can always get the list of created touchpoints using the get event type API

Adding invite rules

When eTrusted receives events, a process chain is triggered that ultimately will send out a review invite to your customer automatically.

Invite rules control the conditions for sending out these invites via eTrusted. A rule may define a delay for sending out the invite as well as the transport type of its message (e.g. email).

Create a new invite rule using the Invite Rules API:


      curl --location --request POST 'https://api.etrusted.com/invite-rules' \
--header 'Authorization: Bearer {access_token}' \
--data-raw '{
    "name": "invite_rule_name",
    "eventTypeRef": "evt-xxxxxxxx-yyyy-xxxx-yyyy-xxxxxxxxxxxx",
    "inviteTemplatePriority": [
        {
            "transport": "EMAIL",
            "templateRef": "/templates/xxxxxxxx-yyyy-xxxx-yyyy-xxxxxxxxxxxx"
        },
        {
            "transport": "EMAIL",
            "templateRef": "/templates/xxxxxxxx-yyyy-xxxx-yyyy-xxxxxxxxxxxx"
        }
    ],
    "templateRef": "ivt-xxxxxxxx-yyyy-xxxx-yyyy-xxxxxxxxxxxx",
    "questionnaireTemplateRef": "qrt-xxxxxxxx-yyyy-xxxx-yyyy-xxxxxxxxxxxx",
    "sendingDelay": "P3D",
    "timeOfDay": "10:00:00Z",
    "active": true
}'

    
  • eventTypeRef should be the event type UUID from above
  • You can get the templateRef with the templates endpoint. The templateRef is the UUID of your INVITE template found in the response.
  • You can get the questionnaireTemplateRef using the questionnaire endpoint. The questionnaireTemplateRef is the UUID of your QUESTIONNAIRE template found in the response.
  • We will take a deeper dive into templates and questionnaires in the next section.
  • sendingDelay and timeOfDay are very important for the rule. They are based on the date time format PYMWDTHMS and HH:mm:ssZ respectively. In the code sample above, they express a delay of three days(sendingDelay: P3D) and the invite will then be sent the next day at 10 am (timeOfDay: 10:00:00Z).
  • For each event type, only one invite rule may be active.

You can fetch the entire list of invite rules for your account with the invite-rules endpoint.

Triggering and sending out invites

Once you have set up your touchpoints as event types and have put in place invite rules, you can now go ahead and integrate the event triggering element within your site.

So say a customer gets to the checkout page of your online store, you can call on the Events API to begin the experience feedback process while they complete their purchase.

Below you will find an example showing the triggering of the events endpoint in CURL:


      curl --location --request POST 'https://api.etrusted.com/events' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer {access_token}' \
--data-raw '{
    "channel": {
        "id": "chl-xxxxxxxx-yyyy-xxxx-yyyy-xxxxxxxxxxxx",
        "type": "etrusted"
    },
    "customer": {
        "email": "john.doe@example.com",
        "firstName": "John",
        "lastName": "Doe",
        "address": "Anystr. 17, 12345, Anycity, Anystate 12345",
        "mobile": "cillum eu",
        "reference": "cst-xxxxxxxx-yyyy-xxxx-yyyy-xxxxxxxxxxxx"
    },
    "system": "customer_system_name",
    "systemVersion": "1.0",
    "transaction": {
        "reference": "order-12345",
        "date": "2013-08-25T03:12:26.613Z"
    },
    "type": "checkout",
    "defaultLocale": "de_DE",
    "estimatedDeliveryDate": "2017-01-07",
    "products": [
        {
            "name": "Specialbrand T-Shirt White M",
            "sku": "1234-TS-WH-M",
            "url": "https://www.specialbrandshop.com/article123-TS-WH-M/",
            "gtin": "1234567890123",
            "imageUrl": "https://www.specialbrandshop.com/article123-TS-WH-M/image.jpg",
            "mpn": "23687778",
            "brand": "specialbrand"
        },
        {
            "name": "Specialbrand T-Shirt White M",
            "sku": "1234-TS-WH-M",
            "url": "https://www.specialbrandshop.com/article123-TS-WH-M/",
            "gtin": "1234567890123",
            "imageUrl": "https://www.specialbrandshop.com/article123-TS-WH-M/image.jpg",
            "mpn": "23687778",
            "brand": "specialbrand"
        }
    ],
    "metadata": {
        "metaKey1": "metaValue1",
        "metaKey2": "metaValue2"
    }
}'

    

With an event successfully triggered you should get back a JSON response similar to what is shown below:


      {
    "Message": "Your event (evt-xxxxxxxx-yyyy-xxxx-yyyy-xxxxxxxxxxxx) was accepted for processing",
    "EventRef": "evt-xxxxxxxx-yyyy-xxxx-yyyy-xxxxxxxxxxxx"
}

    

As you may have noticed the POST body has a large JSON object, most of which is meant to send as much context data back to the eTrusted platform. This data is also available to you to use later, all you need to do is call on the get events endpoint

Some of the keys within the JSON object are however mandatory, including the following:

  • customer object which provides information about the customer to be used within the templates as well as how to reach them
  • type this is the name of the event-type you will like to fire the event for.
  • channel as mentioned earlier in the channels section, everything done under your account must be associated with a Channel which is basically a way to segments parts of your business.
  • transaction allows you to collect data regarding the purchase or transaction the customer is carrying out.
  • system and system_version also provide you with a way to identify which implementation or system you created triggered the event.

What next?

Hopefully, you now have a fair idea as to what is possible with the events endpoint. There are other endpoints we did not look at that might be useful to your specific use case, so please feel free to check out the API documentation for the full list of what the event API has to offer.

In the next section, we will take a look at questionnaires and templates.

Scroll back up

Need further support?

Visit the Help Centre for further information, or contact us. Are some words or terms unfamiliar? Then visit the glossary for clarification.