Customer satisfaction survey API
12 min
Criado por Knowledge Engineering Team em 01/12/2020 16:13
Atualizado por Agente Zenvia - Jean em 09/08/2024 15:54

On this page

Customer satisfaction survey API concepts and usage

Object properties

Retrieve a survey question

Retrieve survey questions

Retrieve survey responses

Status and error reference

 

 

Customer satisfaction survey API concepts and usage

This API can be used to retrieve data collected by the Movidesk customer satisfaction survey. You can use this API to bring customer satisfaction data into your reporting or business intelligence solution, without the need to manually export the Survey results report in Movidesk. This includes data collected for surveys questions that were later disabled.

If you are using other customer satisfaction surveys in addition to the Movidesk survey, you can also take advantage of the API to preserve data integrity. Retrieve the applicable Movidesk survey questions via the API to ensure questions remain consistent across survey tools.

Cross-language analysis is also made easy thanks to multi-language support. Movidesk links survey responses to a language agnostic question, which removes the need to manually identify and map different translations as being the same question.

API Base URL

All API endpoint URLs in this article use the following base URL:

https://api.movidesk.com/public/v1

 

Object properties

This API retrieves information on three objects linked to the customer satisfaction survey. Questions are the primary objects, with every Language and Response object linking back to a specific question.

This structure facilitates data analysis by maintaining the Question a constant even if the text of the question is slightly adjusted, or if the question is displayed in different languages.

Languages can only be accessed as a property of Questions.

Responses are retrieved via a separate URL and link back to a Question via the questionId property.

Clipboard

Note The API behaves the same way whether a Question is enabled or disabled. The isActive property indicates which Questions are currently active in the survey.

 

Objects

Question

Language

Response

 

Question

A record that determines the response type, whether the question is active in the customer satisfaction survey, and links the text in the Language objects with the Responses from customers.

Clipboard

Note In order to preserve data integrity, the question type cannot be changed after the question is created.

 

JSON Paths

question

Property

Type

Max length

Required?

Description

id

string

 

 

Unique identifier of the question

languages

Languages array

 

 

List of Languages containing the text of the question in a specific language

isActive

bool

 

 

The question is not included in the customer satisfaction survey if set to false. Only three Questions can be active at one time

type

int

 1

 

Question type:
1=Satisfied/Dissatisfied,
2=Smileys,
3=NPS,
4=Yes/No

 

Language

A translation of the language agnostic Question. Even if your survey only has one language, the actual text of the question will be stored in a Language object.

JSON Paths

question.languages

Property

Type

Max length

Required?

Description

cultureId

String

5

 

Culture code indicating the language of the text:

English = en-US
Spanish = es
Portuguese = pt-BR

description

String

 

 

Question text

 

Response

A customer response to a Question on the customer satisfaction survey. It includes both a numerical response value and an optional a free text comment.

Head with gears

Tip You can use obtain additional information about a Response’s ticket by using the ticket API to retrieve data based on the ticketID returned.

 

JSON Paths

response

Property

Type

Max length

Required?

Description

id

String

 

 

Unique identifier of the response

questionId

String

 

 

id of the Question object related to this response

clientId

String

 

 

Ref. code of the customer that responded to the survey question

type

Int

  1

 

Question type:
1=Satisfied/Dissatisfied,
2=Smileys,
3=NPS,
4=Yes/No

ticketId

Int

 

 

Sequential id of the ticket related to this response. This number can be found in Ticket > Ticket details if using a custom ticket numbering scheme

responseDate

UTC datetime

 

 

Date and time of the response

commentary

String

 

 

Free text comments entered by the customer

value

Int

  2

 

Numerical value corresponding to the customer response. Varies based on type:

type=1: Satisfied=1, Dissatisfied=2;
type=2: Very poor=1, Poor=2, Reasonable=3, Good=4, Excellent=5;
type=3: NPS from 0–10;
type=4: Yes=1, No=2

 

Retrieve survey questions

Retrieves all properties of the customer satisfaction questions, which can be filtered by question type using the type parameter.

GET: /survey/questions

 

Parameters

Location

Type

Required?

Description

token

Query string

String

Yes

Movidesk API token found in Configurations > Account > Parameters

type

Query string

Int

 

type of the questions that will be retrieved

 

This example is a request for the list of customer satisfaction survey questions, which returns a full list of questions and question properties. Note how inactive questions, which are not displayed in the survey, are also included in the response.

The response also includes both properties of the Languages associated with the question.

 

Sample request

GET: https://api.movidesk.com/public/v1/survey/questions?token=XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX

Sample response

[
    {
        "id": "WkWr",
        "languages": [
            {
                "cultureId": "en-US",
                "description": "How would you rate the support you received for this ticket?"
            },
            {
                "cultureId": "es",
                "description": "¿Qual su avaliación para este atendimiento?"
            },
            {
                "cultureId": "pt-BR",
                "description": "Qual sua avaliação para esse atendimento?"
            }
        ],
        "isActive": true,
        "type": 1
    },
    {
        "id": "W3xx",
        "languages": [
            {
                "cultureId": "en-US",
                "description": "How likely is it that you would recommend this company to a friend or colleague?"
            },
            {
                "cultureId": "es",
                "description": "¿Qué tan probable es que recomiendes Movidesk a un amigo o colega?"
            },
            {
                "cultureId": "pt-BR",
                "description": "Qual a probabilidade de você recomendar esta empresa para um amigo ou colega?"
            }
        ],
        "isActive": false,
        "type": 3
    }
]

Retrieve survey responses

Retrieves all properties of a set of customer satisfaction survey responses.

GET: /survey/responses

 

Parameters

Location

Type

Required?

Description

token

Query string

String

Yes

Movidesk API token found in Configurations > Account > Parameters

limit

Query string

Int

 

Limit on the amount of responses to be returned, between 1 and 100. Default value is 100

startingAfter

Query string

String

 

The id of a response, which is used as a cursor for pagination

For example, if your previous request returned 100 responses, ending with response id=DwlOGG, your next call can include startingAfter=DwlOGG in order to fetch the next page of the list

type

Query string

Int

 

type of question for the responses that will be retrieved

clientId

Query string

 

 

clientId of the responses that will be retrieved

ticketId

Query string

 

 

Sequential id of the ticket related to the responses that will be retrieved

responseDateGreaterThan

Query string

UTC datetime

 

Filter date or date and time. The API will only return responses with a responseDate greater than this

responseDateLessThan

Query string

UTC datetime

 

Filter date or date and time. The API will only return responses with a responseDate less than this

hasMore

Return JSON

Boolean

 

Returns true if there are more Responses in the list than were retrieved in the API response. Use the startingAfter parameter in a subsequent call to retrieve the next page of the list

items

Return JSON

Responses array

 

Array containing all Response objects retrieved, up to the maximum number set in limit

 

This example is a request for the list of customer satisfaction survey responses from the customer with Ref. code (clientId) 489983039. In the example we are also limiting the request to responses entered by the customer after 5:00 PM UTC on January 15, 2020.

The API returns all responses matching the request, one of which includes a customer comment. Note that hasMore=false, so there is no need to request the next page on the list.

Head with gears

Tip The responseDateGreaterThan and responseDateLessThan parameters accept either a UTC date in the format yyyy-mm-dd or a datetime in the format yyyy‑mm‑ddThh:mm:ss

 

Sample request

GET: https://api.movidesk.com/public/v1/survey/responses?token=XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX&responseDateGreaterThan=2020-01-15T17:00:00&clientId=489983039

Sample response

{
    "hasMore": false,
    "items": [
        {
            "id": "DwlOGG",
            "questionId": "WkWr",
            "type": 1,
            "clientId": "489983039",
            "ticketId": 28,
            "responseDate": "2020-01-28T23:17:21.0128707",
            "commentary": null,
            "value": 1
        },
        {
            "id": "61rVAq",
            "questionId": "WkWr",
            "type": 1,
            "clientId": "489983039",
            "ticketId": 11,
            "responseDate": "2020-01-17T17:10:00.7760219",
            "commentary": "Jack walked us through every step, which probably saved us a whole week of troubleshooting.",
            "value": 1
        }
    ]
}
Classifique este artigo
Últimos artigos visitados