Start a conversation

How to get data from the REST API

Here's an example of the basic workflow of exporting data from the REST API.


You can use for example Postman to test requests to the API.


1. Create a survey and launch it on a touchpoint

2. Collect some responses with the survey

3. Create an API token to authenticate calls with REST

See Authentication

4. Fire a GET call to the /responses endpoint

On a successful call you will receive a JSON object containing the following fields:


data[]: An array containing 0-100 response objects

paging: An object containing next and previous -fields to navigate between your queries. Any query parameters passed in the url will be also present in the next-field.


You can also query responses individually with the /responses/:id endpoint if you know the id of the response or by full response chains if you need to know all the responses to questions a person responded to in a survey. However, we recommend using the /responses endpoint for the least amount of nested properties and arrays.


You can query the responses with a number of query parameters. Arrays are denoted in the query parameters with a "[]" after the parameter name like so:

/responses?surveyId[]=abc1&surveyId[]=abc2

See the API documentation for more information of accepted query parameters


Note on the preferredLanguage parameter

In cases where a survey has multiple languages, the preferredLanguage parameter determines the language you want the question titles and response choices to be printed with. If the specified translation is not found in the survey, it will first fall back to English and if not found, then fall back on the first available language.


Note on question types and their data

There are 7 question types currently in Feedbackly. The responses are mapped to a multi-purpose "answer"-field and type-safe valueNum/Array/String field depending on the type. The responses are mapped as follows:


questionType
Description
Field
Example
Button
Smileys / Satisfaction

The values are in the scale of 0-1.

5 buttons: 0, 0.25, 0.5,0.75,1

4 buttons: 0, 0.33, 0.66, 1
valueNum: number
answer: number
valueNum: 0.5
answer: 0.5
NPS
NPS question
Numbers 0-10
valueNum: number

answer: number
valueNum: 4
answer: 4
Word
Category / Selection / Multiselect

Answer will either be a string value if the question is single select or an array of strings if the question is a multi-select.

valueArray will contain the unique id's of the choice(s) selected while answer contains the string representations of the choice in the language chosen.
valueArray: string[],
answer: string | string[]
Multiselect:
valueArray: ["sdnsdn2", "assfiw1"]

answer: ["Apples", "Oranges"]

Single Select:
valueArray: ["4geixrn"]

answer: "Pears"
Image
Category / Selection by image

Same as above
Same as above
Same as above, outputs Image labels
Text
Open text field
valueString: string

answer: string

valueString: "Thanks for the service"

answer: "Thanks for the service"
Slider
Slider question. These questions contain multiple responses depending on the field responded to. In order to connect these answers together, you  look at the responseChainId and the questionId

Each field contains a fieldId and a fieldName  to distinguish the responses apart.
valueNum: number

answer: number
valueNum: 4
answer: 4
Contact
Contact form question. Like Slider question, this question might have multiple responses per question.
valueString: string

answer: string
valueString: "example@example.com"

answer: "example@example.com"




Choose files or drag and drop files
Was this article helpful?
Yes
No
  1. Joonas Hamunen

  2. Posted
  3. Updated

Comments