Questionnaires and Questionnaire Links

On this page:

  • Customise your review invites by setting up questionnaires with eTrusted
  • Generate questionnaire links via API call
  • Embed the links in a message to your customer

Via the questionnaire links API, you can generate a link for your customer that will generate a new instance of the questionnaire specifically for him. This link can be included in your review invite.

Step: Setting up Questionnaires

Questionnaires are generated from questionnaire templates. Trusted Shops will setup all the necessary questionnaire templates for you when you become an eTrusted customer. Contact us!

Once Trusted Shops has created a questionnaire template for your account, you can generate a link to a questionnaire via API call.

Find the Questionnaire Links API on our API documentation site.

Find the questionnaire template reference in your Control Centre.

Call the API via POST like so:

<?php
curl_setopt_array($curl, array(
  CURLOPT_URL => "https://api.etrusted.com/questionnaire-links",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => "",
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 30,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => "POST",
  CURLOPT_POSTFIELDS => '{
    "questionnaireTemplate": {
      "id": "{your_questionnaire_template_reference}"
    },
    "system": "test_system",
    "systemVersion": "1.0",
    "customer": {
      "email": "customer.email@ddr.ess",
    },
    "channel": {
      "id": "{your_test_channel_id}",
      "type": "etrusted"
    },
    "transaction": {
      "reference": "order-12345",
    }
  }',
  CURLOPT_HTTPHEADER => array(
    "Authorization: Bearer {access_token}",
    "Content-Type: application/json",
    "cache-control: no-cache"
  ),
));

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
  echo "cURL Error #:" . $err;
} else {
  echo $response;
}

Note

Make sure that you replace {your_questionnaire_template_reference}, {your_test_channel_id} and {access_token} with your data. Also see authentication.

If the POST call succeeded, you should have a response that looks like this:

{
    "id": "qre-xxxxxxxx-yyyy-xxxx-yyyy-xxxxxxxxxxxx",
    "link": "{questionnaire_link}",
    "token": "{questionnaire_token}"
}

The id is a reference to the actual questionnaire (not the questionnaire template).

The generated link can now be embedded in a message to your customer. This can be an invite email as suggested in our tutorial step for invites and rules, but it can also be any other form of message like an SMS or QR codes printed in letter invitations etc. The link will always lead the customer to the questionnaire for a review.