# Obtain Response Data

### **What you should be aware of**

* The survey needs to run through CrossEngage to Zenloop for us to be able to map the response data to respective users on our side, see the documentation on [how to create a CrossEngage campaign message with Zenloop](https://documentation.crossengage.io/data-and-engagement-platform/messages/integrations/channels/webhooks/zenloop-via-crossengage-webhook/create-a-campaign-message).
* This solution we have provided here will only work, if the externalId (also used in CE) is provided to Zenloop as dedicated property within Zenloop.
* The users/events can be ingested hourly or daily.
  * Hourly (every hour we fetch Zenloops Response Data for the previous hour)
  * daily (every day we fetch yesterday's response data from Zenloop)
* At the moment this is restricted to 50 surveys.

### **Preparing the Setup on your side**

For this setup we will need the following information:

* Zenloop API Key
* CE Master API Key
* (Optional) List of campaign ids to be queried

Once you have the required API keys, please contact our Customer Operations team to set up Zenloop responses in CrossEngage. You can do so by filing a ticket on our [Customer Support Portal](https://documentation.crossengage.io/data-and-engagement-platform/help-and-support/reach-out-to-customer-support).

Once you have provided the required information to us, you will be able to see the following on the users who have responded to the survey:

* Traits:
  * `traits.lastNPSScore` represents the latest submitted NPS-Score
  * `traits.lastNPSDate` represents your customer's last submitted score

{% hint style="info" %}
These traits will be visible in User Profile > Attributes.
{% endhint %}

* Event: `Survey Completed`&#x20;
  * properties:
    * `properties.surveyId` represents Zenloop’s survey id
    * `properties.surveyName` represents Zenloop’s survey name
    * `properties.npsScore`
    * `properties.npsComment`
    * `timestamp` represents the time when your customer submitted the NPS (UTC time)&#x20;

{% hint style="info" %}
The event will be visible in e.g. **User Profile** > **Event History**.
{% endhint %}

```json
{
  "eventCategory": "CUSTOM",
  "eventClassId": 123456,
  "eventClassName": "Survey Completed",
  "eventTime": "2020-06-09T08:00:41+0000",
  "eventData": {
    "event": "Survey Completed",
    "properties.npsComment": "I can't recommend this enough to everyone",
    "properties.npsScore": "10",
    "properties.surveyId": "randomUUID",
    "properties.surveyName": "CrossEngage Response",
    "timestamp": "2020-06-09T08:00:41.000+0000"
  }
}
```
