> Agents can also search and read this documentation through its [MCP server](https://developers.zonkafeedback.com/docs/~gitbook/mcp).

# Getting Started

Welcome to the Zonka Feedback Developers' Guide, this documentation aims at providing a secure means for external developers to write new applications that can access the data across the platform.

Zonka Feedback is a Customer Feedback & Experience Management Platform. With customizable feedback forms, multichannel survey distribution, real-time responses, powerful feedback workflows, actionable reporting, and closing the feedback loop, you can create world-class experiences with Zonka Feedback for your targeted audience.

This guide aims at giving the platform users a detailed guide of development purposes or the “how-to” of various components across Zonka Feedback.&#x20;

### API Reference

Zonka REST APIs lets you to query and get requested data in JSON format using GET, POST, PUT or DELETE HTTP methods. This document contains API endpoints and examples are shown for each of the endpoints which enables you to access data from different datasets associated with your Zonka account. In this guide, you can identify and understand the APIs you need to execute within your applications.&#x20;

### JS Client Code

To display and trigger Zonka Feedback Surveys and Forms on your Website, or within your app or product, you need to install the Zonka Feedback JS Client Code (a JavaScript code) to your website (or in-app).&#x20;

In the designated section, JS client code section talks in detail of all the know hows for installing, debugging and running the web and in-product surveys smoothly.

### Mobile SDK

Th mobile SDK section shows how to create a mobile app that presents a survey to the user using the Zonka Feedback Mobile App SDK. Several scenarios are presented that show more advanced usage of App Feedback following the basic survey presentation app.&#x20;

### Let's get started!


# API & Webhooks

## Introduction

Zonka Feedback REST APIs allow you to retrieve response details, contacts, surveys, and more. You can use these to pass these details to any application that you or your organization is using such as CRMs, databases, or any custom-built solution.

## API Key Authentication

The Zonka Feedback API provides an API token-based authentication system. To access the APIs you would need a valid Auth Token. The token can be created as follows:

1. Navigate to Company Settings > Developers > API
2. Select API
3. Click "Generate Token" to create your token.

API tab is only accessible to Admin users within the Zonka account. The token will have the entire scope of the Admin user and can be used to access all datasets associated with the account.

{% hint style="info" %}
If you already have a valid API token, "Generate Token" will replace it with a new one (the old one will expire immediately). Any existing API calls will not work until they are updated to use the new token.
{% endhint %}

### Base URLs and Datacenters

Zonka Feedback is hosted in two regions - the United States and European Union.&#x20;

#### How to find in which region your Zonka Feedback account is hosted?

1. Go to Settings on your Zonka Feedback Platform.
2. In Settings, go to the 'Developers' panel.&#x20;
3. In the 'Developers' panel, go to the 'APIs' tab.
4. Here under the 'Datacenter', you will see the region of your account.&#x20;

If your region is US, then you can access the public APIs with the base URL provided below

{% code title="United States Datacenter" %}

```
https://us1.apis.zonkafeedback.com
```

{% endcode %}

If your region is EU, then you can access the public APIs with the base URL provided below

{% code title="European Union Datacenter" %}

```
https://e.apis.zonkafeedback.com
```

{% endcode %}

## Responses

API responses will contain JSON objects. Most paginated responses have a default of **25** items returned under the result field. Some API calls will allow the user to override the default page size for paginated responses.

### HTTP Response Codes

<table data-card-size="large" data-view="cards"><thead><tr><th>HTTP RESPONSE CODE</th><th>DESCRIPTION</th></tr></thead><tbody><tr><td><strong>200 - OK</strong></td><td>The request succeeded.</td></tr><tr><td><strong>201 - Accepted</strong></td><td>When a new object is created in the system.</td></tr><tr><td><strong>400 - Bad Request</strong></td><td>There was something invalid about the request.</td></tr><tr><td><strong>401 - Unauthorized</strong></td><td>The API user could not be authenticated or does not have authorization to access the requested resource.</td></tr><tr><td><strong>403 - Forbidden</strong></td><td>The API user authenticated and made a valid request, but is not authorized to access the requested resource.</td></tr><tr><td><strong>404 - Not Found</strong></td><td>The requested resource could not be found.</td></tr><tr><td><strong>415 - Unsupported Media Type</strong></td><td>The request entity has a media type which the server or resource does not support. (Usually the accepts header of the call has an invalid value or a value the server does not support.)</td></tr><tr><td><strong>500 - Internal Server Error</strong></td><td>This indicates a problem internal to the ZF API and usually cannot be corrected by the user. Please contact Zonka Feedback Support with the <strong>requestId</strong> and <strong>errorCode</strong> found in the response.</td></tr></tbody></table>

### Date and Time

The Zonka Feedback APIs use date and time values which follow the [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) standard. Each value represents a specific point in time. Also, some older endpoints feature Unix time instead of ISO 8601.

#### **ISO 8601 Date and Time Format**

In general, although the ISO 8601 standard specifies many different date and time formats, the typical date and time value specifies the date as YYYY-MM-DD (where *YYYY* indicates a four-digit year, *MM* is a two-digit month, and *DD* is the two-digit day of the month) followed by the character "T" and then the time as hh:mm:ss (where *hh* is a two-digit hour in military time format \[00-23, no AM or PM], *mm* is the two-digit minutes past the hour, and *ss* is the two-digit seconds) followed by the character **Z** which indicates UTC. Instead of **Z**, a time zone offset from UTC can be indicated as plus (**+**) or minus (**-**) followed by HH:mm.

{% hint style="info" %}
The following shows examples of ISO 8601 dates and times:

* 2019-03-21T10:16:12Z000 represents March 21, 2019 at 10:16:12 AM and 0 milliseconds UTC.
* 2016-04-01T07:31:43Z represents April 1, 2016 at 7:31:43 AM UTC.
* 2017-02-07T14:02:11-08:00 represents February 7, 2017 at 2:02:11 PM in the PST time zone (UTC minus 8 hours).
  {% endhint %}

All dates and time values returned by the APIs are expressed in UTC unless the API allows you to return values in local time.<br>


# API Endpoints

### Response API

Retrieve your list of responses and response details by using the following endpoints.

<table><thead><tr><th width="218.33333333333331">API</th><th width="285">DESCRIPTION</th><th>DOCUMENTATION</th></tr></thead><tbody><tr><td><p>GET Response Details</p><p><br></p></td><td>Get details of one or more responses by passing the responseID as a path parameter.</td><td><a href="https://apidocs.zonkafeedback.com/#a9a61321-2f2f-447e-b558-1b9570486fe9">Click Here</a></td></tr><tr><td>GET Responses</td><td>This API will enable you to get list of all responses related to a company account.</td><td><a href="https://apidocs.zonkafeedback.com/#a9a61321-2f2f-447e-b558-1b9570486fe9">Click Here</a></td></tr></tbody></table>

### Send Email Survey API

Trigger an email survey via the following API endpoints.

<table><thead><tr><th width="218.33333333333331">API</th><th width="285">DESCRIPTION</th><th>DOCUMENTATION</th></tr></thead><tbody><tr><td>Send Email Survey</td><td>This API will let you send an email survey from your Zonka Feedback account</td><td><a href="https://apidocs.zonkafeedback.com/#97c28279-79ce-47e8-ac73-a3077f37631e">Click Here</a></td></tr></tbody></table>

### Send SMS Survey API

Trigger a SMS survey via the following API endpoints.

<table><thead><tr><th width="218.33333333333331">API</th><th width="285">DESCRIPTION</th><th>DOCUMENTATION</th></tr></thead><tbody><tr><td>Send SMS Survey</td><td>This API will let you send a SMS survey from your Zonka Feedback account</td><td><a href="https://apidocs.zonkafeedback.com/#9b6a1283-fb22-457e-8031-cf18d51d26f7">Click Here</a></td></tr></tbody></table>

### Survey API

You can make requests for a list of surveys and survey information with the following endpoints.

<table><thead><tr><th width="218.33333333333331">API</th><th width="285">DESCRIPTION</th><th>DOCUMENTATION</th></tr></thead><tbody><tr><td>GET Surveys</td><td>Get list of surveys associated with your Zonka account.</td><td><a href="https://apidocs.zonkafeedback.com/#fb08fb5b-a323-4c2f-9f1b-cdda2bd04d38">Click Here</a></td></tr><tr><td>GET Survey Details</td><td>Get details of one or more surveys by passing the responseID as path parameter.</td><td><a href="https://apidocs.zonkafeedback.com/#fcac0064-4ed0-4902-bf6a-067b41c58bf6">Click Here</a></td></tr><tr><td>GET Survey Stats</td><td>Get stats of surveys associated with your Zonka account</td><td><a href="https://apidocs.zonkafeedback.com/#4c52ca40-5a52-4e0d-aeb7-d0cbfc8b0397">Click Here</a></td></tr></tbody></table>

### Contact API

You can request the list of all contacts, contact lists, and details of a specific contact by the following APIs

<table><thead><tr><th width="218.33333333333331">API</th><th width="285">DESCRIPTION</th><th>DOCUMENTATION</th></tr></thead><tbody><tr><td> GET Contacts</td><td><p>Get list of contacts associated with your Zonka Account.</p><p></p></td><td><br><a href="https://apidocs.zonkafeedback.com/#b326f5d1-8208-4154-8cdd-da7b1521aa9e">Click Here</a></td></tr><tr><td>GET Contact Lists</td><td>Get list of Contact Lists (Segments) associated with your Zonka Account.</td><td><a href="https://apidocs.zonkafeedback.com/#1cdca186-e86f-45c4-9a85-f6e3bcb2f872">Click Here</a></td></tr><tr><td>GET Contact Details</td><td>Get details of a specific contact.</td><td><a href="https://apidocs.zonkafeedback.com/#59ec0a71-61b6-47b9-8e98-4cb5172d8b59">Click Here</a></td></tr></tbody></table>

### Device API

Get the list of devices registered with your account or details of one or more devices or analyze the uptime of a specific device through the following endpoints.

<table><thead><tr><th width="218.33333333333331">API</th><th width="285">DESCRIPTION</th><th>DOCUMENTATION</th></tr></thead><tbody><tr><td>GET Devices</td><td>Get list of devices associated with your Zonka Account. You can use query parameters to filter the devices as desired.</td><td><a href="https://apidocs.zonkafeedback.com/#4b345d30-b6e3-4a46-9c2a-283a07889aba">Click Here</a></td></tr><tr><td>GET Device Details</td><td>Get details of one or more devices associated with by passing the Device Id(s) as query parameters.</td><td><a href="https://apidocs.zonkafeedback.com/#88e8526f-f300-4762-9035-2f22dd2caa1b">Click Here</a></td></tr><tr><td>GET Devices Uptime</td><td>Get total uptime stats of one or more devices.</td><td><a href="https://apidocs.zonkafeedback.com/#b0db3612-d58b-473a-883d-121d61e66b0a">Click Here</a></td></tr><tr><td>GET Device Responses</td><td>Get total response count for one or more devices.</td><td><a href="https://apidocs.zonkafeedback.com/#c15ea015-84ce-4b63-b906-c6151bd7d8d0">Click Here</a></td></tr></tbody></table>

### Location API

Get the list of locations or detail about one or more locations through the following endpoints.

<table><thead><tr><th width="218.33333333333331">API</th><th width="285">DESCRIPTION</th><th>DOCUMENTATION</th></tr></thead><tbody><tr><td>GET Locations</td><td>Get list of locations associated with your Zonka Account. You can use query paramters to filter the locations as desired.</td><td><a href="https://apidocs.zonkafeedback.com/#f75db119-d1e9-42f3-b42a-4e6d117d0ca9">Click Here</a></td></tr><tr><td>GET Location Details</td><td>Get details of one or more locations by passing the locationId as path parameter.</td><td><a href="https://apidocs.zonkafeedback.com/#3f39624e-7057-4e34-a285-801c0b7b420d">Click Here</a></td></tr></tbody></table>

### User API

Retrieve the list of users that have access to your account or details of a specific user by using the following endpoints.

<table><thead><tr><th width="218.33333333333331">API</th><th width="285">DESCRIPTION</th><th>DOCUMENTATION</th></tr></thead><tbody><tr><td>GET Users</td><td>Get list of users associated with your Zonka account.</td><td><a href="https://apidocs.zonkafeedback.com/#27e61ce0-5be0-43eb-8068-e7133d081b94">Click Here</a></td></tr><tr><td>GET User Details</td><td>Get details of a specific user associated with your Zonka account.</td><td><a href="https://apidocs.zonkafeedback.com/#c999ff41-64d8-4d28-b678-401bf704e871">Click Here</a></td></tr></tbody></table>

### Task API

This API enables you get list of task and task details associated with your Zonka account.

<table><thead><tr><th width="218.33333333333331">API</th><th width="285">DESCRIPTION</th><th>DOCUMENTATION</th></tr></thead><tbody><tr><td>Create a Task</td><td>This API will let you create a task in your Zonka Feedback account</td><td><a href="https://apidocs.zonkafeedback.com/#4315f33b-c607-45b6-b6f9-aed1a9284e23">Click Here</a></td></tr><tr><td>Delete a Task </td><td>This API will let you delete a task from your Zonka Feedback account</td><td><a href="https://apidocs.zonkafeedback.com/#f3d00edc-1748-49cd-9c43-20fd24fe91e1">Click Here</a></td></tr><tr><td>Get list of Tasks</td><td>This API will let you get the list of tasks from your Zonka Feedback account</td><td><a href="https://apidocs.zonkafeedback.com/#f249a8ee-93be-4ecd-98c5-9e903fbe31bf">Click Here</a></td></tr><tr><td>Update a Task</td><td>This API will let you update a task in your Zonka Feedback account</td><td><a href="https://apidocs.zonkafeedback.com/#1f2b88f0-4a31-4792-bce6-90dfedb8aeed">Click Here</a></td></tr></tbody></table>

You can refer to the Zonka Feedback API documentation [here ](https://apidocs.zonkafeedback.com/#intro)and learn more from the sample request and responses provided.


# Send Email Survey

You can refer to the Zonka Feedback Send  Email Survey API documentation [here ](https://apidocs.zonkafeedback.com/#f4ce848c-898b-4004-8521-acc3456f1b9f)and learn more from the sample request and responses provided.

## Basic Email Survey

To send out a quick Email Survey using API you need just the required parameters to be passed. If any of the optional parameters are not passed the default email template that has been saved for the particular survey will be sent. If any of the Optional parameters are passed the sections of the email corresponding to the parameters passed will be overwritten.[](<https://apis.zonkafeedback.com/sendemail&#xD;&#xA;>)

The below are the required parameters for an email survey&#x20;

| Parameter  | Value  | Description                                                     |
| ---------- | ------ | --------------------------------------------------------------- |
| `surveyId` | string | Survey Id of the survey to be sent                              |
| `email`    | string | Email address of the recipient to which the email is to be sent |

The below is a list of non-mandatory variables to customize the content of an email survey

| Parameter   | Value  | Description                               |
| ----------- | ------ | ----------------------------------------- |
| `name`      | string | Name of the recipient                     |
| `subject`   | string | Subject of the email                      |
| `message`   | string | Content for message body of the email     |
| `signature` | string | Signature content at the end of the email |

<figure><img src="https://208139503-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FpmrLKRdz46Vwoj8zDdEe%2Fuploads%2Fgpzi4WGO3gzoU66J45OM%2Fheading%2C%20heading%20color%20without%20discription.png?alt=media&amp;token=e5c9a02b-c188-4021-978b-fe519b61e6ae" alt=""><figcaption></figcaption></figure>

### Embed a Survey Question &#x20;

Zonka Feedback supports two types of email survey templates: with a Button or with an Embedded Question.&#x20;

To embed a Survey question in your email survey, set the embedField as 'True'.

<table><thead><tr><th width="170">Parameter</th><th width="161">Datatype</th><th>Description</th></tr></thead><tbody><tr><td><code>embedField</code></td><td>boolean</td><td>Enables you to select if the first question in your survey should be embedded in the email. Set as <code>true</code> to embed.</td></tr></tbody></table>

<figure><img src="https://208139503-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FpmrLKRdz46Vwoj8zDdEe%2Fuploads%2F9VnLAyMwClDB1wgAjSQu%2Fembed2.png?alt=media&amp;token=d1722c70-3ba2-4737-90fd-0de356ed9451" alt=""><figcaption></figcaption></figure>

Additionally you can add gradient to your NPS and CES question options by using the variable below.&#x20;

<table><thead><tr><th width="290.3333333333333">Parameter</th><th width="157">Value</th><th>Description</th></tr></thead><tbody><tr><td><code>embedFieldButtonGradient</code></td><td>boolean</td><td>Gradient for NPS and CES button. Set as <code>true</code> if you want to set gradient</td></tr></tbody></table>

<div><figure><img src="https://208139503-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FpmrLKRdz46Vwoj8zDdEe%2Fuploads%2FrlEqXbO5XDuKOdoB52Bk%2FEmbed%20Boolean%20NPS%20Survey1-1.png?alt=media&amp;token=89e6a14c-b734-4206-90e2-257de10629a6" alt=""><figcaption></figcaption></figure> <figure><img src="https://208139503-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FpmrLKRdz46Vwoj8zDdEe%2Fuploads%2FudlXz7fd0ZuAt24T9AHE%2FEmbed%20Boolean%20NPS%20Survey1.png?alt=media&amp;token=f7572a7c-a6c2-40ea-90a6-09014a81f49e" alt=""><figcaption></figcaption></figure></div>

{% hint style="info" %}
Please note that you should have a single-choice question as the first question in your survey if you want to send an email survey with an Embedded question.
{% endhint %}

### Embed a Survey Button&#x20;

To embed a Survey button in your email survey, set the embedField as 'False'.

<table><thead><tr><th width="270">Parameter</th><th width="161">Datatype</th><th>Description</th></tr></thead><tbody><tr><td><code>embedField</code></td><td>boolean</td><td>Set it as <code>false</code> if a Start Survey button should be included.</td></tr></tbody></table>

<figure><img src="https://208139503-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FpmrLKRdz46Vwoj8zDdEe%2Fuploads%2FjTA9GPiTK64J2pZtaHhz%2Fembed1.png?alt=media&amp;token=4f2254a1-687c-4db2-9306-cb8dbf05b9bc" alt=""><figcaption></figcaption></figure>

## Customizing Email

You can customize the email survey with some additional parameters such as a customized subject, message, and other parameters mentioned in the table below.

You can pass values for the components to customize the email look and feel along with the required parameters. Read how to find the hex code for your desired colors [here](https://htmlcolorcodes.com/).

| Parameter         | Value  | Description                                            |
| ----------------- | ------ | ------------------------------------------------------ |
| `heading`         | string | Content of heading text                                |
| `headingColor`    | string | Color of the heading text. Enter color Hex code        |
| `buttonText`      | string | Content of the button                                  |
| `buttonTextColor` | string | Color of the button bext. Enter color Hex code         |
| `buttonColor`     | string | Color of the Start Survey button. Enter color Hex code |

## Schedule Email&#x20;

You can schedule the email survey to be sent later as well by sending a value for the `scheduleDateTime` parameter. With this, you can set up the exact date and time when the survey email should be sent from the Zonka Feedback to the recipient.

<table><thead><tr><th width="282">Parameter</th><th width="161.33333333333331">Value</th><th>Description</th></tr></thead><tbody><tr><td><code>scheduleDateTime</code></td><td>date</td><td>Specify a future Date and Time for which the email survey is to be scheduled, in the format of <a href="https://developers.zonkafeedback.com/docs/api-and-webhooks#date-and-time">YYYY-MM-DDThh:mm:ssTZ</a></td></tr></tbody></table>

## Reminder Email

At times, people don't respond to the survey invitation email and so they need to be nudged again to take the survey. When reminded, many of them complete the survey. Thus, reminder emails help improve the completion rate.

You can set up reminders for email surveys by providing values for these additional parameters.

<table><thead><tr><th>Parameter</th><th width="160.33333333333331">Value</th><th>Description</th></tr></thead><tbody><tr><td><code>reminder</code></td><td>string</td><td>Set as <code>true</code> if you want to send a reminder to recipients who do not fill the survey.</td></tr><tr><td><code>reminderMaxCount</code></td><td>string</td><td>Numbers of reminders you want to send if the recipient does not respond to the original survey email.</td></tr><tr><td><code>reminderSendAfter</code></td><td>string</td><td>Reminder to be sent how many days after the original survey email is sent</td></tr><tr><td><code>reminderMessage</code></td><td>string</td><td>Specify the Reminder Email message</td></tr></tbody></table>

## Send to Contact Lists

Zonka Feedback supports two types of Contact Lists and Segments: Dynamic and Static. You can send email surveys to multiple recipients by adding them to these contact lists and specifying the list name in the Send Email Survey API. &#x20;

| Parameter | Value | Description                                                     |
| --------- | ----- | --------------------------------------------------------------- |
| `list`    | array | Specify the Contact List names to which the email is to be sent |

{% hint style="info" %}
You can fetch a list of Contact Lists in your account using the [GET Contact Lists API](https://apidocs.zonkafeedback.com/#1cdca186-e86f-45c4-9a85-f6e3bcb2f872)
{% endhint %}

## Send Additional Data

You can pass additional data as post parameters in the Send Email Survey API. You will be able to send Survey, Contact, and Hidden variables. To pass these variables you will need to use the `attributes` parameter.

| Parameter    | Value                      | Description                          |
| ------------ | -------------------------- | ------------------------------------ |
| `attributes` | object with key-value pair | Key-value pair of survey attributes. |

#### Using Custom Variables via API

Occasionally, just by looking at where a respondent viewed the survey link, you will know certain details about them before they ever answer your survey. Custom variables let you send data through the survey web link and APIs, which may then be shown inside the survey and on any reports the survey generates. Please read more about supported variables [here](https://help.zonkafeedback.com/en/articles/5336596-personalize-your-questionnaire-with-our-custom-variables).

Zonka Feedback supports three types of custom variables -

1. Survey Variables
2. Contact Variables
3. Hidden Variables

```json
attributes
 {
      "flight_number": "EK 234",
      "flight_date": "10-10-2022",
      "flight_destination": "Barcelona",
      "contact_email":"carpenterj@xyz.com"
 }
```

## Set up Email Survey Throttling&#x20;

By default, Survey Throttling is set to 30 days for your Zonka Feedback account. That means emails will not be delivered to a recipient for the next 30 days if sent today. This setting can be changed or switched off from the Web App. While sending Email Surveys via API you can set this setting to be ignored.

<table><thead><tr><th width="287.3333333333333">Parameter</th><th>Value</th><th>Description</th></tr></thead><tbody><tr><td><code>ignoreThrottling</code> </td><td>boolean</td><td>Set as <code>true</code> if you want to ignore your survey throttling settings, <code>false</code> if not.</td></tr></tbody></table>

## Getting Help <a href="#getting-help" id="getting-help"></a>

If you need any help regarding the APIs please reach out to us at <mark style="color:blue;"><hello@zonkafeedback.com>.</mark>


# Send SMS Survey

You can refer to the Zonka Feedback Send SMS Survey API documentation [here ](https://apidocs.zonkafeedback.com/#54ddcdba-11d4-440a-8245-664a9b76a1e5)and learn more from the sample request and responses provided.

## Basic SMS Survey

To send out a quick SMS Survey using API you need just the required parameters to be passed. If any of the optional parameters are not passed the default SMS template that has been saved for the particular survey will be sent. If any of the Optional parameters are passed the sections of the SMS corresponding to the parameters passed will be overwritten.

<figure><img src="https://208139503-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FpmrLKRdz46Vwoj8zDdEe%2Fuploads%2F64lTMyiZuudwPuEPqy86%2Fimage%20(37).png?alt=media&amp;token=48d7e175-0b2d-4815-9f8b-5e2465875838" alt=""><figcaption></figcaption></figure>

The below are the required parameters for an SMS survey&#x20;

| Parameter  | Value  | Description                                                                             |
| ---------- | ------ | --------------------------------------------------------------------------------------- |
| `surveyId` | string | SurveyId of the survey to be sent                                                       |
| `mobile`   | string | Mobile number of the recipient to which the SMS is to be sent. Accepted format is E.164 |

{% hint style="info" %}
Learn more about the mobile number format  E.164 [here](https://www.twilio.com/docs/glossary/what-e164).
{% endhint %}

## Customizing SMS

You can customize the SMS survey with some additional parameters such as a customized message and other parameters mentioned in the table below.&#x20;

| Parameter    | Value  | Description                                                                   |
| ------------ | ------ | ----------------------------------------------------------------------------- |
| `linkId`     | string | Survey linkId to be used                                                      |
| `name`       | string | Name of the recipient                                                         |
| `message`    | string | Content for message body of the SMS                                           |
| `locationId` | string | Specify the Location Id of the location you want the email survey to be sent. |

The above is a list of non-mandatory variables to customize the content and distribution of the SMS survey.

## Send Additional Data

You can pass additional data as post parameters in the Send SMS Survey API. You will be able to send Survey, Contact, and Hidden variables. To pass these variables you will need to use the `attributes` parameter.

| Parameter    | Value                      | Description                          |
| ------------ | -------------------------- | ------------------------------------ |
| `attributes` | object with key-value pair | Key-value pair of survey attributes. |

#### Using Custom Variables via API

Occasionally, just by looking at where a respondent viewed the survey link, you will know certain details about them before they ever answer your survey. Custom variables let you send data through the survey web link and APIs, which may then be shown inside the survey and on any reports the survey generates. Please read more about supported variables [here](https://help.zonkafeedback.com/en/articles/5336596-personalize-your-questionnaire-with-our-custom-variables).

Zonka Feedback supports three types of custom variables -

1. Survey Variables
2. Contact Variables
3. Hidden Variables

```json
attributes
 {
      "flight_number": "EK 234",
      "flight_date": "10-10-2022",
      "flight_destination": "Barcelona",
      "contact_email":"carpenterj@xyz.com"
 }
```

## Schedule SMS&#x20;

By giving value for the `scheduleDateTime` parameter, you may also plan for the SMS survey to be sent at a later time. With this, you may choose the precise time and date at which the survey SMS from Zonka Feedback should be sent to the recipient.

| Parameter          | Value  | Description                                                             |
| ------------------ | ------ | ----------------------------------------------------------------------- |
| `scheduleDateTime` | string | Specify a future Date and Time for which SMS survey is to be scheduled. |

## Send to Contact Lists

Zonka Feedback supports two types of Contact Lists and Segments: Dynamic and Static. You can send SMS surveys to multiple recipients by adding them to these contact lists and specifying the list name in the Send SMS Survey  API. &#x20;

| Parameter | Value  | Description                                                           |
| --------- | ------ | --------------------------------------------------------------------- |
| `list`    | string | Specify the Contact List names to which the SMS survey is to be sent. |

{% hint style="info" %}
You can fetch a list of Contact Lists in your account using the [GET Contact Lists API](https://apidocs.zonkafeedback.com/#1cdca186-e86f-45c4-9a85-f6e3bcb2f872)
{% endhint %}

## Set up SMS Survey Throttling&#x20;

By default, Survey Throttling is set to 30 days for your Zonka Feedback account. That means SMS will not be delivered to a recipient for the next 30 days if sent today. This setting can be changed or switched off from the Web App. While sending SMS Surveys via API you can set this setting to be ignored.

| Parameter          | Value   | Description                                                                          |
| ------------------ | ------- | ------------------------------------------------------------------------------------ |
| `ignoreThrottling` | boolean | Set as `true` if you want to ignore your survey throttling settings, `false` if not. |

## Getting Help <a href="#getting-help" id="getting-help"></a>

If you need any help regarding the APIs please reach out to us at <mark style="color:blue;"><hello@zonkafeedback.com>.</mark>


# Send WhatsApp Surveys

## Setting up WhatsApp&#x20;

### Connecting your Infobip account

Zonka Feedback currently supports Infobip as the WhatsApp Service partner. If you don't have an Infobip account you can signup for it or if you would prefer us to help set it up you can [**schedule a call with us.**](https://www.zonkafeedback.com/schedule-demo)

Once you have set up your Infobip account and your senders you will need to connect it with your Zonka Feedback account. Here is how you can do it:

1. Login to your Zonka Feedback account
2. Navigate to Company Settings > WhatsApp Surveys > WhatsApp Setup
3. Enter the following details which are available in your Infobip account
   * API Key
   * Endpoint
   * WhatsApp Sender
4. Once updated these settings will be used to run the WhatsApp/SMS messaging on the account

### Accessing WhatsApp Distribution Channel

#### **Preparing the Template**

The user needs to register a WhatsApp template in Infobip. **Zonka Feedback** currently supports two types of templates:

1. Text-based template without a button.
2. Text-based template with a button.

**Important Notes for Button-based Templates**

* If using button-based templates, the template must be pre-configured with the domain of your Zonka Feedback account region.
  * **For US region:** `us1.zonka.co/{{1}}`
  * **For EU region:** `e.zonka.co/{{1}}`
* You can use multiple placeholders (e.g., `{{1}}`, `{{2}}`) in the template content as needed.

#### **Mapping the Template Placeholders**

Follow these steps to map the placeholders for a survey in Zonka Feedback:

1. **Navigate to the Survey:**
   * Go to your Zonka Feedback dashboard and select the survey you wish to distribute via WhatsApp.
2. **Open the Distribute Section:**
   * Click on the survey name to open its settings.
   * Navigate to the **Distribute** tab, and select **SMS & WhatsApp**.
3. **Configure Placeholder Mappings:**
   * Click on **Placeholder Mappings**.
   * From the list, choose the **Infobip template** you want to set the mapping for.
4. **Map the Attributes**
   * Add the attributes you want to map to each placeholder in the template. For example, you can map customer names, order IDs, or survey URLs.
   * **Mandatory Attribute:** Ensure that one of the placeholders is mapped to the `{{URL}}` attribute, which is required to send the WhatsApp message successfully.
5. **Save and Send**
   * Once all placeholders are mapped and the `{{URL}}` is set, your WhatsApp template is ready to send.
   * You can now distribute the survey via WhatsApp using the mapped template.

## Basic WhatsApp Survey

To send out a quick WhatsApp Survey using API you need just the required parameters to be passed. Please note that in order to do so you will need to save one template as default.&#x20;

If any of the optional parameters are not passed the default WhatsApp template that has been saved for the particular survey will be sent.&#x20;

The below are the required parameters for a WhatsApp survey&#x20;

| Parameter  | Value  | Description                                                                                          |
| ---------- | ------ | ---------------------------------------------------------------------------------------------------- |
| `surveyId` | string | SurveyId of the survey to be sent                                                                    |
| `mobile`   | string | Mobile number of the recipient to which the WhatsApp message is to be sent. Accepted format is E.164 |

{% hint style="info" %}
Learn more about the mobile number format  E.164 [here](https://www.twilio.com/docs/glossary/what-e164).
{% endhint %}

**Example Request**

```

{
  "surveyId": "5f3e63edce6aee000774d4ba",
  "mobile": "+917982050158"
}

```

## Customizing your WhatsApp message

You can customize the survey with some additional parameters such as a customized message and other parameters mentioned in the table below. For this you will need to create appropriate templates.

| Parameter          | Value  | Description                                                                                                    |
| ------------------ | ------ | -------------------------------------------------------------------------------------------------------------- |
| `name`             | string | Name of the recipient.                                                                                         |
| `from`             | string | The sender number from which the WhatsApp message will be sent (auto-filled from configuration if omitted)     |
| `templateName`     | array  | Name of the template registered in Infobip, containing only lowercase alphanumeric characters and underscores. |
| `templateLanguage` | string | Pass the language linked to the template                                                                       |
| `locationId`       | string | Specify the Location Id of the location you want the email survey to be sent.                                  |
| `language`         | string | The language in which the survey should be opened.                                                             |

The above is a list of non-mandatory variables to customize the content and distribution of the WhatsApp survey.

{% hint style="info" %}
**TIP:** Please refer to Infobip API documentation [here](https://www.infobip.com/docs/api/channels/whatsapp/whatsapp-outbound-messages) to get information on Template Names, Languages, and other attributes that may come in handy while using Zonka Feedback API.
{% endhint %}

## Sending a specific template

If you wish to send a specific template from your account to your contacts then you will need to specify the specific template in your request

```json
{
    
    "surveyId": "5f3e63edce6aee000774d4ba",
    "mobile": "+917982050158",
    "templateName": "zf_template",
    "attributes":
 {
      "flight_no": "EK 234",
      "flight_date": "10-10-2022"
 } 
 }
```

## Send Additional Data

You can pass additional data as post parameters in the Send WhatsApp Survey API. You will be able to send Survey, Contact, and Hidden variables. To pass these variables you will need to use the `attributes` parameter.

| Parameter    | Value                      | Description                          |
| ------------ | -------------------------- | ------------------------------------ |
| `attributes` | object with key-value pair | Key-value pair of survey attributes. |

#### Sending Variables via API

Occasionally, just by looking at where a respondent viewed the survey link, you will know certain details about them before they ever answer your survey. Custom variables let you send data through the survey web link and APIs, which may then be shown inside the survey and on any reports the survey generates. Please read more about supported variables [here](https://help.zonkafeedback.com/en/articles/5336596-personalize-your-questionnaire-with-our-custom-variables).

Zonka Feedback supports three types of custom variables -

1. Survey Variables
2. Contact Variables
3. Hidden Variables

```json
attributes
 {
      "flight_number": "EK 234",
      "flight_date": "10-10-2022",
      "flight_destination": "Barcelona",
      "contact_email":"carpenterj@xyz.com"
 }
```

## Schedule WhatsApp Message&#x20;

By giving value to the `scheduleDateTime` parameter, you can set the WhatsApp message to be sent at a later time.&#x20;

| Parameter          | Value  | Description                                                                  |
| ------------------ | ------ | ---------------------------------------------------------------------------- |
| `scheduleDateTime` | string | Specify a future Date and Time for which WhatsApp survey is to be scheduled. |

## Send to Contact Segments

Zonka Feedback supports two types of Contact segments (formerly Lists): Dynamic and Static. You can send WhatsApp surveys to multiple recipients by adding them to these contact lists and specifying the list name in the Send WhatsApp Survey  API. &#x20;

| Parameter | Value  | Description                                                                                     |
| --------- | ------ | ----------------------------------------------------------------------------------------------- |
| `list`    | string | Specify the Contact segment (Formerly Lists) names to which the WhatsAppp survey is to be sent. |

{% hint style="info" %}
You can fetch a list of Contact Lists in your account using the [GET Contact Lists API](https://apidocs.zonkafeedback.com/#1cdca186-e86f-45c4-9a85-f6e3bcb2f872)
{% endhint %}

## Set up WhatsApp Survey Throttling&#x20;

By default, Survey Throttling is set to 30 days for your Zonka Feedback account. That means messages will not be delivered to a recipient for the next 30 days if sent today. This setting can be changed or switched off from the Web App. While sending WhatsApp Surveys via API you can set this setting to be ignored.

| Parameter          | Value   | Description                                                                          |
| ------------------ | ------- | ------------------------------------------------------------------------------------ |
| `ignoreThrottling` | boolean | Set as `true` if you want to ignore your survey throttling settings, `false` if not. |

## Getting Help <a href="#getting-help" id="getting-help"></a>

If you need any help regarding the APIs please reach out to us at <mark style="color:blue;"><hello@zonkafeedback.com>.</mark>


# Webhooks

Webhooks are automated messages sent from Zonka Feedback when a new survey response (or partial response) is added.\
​

Webhooks are always sent as an HTTP POST request to the webhook URLs you've configured via your Webhooks integration. The details of the activity that triggered the webhook are sent as the body of the HTTP request in JSON format.

## Event Types <a href="#h_9522c02a19" id="h_9522c02a19"></a>

We support the following event types. Zonka Feedback now offers a new, cleaner webhook payload along with the legacy payload for backward compatibility. If you are setting up a new webhook, we recommend using the new events.&#x20;

| Type                   | Description                                                                                                                                                                                                                                                                |
| ---------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| response.added         | Triggered when a new response is received for a survey. The event JSON includes all details of the response, including respondent details, scores, AI insights (sentiment, urgency, intent, emotion), and each survey question with the answer provided by the respondent. |
| partial.response.added | Triggered when a partial (incomplete) response is captured for a survey. The payload structure is the same as response.added, containing only the answers captured so far.                                                                                                 |

\
​

***

## Example Response <a href="#h_5f632435f6" id="h_5f632435f6"></a>

The new payload is leaner and more consistent. It removes internal flags and duplicate keys, adds event metadata (`eventType` and `eventId`), and simplifies contact and response attributes.\
​

```
{
  "id": "6a5514a896b91ca4c812a678",
  "surveyId": "69fde27e4fcfc10ae574571e",
  "surveyName": "TicketClosure Survey",
  "surveyLanguage": "en_US",
  "receivedDate": "2026-07-13T16:39:01.000Z",
  "timeZone": "Asia/Kolkata",
  "eventType": "response.added",
  "eventId": "6a5514a896b91ca4c812a680",
  "respondentDetails": {
    "name": "Steve Waugh",
    "emailAddress": "steve.waugh@yahoo.com",
    "mobile": "+918989898989",
    "externalId": "DE7911"
  },
  "locationId": "63b51a77891bf7000844b630",
  "locationName": "Mumbai",
  "tags": [
    {
      "name": "Bad Experience"
    }
  ],
  "geoLocation": "INDIA",
  "webDevice": "Desktop",
  "browser": "Chrome",
  "ratedUserId": "69fde2887b2f37900de805a9",
  "ratedUserName": "Andrew Strauss",
  "channel": "Online",
  "sentiment": "neutral",
  "urgency": "Medium",
  "intent": [
    "Complaint"
  ],
  "emotion": [
    "Concerned"
  ],
  "CSAT": 5,
  "NPS": 10,
  "CES": 1,
  "responseURL": "https://platform.zonkafeedback.com/responseinbox/6a5514a896b91ca4c812a678",
  "contactAttributes": [
    {
      "variableId": "contact_number",
      "value": "9890",
      "type": "Number"
    }
  ],
  "responseAttributes": [
    {
      "variableId": "booking_pnr",
      "value": "PR24WT"
    }
  ],
  "surveyResponse": [
    {
      "questionId": "69fde2887b2f37900de805a9",
      "questionLabel": "How was your experience with us?",
      "answer": "overjoyed"
    },
    {
      "questionId": "699ebc50e1d1b8d9970bfae4",
      "questionLabel": "The company made it easy for me to handle my issues",
      "answer": "Strongly Disagree"
    },
    {
      "questionId": "60d30beeef7c44000837994a",
      "questionLabel": "How likely are you to recommend flying with us to your friends, family, and colleagues?",
      "answer": "10"
    },
    {
      "questionId": "6a3e5c412e4e74aeacea3b91",
      "questionLabel": "Enter Date of travel",
      "answer": "2026-07-31"
    }
  ]
}
```

### New Payload — Field Reference <a href="#h_b2c3611cab" id="h_b2c3611cab"></a>

| Field                                  | Description                                                                                 |
| -------------------------------------- | ------------------------------------------------------------------------------------------- |
| id                                     | Unique ID of the response.                                                                  |
| surveyId / surveyName / surveyLanguage | Details of the survey the response belongs to.                                              |
| receivedDate                           | Date and time (UTC) when the response was received.                                         |
| timeZone                               | Time zone of the account/location.                                                          |
| eventType                              | The event that triggered this webhook, e.g. `response.added` or `partial.response.added`.   |
| eventId                                | Unique ID of this webhook event — useful for de-duplication on your end.                    |
| respondentDetails                      | Respondent's name, email address, mobile number, and external ID (if captured).             |
| locationId / locationName              | Location the response was captured at.                                                      |
| tags                                   | Tags applied to the response.                                                               |
| geoLocation / webDevice / browser      | Where and how the response was submitted.                                                   |
| ratedUserId / ratedUserName            | The team member rated in the response (if applicable).                                      |
| channel                                | Distribution channel of the survey (e.g. Online, Email, SMS).                               |
| sentiment / urgency / intent / emotion | AI-generated insights for the response.                                                     |
| CSAT / NPS / CES                       | Scores for the response, where applicable.                                                  |
| responseURL                            | Direct link to view the response in the Response Inbox.                                     |
| contactAttributes                      | Contact attributes captured with the response, each with `variableId`, `value`, and `type`. |
| responseAttributes                     | Response attributes (hidden/URL variables), each with `variableId` and `value`.             |
| surveyResponse                         | Array of questions answered, with `questionId`, `questionLabel`, and `answer`.              |

***

## Getting Started with Webhooks <a href="#h_1feb59bc5a" id="h_1feb59bc5a"></a>

Here's how you can get started with using Webhooks.

1. Navigate to Settings > Developers > Webhooks

2. Click on 'Add Webhook'

3. Enter the following details:
   * Name: Name of the webhook
   * Event: Response Received
     * When a new survey response is received for the specified survey
   * Target URL:
     1. URL where the JSON for the survey response is to be sent
     2. This can be a Target URL in any CRM, HRMS or any other 3rd party system that accepts webhook event data
   * Survey: Specify the survey whose response will trigger this webhook
   * Additional Parameters: You can specify any additional key:value pairs as comma-separated which can be added to the response JSON that will be sent.

4. Save the Webhook

***

## Webhook Logs <a href="#h_934f800d72" id="h_934f800d72"></a>

When webhooks are triggered they a log is saved for successful or any unsuccessful requests. To view the Webhook Logs, follow these steps.

* Go to Settings > Developers > Webhooks
* Click on 'View Logs'


# JS Web Client

To display and trigger Zonka Feedback Survey widget on your website or within your app or product, you need to install the Zonka Feedback JS Client Code (a JavaScript code) on your website (or in-app).

First, let's understand the different types of web widgets offered in Zonka Feedback. We offer 5 types of Web Widgets.

* **Side Tab (Feedback Button)**\
  Side Tab or Website Feedback Button is a tab or button that is used to collect feedback from your online website visitors and customers while they browse your website or use your app. The Side Tab can be placed on the left or right side of your Web Page or App so it's easy to find for users to share their experience and feedback.
* **Pop-up Survey**\
  Pop-up are forms and surveys that are displayed on a web page or app based on an event or visitor/user behavior. Pop-Up Surveys are great to use as exit intent surveys, cart abandonment surveys, post-transaction and post-booking surveys, lead generation forms, or time-based surveys.
* **Popover Survey**\
  Popover Surveys are surveys that open in an overlay on a web page with a click of a button or link. Unlike Pop-up Surveys that are triggered by an event or time, Popover Surveys are triggered by the user's action of clicking a button or a link. Popover Surveys are ideal for in-context feedback like feature feedback, article or blog feedback, CTAs and more.
* **Slide Up Survey**\
  Slide Up Surveys are forms and surveys that are displayed on a web page or app based on an event or visitor/user behavior. Pop-Up Surveys are great to use as exit intent surveys, cart abandonment surveys, post-transaction and post-booking surveys, lead generation forms, or time-based surveys.

In Web Widgets, you can configure settings for Widget Appearance, Widget Targeting, and Behavior to display the surveys at the right time to the right user.

In the next section, learn how to 'Install this JS Web Client on your web pages' and start collecting responses for your survey.


# Installation

Install the web client by copying & pasting workspace based JS code snippet.

The installation consists of five steps

* Find the Code Snippet
* Choose between Anonymous and Logged-In Mode
* Add Identify variables in case of Logged-In Mode&#x20;
* Inserting the Code in your web pages
* Testing the Installation

Completion of these steps successfully will let you embed your survey within your web pages and start collecting responses right away.&#x20;

## Step 1: Find the Code Snippet  <a href="#h_559435459c" id="h_559435459c"></a>

Installing our JavaScript Web-Client is required before you can use Zonka Feedback surveys inside of your application. It normally takes a few minutes to install the required code snippet, and you only need to do it once.

Navigate to 'Settings' on the Zonka Feedback platform. In the Settings menu, go to the 'Developers' section from the left navigation. In Developers, click on 'JS Client Code'.

## Step 2: Choose Anonymous Visitors or Logged in Users&#x20;

Please make sure while adding your web client code to your web pages if you wish to operate the client in Anonymous Mode or Logged In Mode.

**Anonymous User Mode**

When you want to embed surveys for your public website visitors to record their preferences, behaviors, or simply feedback **Choose Anonymous Users Mode.**

Anonymous visitors may be new to your website or returning visitors who haven't given their personal information previously like any contact information such as name, email, or phone number. To collect survey responses from such users, you can simply insert your web client in anonymous mode.

```javascript
<!-- Zonka Feedback Embed Script -->
<script id="zfEmbed">

window._zfQueue = window._zfQueue || []; function _zf(){_zfQueue.push(arguments); }
(function() { ZonkaFeedback = function (en, fb ){document.body.addEventListener(en, 
fb , false); }; var sc, w, d = document, ce = d.createElement, gi = d.getElementById, 
gt = d.getElementsByTagName, id = "zfEmbedScript"; if (!gi.call(d, id)) 
{ sc = ce.call(d, "script"); sc.async=!0;sc.id = id; 
sc.src = "https://us1.zonkasurvey.com/api/v1/embedjs/<YOUR WORKSPACE ID>";
w = gt.call(d, "script")[0]; w.parentNode.insertBefore(sc, w); }})(); 

</script>
```

**Logged In User Mode**

If you want to survey your users our product or web app when logged in **Choose Logged In Users Mode.**

In addition to the web client code as above, the following code block is responsible for identifying your users. When using the Identify User code, make sure that you replace the static code values with dynamic user data.

```javascript
_zf('variables', {  
contact_email: "abc@somecompany.com",  // Replace with User Email 
contact_name: "Robert Hopkins",  // Replace with User Name
})
```

You can pass variables such as name, phone, email, and user ID to identify the logged-in user of your application.

## Step 3: Insert code snippet&#x20;

Copy the code and paste it into the HTML of your web app. The ideal location is right before the closing \</HEAD> tag. If you are identifying your users, make sure to replace the static values from the logged In method with real user data (id, email or name, …).

```javascript
<head>
    <meta charset="UTF-8">
    .
    .
    .
<!-- Zonka Feedback Embed Script -->
<script id="zfEmbed">
    window._zfQueue = window._zfQueue || []; function _zf(){_zfQueue.push(arguments); }(function() { ZonkaFeedback = function (en, fb )
    {document.body.addEventListener(en, fb , false); }; var sc, w, d = document, ce = d.createElement, gi = d.getElementById, 
    gt = d.getElementsByTagName, id = "zfEmbedScript"; if (!gi.call(d, id)) { sc = ce.call(d, "script"); sc.async=!0;sc.id = id; 
    sc.src = "https://us1.zonkasurvey.com/api/v1/embedjs/<YOUR WORKSPACE CODE>";w = gt.call(d, "script")[0]; w.parentNode.insertBefore(sc, w); }})();
    </script>
    .
</head>
```

Save and publish your changes to get the surveys working.

## Step 4: Testing the Installation

With the help of the built-in Debug Mode in our Javascript Client, you can immediately identify any problems. To enable debug mode add ‘#zf\_debug’ hash to your URL and reload the page

```jsx
https://yourdomain.com#zf_debug=true
```

OR you can use ‘*zf\_debug=true’* parameter to your URL

```jsx
https://yourdomain.com?zf_debug=true
```

Once you reload with any of the above debug modes then you would see a Debug Window in the browser. It will provide you with some basic information about the client and if it's functioning properly and is able to communicate with our servers.

<figure><img src="https://208139503-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FpmrLKRdz46Vwoj8zDdEe%2Fuploads%2FJDTdfPxQ0AplcqOnZLri%2Fimage%20(26).png?alt=media&amp;token=a15724aa-85c7-4d13-b05c-01c4d87a587e" alt=""><figcaption></figcaption></figure>

Try reloading the window if the debug does not appear. If it still does not load then it means that the widget has not been installed properly or has not been installed at all. As a manual alternative, you can try searching for “zf” in the HTML and see if you are able to find it and it has been installed in the right place on the page.

**Disable Debug Mode**

The debug mode remains active until turned off. To turn off debug mode do the following

```jsx
https://yourdomain.com#zf_debug=false
```

## Troubleshooting your installation

**Try it out in an Incognito Browser**

To minimize the amount of data sent between the browser and our servers, our Javascript client makes use of the local storage of your browser. If opened previously, our client will recognize that a particular "Logged In User" call has already been sent to our servers. A hash value is kept in your browser's local storage to do this.

We recommend testing our web client after installation in a fresh incognito browser window at all times to prevent any problems related to cache and session.

**Examine your network in the network tab**

You can examine all network traffic between your browser and our backend servers using the developer console of your browser. Every request made from the Zonka Feedback server must terminate with a 200 or 201 status code.


# Client Reference

Let us dive deeper in what can you achieve with Zonka Feedback web widgets.

## Web Surveys and Workspaces

Our web client for web surveys is workspace specific and each workspace may contain multiple surveys. The web client will expose at max ONE type of each widget - Pop over, Pop Up and Side bar. There could be multiple surveys with enabled pop overs or pop ups and side bars, the one which was enabled or updated last, will be visible through the workspace web client. &#x20;

You don't need to re-install the code if you build a new widget or survey within a workspace and you already have it installed on your website.

## Identify logged-in visitors

Identifying your Users allows you to link your Survey Responses to your customers, visitors or users of your product or app. For example, if you're running an eCommerce Website and are taking feedback after a purchase is completed, identifying a respondent can help you connect and link the survey response and satisfaction to the shopper on your website and the items they purchased.

Identifying Users also allows you to better segment and target the user and sync the responses to other tools and systems you use.&#x20;

Once you have successfully installed our client, you should probably start by identifying your users. Although the client can be used in anonymous mode, identifying your users will provide you access to many useful features like segmenting your users and building target audiences, among others.&#x20;

We can identify users with these variables

| Attributes        | Variable Name     |
| ----------------- | ----------------- |
| Contact Mobile    | contact\_mobile   |
| Contact Email     | contact\_email    |
| Contact Unique Id | contact\_uniqueId |
| Contact Name      | contact\_name     |

You can create more such attributes in Survey > Build > Variables.&#x20;

```javascript
// Some code
```

## Passing additional variables

When you're copying the code from the Install JS Client Code section, you can choose from Anonymous Mode or Logged In Mode. The following code block is responsible for identifying your users. When using the Logged In mode code, make sure that you replace the static code values with dynamic user data.

In addition to identifying the users, you can also pass other variables (Contact Variables, Survey Variables or Hidden Variables) in the code like country, subscription plan, user ID and more.

{% code overflow="wrap" %}

```javascript
_zf('variables', {  
contact_email: "abc@somecompany.com",  // Replace with User Email 
contact_name: "Robert Hopkins",  // Replace with User Name
subscription_plan: "Professional", 
subscribed_date: "August 1, 2022",
country: "United States", 
gender: "Male" 
})
```

{% endcode %}

Passing variables in Web Surveys enriches your responses and reports, and these variables are available as filters in the platform.

## Manually trigger surveys

Use the following JS code to manually open the widget when a button or link is clicked.

You can place the manual trigger in the on Click event in your webpage in the following way.

```javascript
<a onclick = "_zf('startForm','SURVEY CODE');">
Click Me</a>
```

You can place the manual trigger in the on Hover event.

```javascript
<a onhover="-zf('startForm','SURVEY CODE';">
Button</a>
```

You can add this manual trigger in the onload event as well.

```javascript
<a onload="_zf('startForm','SURVEY CODE');">
PageURL</a>
```

You can get the manual trigger code under the JS Client Code Tab in the widget configuration page.

## Setting up Multilingual Survey

Zonka Feedback's web client supports multilingual survey widgets, allowing your surveys to automatically load in the correct language for each visitor. There are two methods for controlling widget language — automatic detection from the browser/website, and explicit language configuration via the JS client.

***

### Method 1 — Automatic Language Detection (Default)

By default, the Zonka Feedback JS client reads the `lang` attribute on the `<html>` tag of the page it is installed on, and maps it to the corresponding language configured in your survey.

```html
<!-- Example: A French website -->
<html lang="fr">
```

This will result in the we widget showing the survey in French Language detecting the language fro the lang tag.

> **Note:** The mapping is case-insensitive. Both `fr` and `FR` will resolve correctly.

No additional configuration is required for this method to work. If the detected language matches a language that has been added to your survey, the widget will load in that language automatically.

***

### Method 2 — Passing a Language Explicitly

If you want to override the automatically detected language and force the widget to load in a specific language, you can pass a `lang` parameter using the `settings` function in the JS client code.

> **Important:** When Method 2 is used, it takes precedence over Method 1. The automatically detected page language is ignored.

```javascript
_zf('settings', { language: 'fr_FR' })
```

Place the `settings` call within your Zonka Feedback JS snippet, after the core embed script and before any other `_zf` calls.

Example:&#x20;

```javascript
<!-- Zonka Feedback JavaScript Code Starts -->
<script id="zfEmbed">
  window._zfQueue = window._zfQueue || []; function _zf(){_zfQueue.push(arguments); }
  (function() { ZonkaFeedback = function (en, fb){ document.body.addEventListener(en, fb, false); };
  var sc, w, d = document, ce = d.createElement, gi = d.getElementById, gt = d.getElementsByTagName,
  id = "zfEmbedScript"; if (!gi.call(d, id)) { sc = ce.call(d, "script"); sc.async=!0; sc.id = id;
  sc.src = "https://us-js.zonka.co/61645143923bbb00070e3670";
  w = gt.call(d, "script")[0]; w.parentNode.insertBefore(sc, w); }})();

  _zf('settings', { language: 'fr_FR' })   // Force the widget to load in French

  _zf('variables', {
    contact_name: "John Appleseed",
    contact_email: "john@example.com",
  })
</script>
<!-- Zonka Feedback JavaScript Code Ends -->
```

#### Language code reference

Please use this table as a reference for passing the laguage code for your survey language for the `language` parameter.

| Language               | Language Code |
| ---------------------- | ------------- |
| English                | en\_US        |
| French                 | fr\_FR        |
| Tamil                  | ta\_IN        |
| German                 | de\_DE        |
| Italian                | it\_IT        |
| Hindi                  | hi\_IN        |
| Arabic                 | ar\_AE        |
| Gujarati               | gu\_IN        |
| Spanish (Latin)        | es\_US        |
| Spanish (European)     | es\_ES        |
| Malay                  | ms\_MS        |
| Indonesian             | id\_ID        |
| Russian                | ru\_RU        |
| Portuguese (Brazilian) | pt\_BR        |
| Portuguese (European)  | pt\_PT        |
| Swedish                | sv\_SV        |
| Danish                 | da\_DA        |
| Norwegian              | nb\_NB        |
| Dutch                  | nl\_NL        |
| Finnish                | fi\_FI        |
| Japanese               | ja\_JA        |
| Korean                 | ko\_KO        |
| Bengali                | bn\_IN        |
| Marathi                | mr\_IN        |
| Odia                   | or\_IN        |
| Punjabi                | pa\_IN        |
| Kannada                | kn\_IN        |
| Telugu                 | te\_IN        |
| Malayalam              | ml\_IN        |
| Romanian               | ro\_RO        |
| Chinese                | zh\_CN        |
| Azerbaijani            | az\_AZ        |
| Canadian French        | fr\_CA        |
| Hungarian              | hu\_HU        |
| Haitian Creole         | ht\_FR        |
| Burmese                | my\_MM        |
| Vietnamese             | vi\_VN        |
| Hebrew                 | he\_IL        |
| Thai                   | th\_TH        |
| Chinese (Traditional)  | zh\_TW        |
| Turkish                | tr\_TR        |
| Polish                 | pl\_PL        |
| Cantonese              | yue\_CN       |
| Gaeilge                | ga\_IE        |
| Cymraeg                | cy\_GB        |
| Afrikaans              | af\_ZA        |
| Czech                  | cs\_CZ        |
| Croatian               | hr\_HR        |
| Slovenian              | si\_SI        |
| Bulgarian              | bg\_BG        |
| Dhivehi                | dv\_MV        |
| Nepali                 | ne\_NP        |
| Somali                 | so\_SO        |
| Hmong                  | hmn\_HMN      |
| Serbian                | sr\_RS        |
| Ukrainian              | uk\_UA        |
| Latvian                | lv\_LV        |
| Slovak                 | sk\_SK        |
| Khmer                  | km\_KH        |
| Filipino               | fil\_PH       |

***

#### Language Resolution Behaviour

The table below summarises how the client resolves language in every possible scenario:

| Situation                                                                    | Behaviour                                                                                                            |
| ---------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- |
| Detected/passed language matches a language added to the survey              | Widget loads in that language. Language selection popup does **not** appear.                                         |
| Detected/passed language does **not** match any language added to the survey | Widget loads in the survey's **default language**. Language selection popup does **not** appear.                     |
| No language is detected and no language is passed                            | Widget loads in the survey's default language. Language selection popup behaviour follows your survey configuration. |

> The language selection popup will **never** open when a language has been detected from the page or explicitly passed via `settings`, regardless of whether the language matches a survey language or not.

***

### Configuring Button Text for Multiple Languages&#x20;

**For Bottom Bar & Side Tab type widgets**

For the **Bottom Bar** and **Side Tab** widgets, the button text visible to your visitors before they open the survey can be customised per language.

To add translated button text:

1. Go to the widget configuration for your **Bottom Bar** or **Side Tab**.
2. Click **Add for other languages** — this opens a language panel listing all languages currently added to your survey.
3. Enter the button text for each language and save.

When a visitor's language is detected or passed, the button text will automatically display in the matching language. If no matching translation is found for the button text, the default language text is used.

> This multilingual button text configuration is available only for the **Bottom Bar** and **Side Tab** widget types.

## Throttling Options for Manual Triggers

Zonka Feedback provides the ability to control how and when widgets appear on your website even when you are using Manual Triggers.  This feature can help improve user experience by ensuring that the widget is not displayed too frequently.

#### Throttling Methods

You can trigger the widget with the following options for controlling its display behavior:

1. **Throttle by Page**\
   This option ensures that the widget is shown only once per page load. After the widget is triggered on the page, it will not appear again on the same page.

   ```javascript
   _zf('startForm', {'widgetId': '3xZbV7', 'throttle': 'page'})
   ```

   * **Usage**: This method is ideal if you want the widget to appear only once per page, regardless of how many times the user refreshes the page.
2. **Throttle by Session**\
   This option ensures that the widget will be triggered only once per session. The session is determined based on the user's visit to your site, and the widget will not appear again until the user’s session expires or they close the browser/tab.

   ```javascript
   _zf('startForm', {'widgetId': '3xZbV7', 'throttle': 'session'})
   ```

   * **Usage**: Use this method if you want the widget to appear only once during the user's entire session. If the user navigates between pages within the same session, the widget will not show again.
3. **Throttle by Session and Page**\
   This option combines both session and page throttling. The widget will be shown only once per page load, and it will not appear again on the same page or during the same session.

   ```javascript
   _zf('startForm', {'widgetId': '3xZbV7', 'throttle': 'session-page'})
   ```

   * **Usage**: This method is useful when you want to ensure that the widget doesn't appear more than once on the same page, and it won’t be triggered again even if the user navigates through different pages within the same session.

#### Example Use Case

Imagine a scenario where you want to show a survey widget to a user only once per page, but you don’t want it to show again on the same page reload or during the same session. A typical scenario can be a survey being triggered after a purchase or a booking has been made.<br>

You can use the following JavaScript code:

```javascript
javascriptCopy_zf('startForm', {'widgetId': '3xZbV7', 'throttle': 'session-page'})
```

This code ensures that the widget will only be triggered once during the entire session, and it won’t show again on the same page load.

## Register Callbacks functions

These events allow you to execute any JavaScript code at specific moments in the lifecycle of a survey. For example, redirect a user to a new page once they complete a survey.

Zonka Feedback offers the following functions:

<table><thead><tr><th width="210.5">Function</th><th></th></tr></thead><tbody><tr><td>onClose()</td><td>Gets called when the user dismissed a survey by clicking on the “x” in the top right corner.</td></tr><tr><td>onOpen()</td><td>Gets called when a survey widget becomes visible to your user.</td></tr><tr><td>onSubmit()</td><td>Gets called when the user completed (submitted) the entire survey.</td></tr></tbody></table>

## Page overwriting

There are instances when the page titles are difficult to understand and filter, hence you can rename these pages with a user-friendly names. Here is how you can do it.

```javascript
_zf("pageTracking",
    {
    "title":"This is custom page title", 
    "path":"/product/detail"
    }
   ); 
```

## Disable client

Next to importing user characteristics, Zonka Feedback also lets you track user event data. You can use event tracking to launch in-app surveys for users that performed – or didn’t perform.

You can turn off the customer tracking by simply manipulating the following variable - disableTracking is `enabled/disabled` and publishing it within your Javascript client code.&#x20;

```css
_zf(“disableTracking”,true);
```

If you wish to turn it back on, you can simply remove it.

## Reset on Logout

Zonka Feedback allows you to delete individual logged-in users' browser data by using the `resetUser` method. The method resets all visitor/logged-in user data stored in their localStorage, or sessionStorage. This information includes attributes, session history, survey responses stored in the browser, etc.&#x20;

We recommend using this when the user logs out of your web app.

```javascript
_zf(‘resetUser’);
```

## Getting Help <a href="#getting-help" id="getting-help"></a>

To get help with the JS client troubleshooting, please contact ZF Support. Our team will help you diagnose the issue you must be facing while setting up your web surveys.&#x20;


# What all data is collected

## Captured Information with a Response

The following data is collected by the widget when placed and activated on your web app or website.

<table><thead><tr><th width="240">Property</th><th width="342">Description</th><th width="98">Logged In Visitor</th><th width="205">Anonymous Visitor</th></tr></thead><tbody><tr><td>First Page Seen</td><td>First page URL the visitor/user lands on your web page</td><td>Yes</td><td>Yes</td></tr><tr><td>Last Page Seen</td><td>The last page URL of the visitor/user lands on your web page before the session ends</td><td>Yes</td><td>Yes</td></tr><tr><td>First Seen</td><td>Timestamp of the visitor/user’s first visit to your web page or App using widget or SDK (iOS or Android)</td><td>Yes</td><td>Yes</td></tr><tr><td>First Seen on iOS</td><td>Timestamp of the visitor/user’s first visit to your iOS App where SDK is installed</td><td>Yes</td><td>No</td></tr><tr><td>First Seen on Android</td><td>Timestamp of the visitor/user’s first visit to your Android App where SDK is installed</td><td>Yes</td><td>No</td></tr><tr><td>Last Seen</td><td>Timestamp of the visitor/user’s last visit to your web page or App using widget or SDK (iOS or Android)</td><td>Yes</td><td>Yes</td></tr><tr><td>First Referring Site</td><td>URL of the first referring site for the first landing page visit by the visitor/user</td><td>Yes</td><td>Yes</td></tr><tr><td>Number of Pages Viewed</td><td>Total number of pages viewed by the visitor since the first visit</td><td>Yes</td><td>Yes</td></tr><tr><td>Source</td><td>Source of URL on which the user landed for the first time (Paid, Referral, Organic, Direct)</td><td>Yes</td><td>Yes</td></tr><tr><td>UTM Term</td><td>UTM Term captured from the First Page Seen</td><td>Yes</td><td>Yes</td></tr><tr><td>UTM Medium</td><td>UTM Medium captured from the First Page Seen</td><td>Yes</td><td>Yes</td></tr><tr><td>UTM Campaign</td><td>UTM Campaign captured from the First Page Seen</td><td>Yes</td><td>Yes</td></tr><tr><td>UTM Source</td><td>UTM Source captured from the First Page Seen</td><td>Yes</td><td>Yes</td></tr><tr><td>UTM Content</td><td>UTM Content captured from the First Page Seen</td><td>Yes</td><td>Yes</td></tr><tr><td>First Browser</td><td>First Browser used by the visitor/user</td><td>Yes</td><td>Yes</td></tr><tr><td>Last Browser</td><td>Last Browser used by the visitor/user</td><td>Yes</td><td>Yes</td></tr><tr><td>First Browser Version</td><td>The version of the first browser used</td><td>Yes</td><td>Yes</td></tr><tr><td>Last Browser Version</td><td>The version of the last browser used</td><td>Yes</td><td>Yes</td></tr><tr><td>First IP Address</td><td>The IP address from the first visit of the visitor/user on Widget or SDK</td><td>Yes</td><td>Yes</td></tr><tr><td>Last IP Address</td><td>The IP address from the last visit of the visitor/user on Widget or SDK</td><td>Yes</td><td>Yes</td></tr><tr><td>First IP Country</td><td>The IP Country from the first visit of the visitor/user on Widget or SDK</td><td>Yes</td><td>Yes</td></tr><tr><td>Last IP Country</td><td>The IP from the last visit of the visitor/user on Widget or SDK</td><td>Yes</td><td>Yes</td></tr><tr><td>First OS Used</td><td>The OS from the first visit of the visitor/user on Widget or SDK</td><td>Yes</td><td>Yes</td></tr><tr><td>Last OS Used</td><td>The OS from the last visit of the visitor/user on Widget or SDK</td><td>Yes</td><td>Yes</td></tr><tr><td>First User Agent</td><td>Full User Agent from the first visit of the visitor/user</td><td>Yes</td><td>Yes</td></tr><tr><td>Last User Agent</td><td>Full User Agent from the last visit of the visitor/user</td><td>Yes</td><td>Yes</td></tr><tr><td>First Screen Size</td><td>Screen resolution of the device from the first visit of the visitor/user</td><td>Yes</td><td>Yes</td></tr><tr><td>Last Screen Size</td><td>Screen resolution of the device from last visit of the visitor/user</td><td>Yes</td><td>Yes</td></tr><tr><td>First Browser Language</td><td>Language of the browser detected on the first visit of the visitor/user</td><td>Yes</td><td>Yes</td></tr><tr><td>Last Browser Language</td><td>Language of the browser detected on the last visit of the visitor/user</td><td>Yes</td><td>Yes</td></tr><tr><td>Last Response</td><td>Timestamp of the last response given by the visitor/user</td><td>Yes</td><td>Yes</td></tr><tr><td>Last Web Widget Shown</td><td>Timestamp of the widget last visible to the visitor/user</td><td>Yes</td><td>Yes</td></tr><tr><td>Last Email Sent</td><td>Timestamp of the last Email survey sent to the user</td><td>Yes</td><td>No</td></tr><tr><td>Last SMS sent</td><td>Timestamp of the last SMS survey given by the user</td><td>Yes</td><td>No</td></tr><tr><td>Last Survey Viewed</td><td>Timestamp of the last survey viewed by the user through any channel (Email, SMS Online or Widget)</td><td>Yes</td><td>Yes</td></tr><tr><td>Number of Sessions</td><td>Total number of sessions of the visitor/user</td><td>Yes</td><td>Yes</td></tr><tr><td>Number of Surveys Answered</td><td>Total number of surveys answered by the visitor/user through any channel (Email, SMS Online or Widget)</td><td>Yes</td><td>Yes</td></tr><tr><td>Average NPS</td><td>Average NPS of all the responses submitted by the user</td><td>Yes</td><td>No</td></tr><tr><td>Average CES</td><td>Average CES of all the responses submitted by the user</td><td>Yes</td><td>No</td></tr><tr><td>Average CSAT</td><td>Average CSAT of all the responses submitted by the user</td><td>Yes</td><td>No</td></tr><tr><td>Last Response</td><td>Timestamp of the last response given by the visitor/user</td><td>Yes</td><td>Yes</td></tr><tr><td>Last Survey</td><td>Survey ID of the last survey viewed by the visitor/user through any channel (Email, SMS Online or Widget)</td><td>Yes</td><td>Yes</td></tr><tr><td>Pages Viewed</td><td>List of all the URLs visited by the visitor/user </td><td>Yes</td><td>Yes</td></tr></tbody></table>


# Content Security Policy

CSP provides a layer of security for you by protecting you from unwanted Scripts and XSS attacks. If your website or web app makes use of CSP then add the following domain names to your policy to help run the Zonka Feedback widget smoothly.

```javascript
connect-src: 
'self' https://*.zonkafeedback.com
 wss:https://*.zonkafeedback.com;


script-src: 
https://us-js.zonka.co 
https://e-js.zonka.co
https://au-js.zonka.co
https://in-js.zonka.co

frame-src: 
https://us1.zonka.co 
https://e.zonka.co
https://au-js.zonka.co
https://in-js.zonka.co



worker-src blob:
https://cdn.socket.io/4.3.2/socket.io.min.js



```


# Web Storage and Cookies

### **Usage of Web Storage**

The Zonka Feedback Web client makes use of the Local Storage of the web browser to store data related to the users/visitors of your web page. The type of data that is stored in the local storage as follows:

* First Seen: Time Stamp of when this browser was first seen
* User Agent: Full details of the user agent used by the visitor/user
* Pages Viewed details: All the pages the user has navigated with domain names and URLs
* Device details: Device details such as type and resolution

### **Usage of Cookies**

The Zonka Feedback web client uses Cookies to store data locally in the browser of your visitors and users. This is to ensure that the Zonka Feedback client works in the right manner.

When the JS Client is loaded, the following two cookies are dropped. The description of each is provided below.

<table><thead><tr><th width="229"></th><th></th></tr></thead><tbody><tr><td>zfm_cnt_ck_id</td><td>This id is used to identify a unique visitor on the web page. This id is referenced to decide the behavior of the widget on configuration and settings</td></tr><tr><td>zfm_usr_sess_ck_id</td><td>This id is used to identify the current session of the visitor and expires automatically when expiring conditions are met</td></tr><tr><td>Dynamic Cookies</td><td>These cookies are created as per the requirement and behavior settings of the widget. The data stored consists of random strings and timestamps which are used to make the widget behave based on the settings you have set up while configuring and activating it in your Zonka Feedback account. For example, if you have set up the widget to show only once to a user even if they have not submitted a response it is tracked based on data stored locally.</td></tr></tbody></table>

The above cookies share the following characteristics

* The expiration date of the Cookies if 365 days which is renewed on every visit
* The cookies can be only accessed using a secured connection only
* The cookies are only applicable to your domain name and cant be used by any other domain or service


# In-App SDK

Zonka Feedback lets you to embed surveys in your android and iOS applications and effectively target your app users to provide feedback. You can simply achieve that by adding a few lines of code triggered by any event within the application.

### Pre-requisites for Android Application

There are a few prerequisites for implementing this feature in your android mobile application and start collecting responses from your users such as

1. An application supported in Java or Kotlin.
2. A Zonka Feedback plan with SDK integration included
3. Android Studio to set up the project.

### Pre-requisites for iOS Application

There are few pre-requisites to implement ZF SDK in ios application also.

1. Device should have iOS version 12.0 and above
2. Support for swift 5.0 and above is required&#x20;
3. Xcode 14.0 and above is recommended to set up the project.


# Android SDK

## Pre Requisites

Zonka Feedback Mobile SDK requires an active [Zonka Feedback](https://www.zonkafeedback.com/) account. In order to successfully run and test out the survey you would need to have an SDK token for the survey you want to implement. If you are already a user and have access to your SDK token you can directly jump to the Installation section. If not, read on and follow the following steps:

* Create a [new account](https://www.zonkafeedback.com/free-trial-signup) on Zonka Feedback
* Create a new survey with a choice of questions you would like to implement
* Once your survey is created go to Distribute menu and click on the In-App tab
* Enable the toggle to view the SDK token
* Follow the below-mentioned steps to implement it in your app

{% hint style="info" %}
Learn more about creating surveys on Zonka Feedback [here](https://help.zonkafeedback.com/en/articles/6389318-getting-started-with-zonka-feedback)
{% endhint %}

## Minimum Requirements

Android SDK enables you to collect feedback from your Android App and is compatible with apps running on both mobile and tablets.

* Targeting Android minimum API version 16.
* Java or Kotlin

## Installation

Add it to your **root** `build.gradle` at the end of repositories:

```javascript
allprojects {
  repositories {
    ...
    maven { url 'https://jitpack.io' }
  }
}
```

Add the following line to your **app module** `build.gradle` file dependencies

```javascript
implementation 'com.github.zonka-feedback:android-sdk:v1.0.2
```

### Setup

**Initialize `ZFSurvey` Object**

Create an SDK token for the required survey from Distribute menu and use that to initialize the `ZFSurvey` object in your Application Class. Also, specify the region of your Zonka Feedback account.&#x20;

For specifying the region use `US` for the US region and `EU` for EU region.&#x20;

***Java***

```javascript
import com.zonkafeedback.zfsdk.ZFSurvey;
public class MyApplication extends Application {


    @Override
    public void onCreate() {
        super.onCreate();
        ZFSurvey.init(ApplicationContext, "SDK_TOKEN", "REGION");
    }
}
```

***Kotlin***

```javascript
import com.zonkafeedback.zfsdk.ZFSurvey

class MyApplication : Application() {

    override fun onCreate() {
        super.onCreate()
        ZFSurvey.init(ApplicationContext, "SDK_TOKEN", "REGION")

    }
}
```

### **Create an `ZFSurvey` object**

Create a `ZFSurvey` object to configure and start Survey for feedback in your Activity/Fragment.

***Java***

```javascript
ZFSurvey.getInstance().startSurvey(this);
```

***Kotlin***

```javascript
ZFSurvey.getInstance().startSurvey(this)
```

### Optional Parameters

#### **Using `sendDeviceDetails`**

You can set the value of sendDeviceDetails to true if you want to submit details of your device along with the Zonka Feedback survey response. This would send the details of the device such as OS, OS version, IP address, and type of device. When you implement SDK it's true by default.

#### Example:

***Java***

```java
import com.zonkafeedback.zfsdk.ZFSurvey;

             ZFSurvey.getInstance()
                     .sendDeviceDetails(true)
                      .startSurvey(this);
```

***Kotlin***

```kotlin
import com.zonkafeedback.zfsdk.ZFSurvey

             ZFSurvey.getInstance()
                     .sendDeviceDetails(true)
                      .startSurvey(this);
```

#### **Using `sendCustomAttributes`**

You can pass additional data about your users to provide more meaningful data along with the response. Some of the examples can be screen name, order Id, or transaction Id which can be associated with the response.

Attributes can be used to:

* Identify respondents (by default survey responses are anonymous)
* Trigger surveys
* Filter survey results

#### Example

***Java***

```java
import com.zonkafeedback.zfsdk.ZFSurvey;

    HashMap<String, Object> hashMap = new HashMap<>();
            hashMap.put("contact_email" , "james@examplemail.com");
            hashMap.put("contact_name", "James Robinson");
            hashMap.put("contact_mobile" , "+91019019010");

             ZFSurvey.getInstance()
                     .sendCustomAttributes(hashMap)
                      .startSurvey(this);

```

***Kotlin***

```kotlin
import com.zonkafeedback.zfsdk.ZFSurvey


   val hashMap : HashMap<String, Object> = HashMap<>()
            hashMap.["contact_email" , "james@examplemail.com"] //Send User Email
            hashMap.["contact_name" , "James Robinson"] //Send User Name
            hashMap.["contact_mobile" , "+919191919191"] //Send User Mobile Number

             ZFSurvey.getInstance()
                     .sendCustomAttributes(hashMap)
                      .startSurvey(this);
```

## Identifying Logged in Visitors

If you have an app where users are able to log in or signup then you can add the following code to automatically add the contacts in Zonka Feedback. You can pass at least one of the following parameters to identify the users.

<table><thead><tr><th>Parameter</th><th>Type</th><th width="243.66666666666669"> Example</th></tr></thead><tbody><tr><td>contact_name</td><td>string</td><td>"Josh Holland"</td></tr><tr><td>contact_email </td><td>string</td><td>"example@company.com"</td></tr><tr><td>contact_mobile</td><td>string</td><td>"+14532323223"</td></tr><tr><td>contac_uniqueId</td><td>string</td><td>"k2334"</td></tr></tbody></table>

***Java***

<pre class="language-java"><code class="lang-java"><strong>HashMap&#x3C;String, Object> hashMap = new HashMap&#x3C;>();
</strong>hashMap.put("contact_email" , "james@examplemail.com");
hashMap.put("contact_name", "James Robinson");
hashMap.put("contact_mobile" , "+919191919191");
ZFSurvey.getInstance().userInfo(hashMap);
</code></pre>

***Kotlin***

```kotlin
HashMap<String, Object> hashMap = new HashMap<>()
hashMap.put("contact_email" , "james@examplemail.com")
hashMap.put("contact_name", "James Robinson")
hashMap.put("contact_mobile" , "+919191919191")
ZFSurvey.getInstance().userInfo(hashMap)
```

### Reset Visitor Attributes

If you are using the above code to identify users, then it might be a good idea to clear visitor data on logout. Use the below code to clear the data.

***Java***

```java
ZFSurvey.getInstance().clear();
```

***Kotlin***

```kotlin
ZFSurvey.getInstance().clear()
```


# iOS SDK

## Pre Requisites

Zonka Feedback Mobile SDK requires an active [Zonka Feedback](https://www.zonkafeedback.com/) account. In order to successfully run and test out the survey you would need to have an SDK token for the survey you want to implement. If you are already a user and have access to your SDK token you can directly jump to the Installation section. If not, read on and follow the following steps:

* Create a [new account](https://www.zonkafeedback.com/free-trial-signup) on Zonka Feedback
* Create a new survey with a choice of questions you would like to implement
* Once your survey is created go to Distribute menu and click on the In-App tab
* Enable the toggle to view the SDK token
* Follow the below-mentioned steps to implement it in your app

{% hint style="info" %}
Learn more about creating surveys on Zonka Feedback [her](https://help.zonkafeedback.com/en/articles/6389318-getting-started-with-zonka-feedback)[e](https://help.zonkafeedback.com/en/articles/6389318-getting-started-with-zonka-feedback)
{% endhint %}

## Minimum Requirements

iOS SDK enables you to collect feedback from your iOS App on iPhone and iPad.

* Recommended using Xcode 13 or above.
* Targeting iOS 12.1 or above.
* Swift 5

## Installation

### Installing using CocoaPods

Define pod in your Pod ruby file and run `pod install.`

```ruby
source "https://github.com/CocoaPods/Specs.git"
platform: ios, "12.1"
use_frameworks!

pod "ZonkaFeedback"
```

Then run

```ruby
pod install
```

### ​Adding framework directly

If you do not want to install manually then you can directly add *`ZonkaFeedback.framework`* to your Xcode project.

[**Download**](https://zonkafeedback.com/hubfs/ZonkaFeedback.zip)

Once downloaded, follow these steps:

1. Drag ZonkaFeedback.framework into your project. Make sure "Copy items if needed" is selected and click Finish.
2. In the target settings for your app, set the ZonkaFeedback.framework to “Embed & Sign”. You'll find it in the “Frameworks, Libraries, and Embedded Content” section of the “General” tab.

### Setup <a href="#setup" id="setup"></a>

Create an In-App SDK token for the required survey from Distribute menu and use that to initialize the survey using the SDK

#### Initialize ZFSurvey <a href="#initialize-zfsurvey" id="initialize-zfsurvey"></a>

Create an SDK token for the required survey from Distribute menu and use that to initialize the ZFSurvey object in your AppDelegate Class. Also, specify the region of your Zonka Feedback account.<br>

For specifying the region use `US` for the US region and `EU` for EU region.

**Swift**

```swift
import ZonkaFeedback

class AppDelegate: UIResponder, UIApplicationDelegate 
{
    func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool
     {
          ZFSurvey.sharedInstance().initializeSDK(token: "<<SDK_TOKEN>>",zfRegion: "<<REGION>>")
     
          return true
     }
}

```

**Initialization in SwiftUI projects, with no AppDelegate class**

ZonkaFeedback iOS SDK can be used in SwiftUI projects. If your SwiftUI project doesn’t use the AppDelegate class, the initialization can be done in the constructor of the main application class:

```swift
import ZonkaFeedback

@main
struct SwiftUIApp: App 
{
    init() 
    {
          ZFSurvey.sharedInstance().initializeSDK(token: "<<SDK_TOKEN>>",zfRegion: "<<REGION>>")
    }
}

```

**Objective-C**

```objectivec
 #import <ZonkaFeedback-Swift.h>


-(BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
     [[ZFSurvey sharedInstance] initializeSDKWithToken:@"<<SDK_TOKEN>>" zfRegion:@"<<REGION>>"];
}

```

## Identifying Logged in Visitors <a href="#identifying-logged-in-visitors" id="identifying-logged-in-visitors"></a>

If you have an app where users are able to log in or signup then you can add the following code to automatically add the contacts in Zonka Feedback. You can pass at least one of the following parameters to identify the users.

#### &#x20;<a href="#example" id="example"></a>

| Parameter         | Type   | Example                 |
| ----------------- | ------ | ----------------------- |
| contact\_name     | string | "Josh Holland"          |
| contact\_email    | string | "<example@company.com>" |
| contact\_mobile   | string | "+14532323223"          |
| contact\_uniqueId | string | "k2334"                 |

**Swift**

```swift
   import ZonkaFeedback
    
   let userInfoDict = NSMutableDictionary()
   userInfoDict.setValue("james@examplemail.com", forKey: "contact_email")
   userInfoDict.setValue("James Robinson", forKey: "contact_name")
   userInfoDict.setValue("+919191919191”, forKey: "contact_mobile")
   ZFSurvey.sharedInstance().userInfo(dict: userInfoDict)
   
```

**Objective-C**

```objectivec
  #import <ZonkaFeedback-Swift.h>

  NSMutableDictionary *userInfoDict = [[NSMutableDictionary alloc]init]; 
  [userInfoDict setValue:@"james@examplemail.com" forKey:@"contact_email"];  
  [userInfoDict setValue:@"James Robinson" forKey:@"contact_name"];
  [userInfoDict setValue:@"+919191919191" forKey:@"contact_mobile"];      
  [[ZFSurvey sharedInstance] userInfoWithDict:userInfoDict];
  
```

### Using ZonkaFeedback SDK <a href="#using-zonkafeedback-sdk" id="using-zonkafeedback-sdk"></a>

ZonkaFeedback SDK allows you to launch precisely targeted surveys inside your app. In the Zonka Feedback web Panel you can create a survey and use it on anywhere within your app.

Create an instance of ZFSurveyViewController in any ViewController you want to integrate the survey.

```swift
let surveyViewController = ZFSurveyViewController()
```

## Optional Parameters <a href="#parameters" id="parameters"></a>

### **Using `sendDeviceDetails`  (Optional)**

You can set the value of `sendDeviceDetails` to true if you want to submit details of your device along with the Zonka Feedback survey response. This would send the details of the device such as OS, OS version, IP address, and type of device. When you implement SDK it’s true by default.

### **Using `sendCustomAttributes` (Optional)**

You can pass additional data about your users to provide more meaningful data along with the response. Some of the examples can be screen name, order Id, or transaction Id which can be associated with the response.

Attributes can be used to do the following:

* Identify respondents (by default survey responses are anonymous)
* Trigger surveys
* Filter survey results

**Swift**

```swift
    import ZonkaFeedback
    
    func openSurvey()
    {
        let surveyViewController = ZFSurveyViewController()
        surveyViewController.sendDeviceDetails = true
        
        let attributesDict = NSMutableDictionary()
        attributesDict.setValue("james@examplemail.com", forKey: "contact_email")
        attributesDict.setValue("James Robinson", forKey: "contact_name")
        attributesDict.setValue("+919191919191”, forKey: "contact_mobile")
        surveyViewController.sendCustomAttributes = attributesDict
        self.view.addSubview(surveyViewController.view)
    }

```

**Objective-C**

```objectivec
   #import <ZonkaFeedback-Swift.h>

  -(void)openSurvey
  {                    
        ZFSurveyViewController *surveyViewController = [ZFSurveyViewController new];
        surveyViewController.sendDeviceDetails = true;
       
        NSMutableDictionary *attributesDict = [[NSMutableDictionary alloc]init];
        [attributesDict setValue:@"james@examplemail.com" forKey:@"contact_email"];  
        [attributesDict setValue:@"James Robinson" forKey:@"contact_name"];
        [attributesDict setValue:@"+919191919191" forKey:@"contact_mobile"]; 
         surveyViewController.sendCustomAttributes = attributesDict;
        [self.view addSubview:surveyViewController.view];
  }
  

```

## Reset Visitor Attributes <a href="#reset-visitor-attributes" id="reset-visitor-attributes"></a>

If you are using the above code to identify users, then it might be a good idea to clear visitor data on logout. Use the below code to clear the data.

**Swift**

```swift
    import ZonkaFeedbackSDK
    
    func logout()
    {
        ZFSurvey.sharedInstance().clear()
    }

```

**Objective-C**

```objectivec
   #import <ZonkaFeedback-Swift.h>

  -(void)logout
  {
     [[ZFSurvey sharedInstance] clear];
  }
  
```


# Flutter SDK

## Pre Requisites

Zonka Feedback Flutter SDK requires an active [Zonka Feedback](https://www.zonkafeedback.com/) account. To successfully run and test out the survey you would need to have an SDK token for the survey you want to implement. If you are already a user and have access to your SDK token you can directly jump to the Installation section. If not, read on and follow the following steps:

* Create a [new account](https://www.zonkafeedback.com/free-trial-signup) on Zonka Feedback
* Create a new survey with a choice of questions you would like to implement
* Once your survey is created go to Distribute menu and click on the In-App tab
* Enable the toggle to view the SDK token
* Follow the below-mentioned steps to implement it in your app

{% hint style="info" %}
Learn more about creating surveys on Zonka Feedback [here](https://help.zonkafeedback.com/en/articles/6389318-getting-started-with-zonka-feedback)
{% endhint %}

## Minimum Requirements

Flutter SDK enables you to collect feedback from your Android App and is compatible with apps running on both mobile and tablets for iOS and Android operating systems.

**Flutter**

* Flutter version 3.0.0 or higher.

**Android**

* CompileSdk version 34 or higher.
* Android Gradle Plugin version 8.1.0 or higher with a compatible Gradle version.

**iOS**

* iOS 14 or higher.

## Installation

To use this SDK, add `zonkafeedback_sdk` as a [dependency in your pubspec.yaml file](https://flutter.dev/docs/development/platform-integration/platform-channels).

### Initialize

Initialize the SDK in your application using `init()` method. Call this method only once, in the main component (e.g. `lib/main.dart` file).

```dart
import 'package:zonkafeedback_sdk/zonkafeedback_sdk.dart';

class _MyAppState extends State<MyApp> {
  @override
  void initState() {
    super.initState();
    ZFSurvey().init(token: {{SDK_TOKEN}} ,zfRegion: '{{REGION}}',context: context);;
  }
}
```

For Regions use the following

* US - for US Region
* EU - for European Region
* IN - for India Region

### Setup&#x20;

Create a `ZFSurvey` object to configure and start the survey for feedback in your function.

<pre class="language-dart"><code class="lang-dart">import 'package:zonkafeedback_sdk/zonkafeedback_sdk.dart';

<strong>ZFSurvey().startSurvey();
</strong></code></pre>

### Optional Parameters

#### **Using `sendDeviceDetails`**

You can set the value of sendDeviceDetails to true if you want to submit details of your device along with the Zonka Feedback survey response. This would send the details of the device such as OS, OS version, IP address, and type of device. When you implement SDK it's true by default.

```dart
import 'package:zonkafeedback_sdk/zonkafeedback_sdk.dart';

ZFSurvey().sendDeviceDetails(true);
```

#### **Using `sendCustomAttributes`**

You can pass additional data about your users to provide more meaningful data along with the response. Some of the examples can be screen name, order ID, or transaction Id which can be associated with the response.

Attributes can be used to:

* Identify respondents (by default survey responses are anonymous)
* Trigger surveys
* Filter survey results

#### Example

```dart
import 'package:zonkafeedback_sdk/zonkafeedback_sdk.dart';

Map<String, String> properties = {
  'property1': 'value1',
  'property2': 'value2',
};

ZFSurvey().sendCustomAttributes(properties);
```

## Identifying Logged-in Visitors

If you have an app where users are able to log in or signup then you can add the following code to automatically add the contacts in Zonka Feedback. You can pass at least one of the following parameters to identify the users.

<table><thead><tr><th>Parameter</th><th>Type</th><th width="243.66666666666669"> Example</th></tr></thead><tbody><tr><td>contact_name</td><td>string</td><td>"Josh Holland"</td></tr><tr><td>contact_email </td><td>string</td><td>"example@company.com"</td></tr><tr><td>contact_mobile</td><td>string</td><td>"+14532323223"</td></tr><tr><td>contac_uniqueId</td><td>string</td><td>"k2334"</td></tr></tbody></table>

**Example**

<pre class="language-dart"><code class="lang-dart">import 'package:zonkafeedback_sdk/zonkafeedback_sdk.dart';

Map&#x3C;String, dynamic> properties = {
  'contact_name': 'Robin James',
  'contact_email': 'robin@example.com',
  'contact_uniqueId': '1XJ2',
  'contact_mobile': '+14234XXXX'
};

<strong>ZFSurvey().userInfo(properties);
</strong></code></pre>

### Reset Visitor Attributes

If you are using the above code to identify users, then it might be a good idea to clear visitor data on logout. Use the below code to clear the data.

**Example**

```java
ZFSurvey().clear();
```


# React Native SDK

## Pre Requisites

Zonka Feedback Mobile SDK requires an active [Zonka Feedback](https://www.zonkafeedback.com/) account. In order to successfully run and test out the survey you would need to have an SDK token for the survey you want to implement. If you are already a user and have access to your SDK token you can directly jump to the Installation section. If not, read on and follow the following steps:

* Create a [new account](https://www.zonkafeedback.com/free-trial-signup) on Zonka Feedback
* Create a new survey with a choice of questions you would like to implement
* Once your survey is created go to Distribute menu and click on the In-App tab
* Enable the toggle to view the SDK token
* Follow the below-mentioned steps to implement it in your app

{% hint style="info" %}
Learn more about creating surveys on Zonka Feedback [her](https://help.zonkafeedback.com/en/articles/6389318-getting-started-with-zonka-feedback)[e](https://help.zonkafeedback.com/en/articles/6389318-getting-started-with-zonka-feedback)
{% endhint %}

## Minimum Requirements

The react-native version should be 0.60 or more.

## Installation

For installation, run the following

```jsx
npm install react-native-zonkafeedback
npm install react-native-device-info
npm install @react-native-community/netinfo
```

* Minimum version of react-native-community/netinfo should be 6.0.2.
* Minimum version of react-native-device-info should be 9.0.2.

## ​Initialization

Create an SDK token for the required survey from Distribute menu and use that to initialize the SDK.\
For specifying the region use `US` for the US region and `EU` for EU region.

Wrap the portion of your app inside HOC i.e Zonka Provider with token and region.

```tsx
import {ZonkaFeedback} from "react-native-zonkafeedback";
const AppWithZonkaFeedback = () => {
  return (
    <ZonkaFeedback value={{token:"YOUR SDK TOKEN",region:"REGION"}}>
      <YourApp />
    </ZonkaFeedback>
  );
};
```

## Identifying Logged in Visitors <a href="#identifying-logged-in-visitors" id="identifying-logged-in-visitors"></a>

If you have an app where users are able to log in or signup then you can add the following code to automatically add the contacts in Zonka Feedback. You can pass at least one of the following parameters to identify the users.

#### &#x20;<a href="#example" id="example"></a>

| Parameter         | Type   | Example                 |
| ----------------- | ------ | ----------------------- |
| contact\_name     | string | "Josh Holland"          |
| contact\_email    | string | "<example@company.com>" |
| contact\_mobile   | string | "+14532323223"          |
| contact\_uniqueId | string | "k2334"                 |

```swift
import {useZFSurvey} from "react-native-zonkafeedback";
const HomeScreen = () => {
 const {userInfo} = useZFSurvey();
 const hash = {contact_email:"james@examplemail.com",
 contact_name:"James Robinson",
 contact_mobile:"+91019019010"
 }
 userInfo(hash)
}
```

### &#x20;<a href="#using-zonkafeedback-sdk" id="using-zonkafeedback-sdk"></a>

## Optional Parameters <a href="#parameters" id="parameters"></a>

### **Using `sendDeviceDetails`  (Optional)**

You can set the value of `sendDeviceDetails` to true if you want to submit details of your device along with the Zonka Feedback survey response. This would send the details of the device such as OS, OS version, IP address, and type of device. When you implement SDK it’s true by default.// Some co

```tsx
import {useZFSurvey} from "react-native-zonkafeedback";
const HomeScreen = () => {
 const { sendDeviceDetails} = useZFSurvey();
 sendDeviceDetails(true).startSurvey();
}
```

### **Using `sendCustomAttributes` (Optional)**

You can pass additional data about your users to provide more meaningful data along with the response. Some of the examples can be screen name, order Id, or transaction Id which can be associated with the response.

Attributes can be used to do the following:

* Identify respondents (by default survey responses are anonymous)
* Trigger surveys
* Filter survey result

```tsx

import {useZFSurvey} from "react-native-zonkafeedback";
const const HomeScreen = () => {
 const { sendCustomAttributes} = useZFSurvey();
 const hash = {contact_email:"james@examplemail.com",
 contact_name:"James Robinson",
 contact_mobile:"+91019019010"
 }
 sendCustomAttributes(hash).startSurvey();
}
```

## Reset Visitor Attributes <a href="#reset-visitor-attributes" id="reset-visitor-attributes"></a>

If you are using the above code to identify users, then it might be a good idea to clear visitor data on logout. Use the below code to clear the data.

```tsx
import {useZFSurvey} from "react-native-zonkafeedback";
const HomeScreen = () => {
 const {clear} = useZFSurvey();
 clear()
}
```


# Zonka Feedback MCP Server

**How Zonka Feedback MCP works?**

The Model Context Protocol (MCP) is an open standard that lets AI tools and applications connect to Zonka Feedback's data and services in a secure, standardized way. With the Zonka Feedback MCP server, AI assistants and agents — Claude, ChatGPT, Gemini, Cursor, Claude Code, Codex, and any other MCP-capable client — can:

* Query your CX metrics — NPS, CES, CSAT, sentiment — as values, trends, breakdowns, and pivots
* Search and read survey responses, reviews, and feedback from connected sources
* Explore AI Feedback Intelligence themes, subthemes, and the verbatim quotes behind them
* Look up contacts, segments, locations, users, and data sources
* Answer questions about your feedback program directly in chat, with your live data

Zonka Feedback operates a remote MCP server that follows the authenticated remote MCP specification. It's a published connector in both the **Claude connector directory** and the **ChatGPT apps directory**, and it also works with any other MCP-capable client. You connect once — approving access in your browser (OAuth) or pasting a personal access token — and your AI tool can then use Zonka Feedback tools with the same permissions as your Zonka Feedback user.

#### Enabling the MCP server (for admins)

Before anyone on your account can connect, an admin turns the MCP server on. It's a single account-level switch:

1. Go to **Settings → AI Governance → AI Features**.
2. Scroll to the **Agents & MCP** section.
3. Turn on **Connect MCP** — this lets users connect Zonka Feedback to AI agents and tools like Claude and ChatGPT over MCP.

Once it's enabled, **every user on the account can connect their own AI tool** — the admin doesn't set anyone up individually. Each connection still runs with that user's own role, permissions, and location access (see [Permissions and data access](https://claude.ai/chat/b88334bb-7b4b-46cb-846d-6a7f52abc1d9#permissions-and-data-access) below), so turning MCP on doesn't widen what any individual can see — it only opens the door. Until it's enabled, connection attempts won't succeed.

#### Authentication

There are two ways to authenticate, depending on your client. Either way, access is scoped to your Zonka Feedback user and is read-only.

* **OAuth** — for clients that support browser sign-in (Claude, ChatGPT, Cursor, and others). Nothing to copy.
* **Personal Access Token** — for clients that don't support sign-in (Gemini CLI, Claude Code, Codex, VS Code, custom agents). You create a token and send it as a Bearer credential.

**OAuth**

Sign in through your browser and approve the connection — no keys to copy. The Zonka Feedback MCP server implements OAuth 2.1 with PKCE, so any MCP client that supports remote OAuth servers (Claude, ChatGPT, Cursor, and others) can connect with just the server URL. Access is scoped to your Zonka Feedback user: the AI tool sees exactly what you can see in the app, nothing more.

**Personal Access Tokens**

Some clients — Gemini CLI, Claude Code, Codex, VS Code, Cursor, and custom agents — can connect with a token instead of browser sign-in. A personal access token is tied to you: it carries your exact role, permissions, and location access, is **read-only**, and stops working the moment you're removed from the account, your access changes, or the token expires or is revoked. It can never do more than you can do in the app.

To create one:

1. In Zonka Feedback, open your profile settings → **Zonka Feedback MCP** → **Personal Access Tokens**.
2. Enter a name you'll recognize later (for example, "Cursor on work laptop"), choose an expiry, and click **Create Token**.
3. Copy the token immediately — it's shown **once** and can't be retrieved again. It looks like `zf_…`.

Manage tokens from the same screen: each row shows when it was created, when it was last used, and when it expires, with a **Revoke** action that disables it instantly. Create a separate token per tool, so you can revoke one without affecting the others, and keep tokens out of version-controlled files (use an environment variable or your client's secret input where possible).

> For Public API access (not MCP), use the Auth Token under **Settings → API & Data Center** instead — that's a different credential.

#### Set up your AI tool

The fastest path for Claude and ChatGPT is the Connect AI Agents page inside Zonka Feedback — it gives you a one-click install link for Claude and copy-ready snippets for ChatGPT. The manual steps are below.

**Claude (claude.ai and Claude Desktop)**

Zonka Feedback is listed in Claude's connector directory. Follow these steps to connect:

1. Open Zonka Feedback in the directory: **<https://claude.ai/directory/connectors/zonka-feedback>** — or, in Claude, go to **Settings → Connectors** and find **Zonka Feedback** in the directory.
2. Click **Connect**.
3. Sign in to Zonka Feedback and authorize when the approval screen opens in your browser.

The steps are identical on the web and desktop apps, and it works with any Claude plan that supports connectors.

**ChatGPT**

Zonka Feedback is listed in the Open AI's plugin directory. Follow these steps to connect:

1. Open Zonka Feedback in ChatGPT: **<https://chatgpt.com/plugins/plugin\\_asdk\\_app\\_6a38d64daec08191b34b8e9f280c64e0>** — or, in ChatGPT, open **Settings → Apps & Connectors** and search for **Zonka Feedback**.
2. Click **Connect**.
3. Sign in to Zonka Feedback and authorize when prompted.

Available on ChatGPT plans that support apps and connectors.

The clients below don't support browser sign-in, so they connect with a **personal access token**. Create a token first (see [Personal Access Tokens](https://claude.ai/chat/b88334bb-7b4b-46cb-846d-6a7f52abc1d9#personal-access-tokens) above), then use it as a Bearer credential in the steps that follow.

**Cursor**

Add Zonka Feedback to `~/.cursor/mcp.json` (global, applies everywhere) or `.cursor/mcp.json` (one project):

```json
{
  "mcpServers": {
    "zonka-feedback": {
      "url": "https://mcp.zonkafeedback.com",
      "headers": {
        "Authorization": "Bearer zf_your_token_here"
      }
    }
  }
}
```

Restart Cursor, then open **Settings → MCP** to confirm the Zonka Feedback tools loaded.

**VS Code**

VS Code's built-in MCP client (version 1.101+) reads server definitions from `.vscode/mcp.json` in a workspace, or your user `mcp.json`:

```json
{
  "servers": {
    "zonka-feedback": {
      "type": "http",
      "url": "https://mcp.zonkafeedback.com",
      "headers": {
        "Authorization": "Bearer zf_your_token_here"
      }
    }
  }
}
```

To avoid committing the token, set the value to `${input:zonka-token}` and VS Code will prompt you for it on first use.

**Gemini CLI**

Run:

```bash
gemini mcp add zonka-feedback https://mcp.zonkafeedback.com \
  --transport http --scope user \
  --header "Authorization: Bearer zf_your_token_here"
```

This writes the server to `~/.gemini/settings.json`. The equivalent manual entry — note that Gemini CLI uses `httpUrl` (not `url`) for a streamable-HTTP server:

```json
{
  "mcpServers": {
    "zonka-feedback": {
      "httpUrl": "https://mcp.zonkafeedback.com",
      "headers": {
        "Authorization": "Bearer zf_your_token_here"
      }
    }
  }
}
```

Restart Gemini CLI and run `/mcp` to confirm the connection.

**Claude Code**

Run:

```bash
claude mcp add --transport http zonka-feedback https://mcp.zonkafeedback.com \
  --header "Authorization: Bearer zf_your_token_here"
```

Add `--scope user` to make the server available in every project (the default is the current project only). Confirm with `claude mcp list`, or `/mcp` inside Claude Code. The equivalent JSON entry (in a project `.mcp.json` or your `~/.claude.json`):

```json
{
  "mcpServers": {
    "zonka-feedback": {
      "type": "http",
      "url": "https://mcp.zonkafeedback.com",
      "headers": {
        "Authorization": "Bearer zf_your_token_here"
      }
    }
  }
}
```

**Codex CLI**

Codex reads the token from an environment variable rather than storing it in the config file. First export it:

```bash
export ZONKA_MCP_TOKEN="zf_your_token_here"
```

Then add the server:

```bash
codex mcp add zonka-feedback --url https://mcp.zonkafeedback.com \
  --bearer-token-env-var ZONKA_MCP_TOKEN
```

Always pass `--url` — without it, Codex treats the argument as a local command instead of a remote server. The equivalent `~/.codex/config.toml` block:

```toml
[mcp_servers.zonka-feedback]
url = "https://mcp.zonkafeedback.com"
bearer_token_env_var = "ZONKA_MCP_TOKEN"
```

Restart Codex and run `/mcp` to confirm. If your Codex build doesn't pick up the HTTP server, add `experimental_use_rmcp_client = true` at the top level of `config.toml` to enable the streamable-HTTP client.

**Any other MCP client**

Any client that speaks streamable HTTP can connect. Point it at the server URL and send your token on every request as an HTTP header:

```
URL:    https://mcp.zonkafeedback.com
Header: Authorization: Bearer zf_your_token_here
```

#### Verify the connection

Once connected, ask your AI tool:

> Are we connected to Zonka Feedback?

It should call `who_am_i` and reply with your name, account, and available tools. From there, try prompts like:

* "What's our NPS this quarter, and how does it compare to last quarter?"
* "Show me detractor responses with comments from the last 30 days."
* "Break down CSAT by location for August."
* "Which themes are driving negative sentiment right now?"
* "Pull ten verbatim customer quotes behind our top negative theme."
* "What's our Google review rating trend this year, and how many reviews did we reply to?"

#### Permissions and data access

* **Your login is the boundary.** Every tool call runs as the Zonka Feedback user who authorized the connection — whether through OAuth or a personal access token. Role permissions, survey scopes, and location restrictions apply exactly as they do in the app.
* **Module availability applies.** Tools for modules not enabled on your account (for example, the Intelligence Hub) return a clear `feature_not_enabled` error rather than empty data. Ask the AI to call `who_am_i` to see what's available.
* **Read-only.** The MCP surface honours read scope only — write scopes on a token or API key are ignored.

#### Troubleshooting

Common issues:

* **The AI tool doesn't list Zonka Feedback tools** — restart the client after adding the connector; most clients only load servers at startup.
* **Authorization loops or stale sign-ins (OAuth)** — remove and re-add the connector to force a fresh OAuth flow.
* **`401 Unauthorized` with a token** — the token is wrong, expired, or revoked. Create a new one and update your client config.
* **A token that used to work suddenly stops** — tokens stop the moment you're removed from the account, your role or access changes, or the token expires. Check with an admin, or create a new token.
* **`feature_not_enabled` errors** — the tool needs a module (for example, Intelligence) that isn't enabled for your account. Check `who_am_i`, or contact us about enabling it.
* **A colleague sees different results** — expected: results follow each user's own permissions and access to modules.

Still stuck? Reach us on chat or write to us at <hello@zonkafeedback.com>

#### Available tools

The server exposes 21 tools. What each user can actually call depends on their role, permissions, and the modules enabled on the account — `who_am_i` reports the exact availability.

**who\_am\_i**

Returns the current user, their account, and which tools they can use. Ask your AI tool to call this first when unsure whether a feature is available — `toolAvailability` tells it before it attempts a call that would fail.

Parameters: none.

**list\_users**

Lists all users in the account: platform users who can sign in, and external agents who are rated in feedback but cannot sign in.

Key Parameters:

* `search`: Free-text match on name, email, mobile, or external ID
* `role`: Filter by permission role, including account-defined custom roles; pass `external` to return only external agents
* `userLabel`: Filter by a grouping label applied to users, such as a team or tier
* `pagination`: `{ limit, cursor }` — default 25 per page, max 200

**get\_user\_details**

Returns one user with their assigned locations, labels, and full permission set.

Key Parameters:

* `userId`: The user to fetch, from `list_users`

**list\_surveys**

Lists surveys in the account.

Key Parameters:

* `search`: Free-text match on survey name
* `locationId`: Surveys assigned to one location, from `list_locations`
* `pagination`: `{ limit, cursor }` — default 25 per page, max 200

**get\_survey\_details**

Returns one survey's structure: every question with its type, its CX metric if any, and its answer choices. Question and choice IDs from here are required for answer-level filters in `list_responses` and `get_survey_metric`.

Key Parameters:

* `surveyId`: The survey to fetch, from `list_surveys`

**list\_responses**

Lists individual feedback records — survey responses, reputation reviews, and records from connected sources such as chats, tickets, and CSV imports. One row per record, not aggregated. All filters combine with AND.

Key Parameters:

* `dateRange`: `{ from, to }` ISO dates, interpreted in the account timezone
* `surveyId`, `datasourceId`, `locationId`, `userId`: Scope to one survey, connected source, location, or rated team member
* `responseType`, `channel`: Kind of record (survey, review, chat, ticket…) and how it was collected
* `npsBreakdown`, `cesBreakdown`, `csatBreakdown`, `reviewRating`: CX score bands — for example detractor, high\_effort, negative, or a 1–5 star rating
* `sentiment`, `urgency`, `churnRisk`, `intent`, `emotion`: AI signals; values come from `list_attributes`
* `themeId`, `subThemeId`: Feedback tagged with an Intelligence theme or subtheme
* `contactId`, `contactSegmentId`: One contact's feedback, or feedback from a contact segment
* `search`, `tags`, `completionStatus`: Free text across comments, manually applied tags, and Complete vs Partial
* `hasComment`, `hasNotes`, `hasTickets`, `hasTodo`, `replied`, `starred`, `important`: Quick boolean toggles
* `filterExpression`: Advanced conditions on per-question answers and contact attributes, combined with and / or / not
* `sortBy`, `pagination`: recency (default), score, or sentiment; pages of up to 200

**get\_response\_details**

Returns one complete feedback record: the full question-and-answer set or the ticket, chat, CSV, or review content; AI signals; tags; internal notes; the associated contact; and data-source metadata.

Key Parameters:

* `responseId`: The record to fetch, from `list_responses`

**list\_attributes**

Returns the account-specific values usable as filters for one object type per call — response tags, channels, response types, and AI signal values; contact attributes with their keys and types; user roles and labels; location labels.

Key Parameters:

* `objectType`: Required. One of `response`, `contact`, `user`, or `location`

**get\_survey\_metric**

Gets NPS, CES, CSAT, sentiment score, response count, completion rate, or average completion time for a survey over a date range and optional filters. Returns four shapes: value (a single value versus the previous period), trend (broken down by period), breakdown (split by one dimension), and pivot (a table of rows × columns).

Key Parameters:

* `metric`: nps, ces, csat, sentiment, responseCount, completionRate, or avgCompletionTime
* `shape`: value, trend, breakdown, or pivot
* `breakdownby`: Dimension to split by — location, user, channel, survey, device, contact segment, sentiment, NPS/CES/CSAT band, and more (breakdown shape only)
* `row`, `column`, `value`: Pivot axes and the metric computed at each cell (pivot shape only)
* `groupByDate`: day, week, month, quarter, or year — required for trend
* `dateRange`, `compareDateRange`: The period to measure and an optional period to compare against
* `surveyId`, `questionId`, `choiceId`: Scope to a survey, a question, or a specific answer choice
* Plus the same scope, AI-signal, and `filterExpression` filters as `list_responses`

**list\_contacts**

Lists contacts with identity and subscription status.

Key Parameters:

* `search`: Free-text match on name, email, mobile, or external ID
* `contactSegmentId`: Contacts in a segment, from `list_contact_segments`
* `surveyId`: Contacts sent, or who responded to, a survey
* `isUnsubscribed`, `isBounced`: Contacts who opted out, or whose email hard-bounced
* `hasResponses`, `noResponses`: Contacts who have — or have never — submitted a response
* `filterExpression`: Advanced conditions on typed contact attributes
* `pagination`: `{ limit, cursor }` — default 25 per page, max 200

**get\_contact\_details**

Returns one contact with attributes, segment memberships, subscription status, and a timestamped activity timeline — surveys sent, opened, and answered; list additions; unsubscribes.

Key Parameters:

* `contactId`: The contact to fetch, from `list_contacts`

**list\_contact\_segments**

Lists contact segments — saved groupings of contacts by shared traits. Static segments have fixed membership; dynamic segments re-evaluate at query time.

Key Parameters:

* `search`: Free-text match on segment name
* `type`: static or dynamic
* `pagination`: `{ limit, cursor }` — default 25 per page, max 200

**list\_locations**

Lists configured locations — branches, stores, or sites set up in the account, each with an address and labels.

Key Parameters:

* `search`: Free-text match on location name
* `locationLabel`: Filter by a grouping label applied to locations, such as a region
* `pagination`: `{ limit, cursor }` — default 25 per page, max 200

**list\_datasources**

Lists connected and imported data sources — review platforms, support ticketing and chat integrations, and CSV uploads.

Key Parameters:

* `search`: Free-text match on source name
* `sourceType`: Kind of data the source produces; values from `list_attributes`
* `status`: Processing state of the last sync or import — in\_progress, completed, or failed
* `pagination`: `{ limit, cursor }` — default 25 per page, max 200

**list\_intelligence\_projects**

Lists AI Feedback Intelligence projects. A project analyses one or more data sources to extract themes and subthemes and produce volume, NPS, CES, CSAT, and sentiment overall and per topic.

Key Parameters:

* `search`: Free-text match on project name
* `status`: in\_progress, complete, or failed
* `projectType`: ongoing (re-runs as data arrives) or onetime (a fixed snapshot)
* `datasourceId`, `surveyId`: Projects analysing a given source or survey
* `pagination`: `{ limit, cursor }` — default 25 per page, max 200

**get\_intelligence\_project\_details**

Returns one Intelligence project with its connected data sources, associated entities, and project users.

Key Parameters:

* `projectId`: The project to fetch, from `list_intelligence_projects`; omit for account-level intelligence

**get\_intelligence\_metric**

Gets volume, NPS, CES, CSAT, and sentiment for an Intelligence project — or a single theme or subtheme — in four shapes: value, trend, breakdown, and pivot. Scope resolves most-specific-first: subtheme → theme → project → account.

Key Parameters:

* `metric`: responseVolume, sentiment, nps, csat, or ces
* `shape`: value, trend, breakdown, or pivot
* `breakdownby`: Dimension to split by — location, user, contactSegment, theme, subTheme, or datasource (breakdown shape only)
* `row`, `column`, `value`: Pivot axes and the metric computed at each cell (pivot shape only)
* `groupByDate`: day, week, month, quarter, or year — required for trend
* `projectId`, `themeId`, `subThemeId`: Scope; omit all for account-level intelligence
* `dateRange`, `compareDateRange`: The period to measure and an optional period to compare against
* `sentiment`, `urgency`, `churnRisk`, `intent`, `emotion`, `datasourceId`, `locationId`, `contactSegmentId`, `filterExpression`: Refine the underlying feedback

**list\_themes**

Lists the themes of a completed Intelligence project — topics AI analysis has extracted to tag responses by their main idea. Pass a theme ID to list that theme's subthemes instead.

Key Parameters:

* `projectId`: From `list_intelligence_projects`; omit for account-level themes
* `themeId`: Returns this theme's subthemes instead of the top-level list
* `dateRange`: `{ from, to }` ISO dates
* `includeSubThemes`: true nests each theme's subthemes in the result
* `datasourceId`, `contactSegmentId`, `locationLabel`, `userLabel`, `filterExpression`: Refine which feedback the themes are computed from
* `pagination`: `{ limit, cursor }` — default 25 per page, max 200

**get\_theme\_details**

Returns one theme or subtheme in full: definition, volume, key analysis, NPS/CES/CSAT/sentiment metrics with distributions, its subthemes, and its positive and negative drivers.

Key Parameters:

* `themeId` or `subThemeId`: Pass exactly one, from `list_themes`
* `projectId`: From `list_intelligence_projects`; omit for account-level themes

**list\_quotes**

Returns verbatim customer quotes behind a theme or subtheme — the exact text from a response that caused it to be tagged with that topic.

Key Parameters:

* `projectId`: From `list_intelligence_projects`
* `themeId` or `subThemeId`: The topic whose quotes to return, from `list_themes`
* `dateRange`: `{ from, to }` ISO dates
* `sentiment`, `urgency`, `churnRisk`, `intent`, `emotion`: Filter quotes by AI signal
* `pagination`: `{ limit, cursor }` — default 25 per page, max 200

**get\_reputation\_metric**

Gets overall review rating, review count, replied-review count, and review sentiment across your reputation data sources — in four shapes: value, trend, breakdown, and pivot.

Key Parameters:

* `metric`: rating (average stars), reviewCount, repliedReviewCount (with reply rate), or sentiment
* `shape`: value, trend, breakdown, or pivot
* `breakdownby`: location, datasource, or rating\_bucket
* `groupByDate`: day, week, month, quarter, or year — required for trend
* `dateRange`, `compareDateRange`: The period to measure and an optional period to compare against
* `datasourceId`, `locationId`, `locationLabel`, `reviewRating`: Scope to a review source, location, or star rating
* `sentiment`, `urgency`, `churnRisk`, `intent`, `emotion`: Filter by AI signal

#### FAQs

**Do I need a token or OAuth?** If your client supports browser sign-in (Claude, ChatGPT, Cursor), use OAuth — there's nothing to copy. For clients without sign-in (Gemini CLI, Claude Code, Codex, and others), create a Personal Access Token. Either way, access is scoped to your own user and read-only.

**Is the MCP server read-only?** Yes. All 21 tools read data; none of them modify your account. Write capabilities will be introduced later with explicit, per-workspace controls.

**Which regions are supported?** All of them — US, EU, IN, and AU — through the single URL `https://mcp.zonkafeedback.com`. Routing to your data region is automatic.

**Who in my team can connect?** Once an admin has enabled the MCP server for your account (Settings → AI Governance → AI Features → Agents & MCP), any Zonka Feedback user can authorize a connection with their own login or a personal access token. Each connection carries that user's permissions only.

**Does the AI tool store my feedback data?** The MCP server returns data to your AI tool at query time. How the AI tool retains conversation data is governed by that tool's own data policy — review it before connecting, as you would for any integration.


