Olery Developer Portal logo Olery Developer Portal

Method Path
PUT https://agora.olery.com/v3/feedback/questions

This endpoint is used to create a question.

Input Format

The request’s body can have the following fields:

Field Data Types Description
type String Question’s type (required)
max Integer Denotes the maximum characters allowed for an answer. Used when the question type is an open answer (normal or long)
min Integer Denotes the minimum characters allowed for an answer. Used when the question type is an open answer (normal or long)
max_value Integer Denotes the maximum rating. Used when the question type is a rating
required Boolean Indicates if the question is required
enabled_followup Boolean Indicates if the question has a follow up. Only for rating questions
links Array See Links Field section
options Array See Options Field section
config Hash See Config Field section
texts Hash See Texts Field section (required)
topics Array Array of strings where each string represents a rating for the question

Each question can be one of the following types: date, drop_down, enum, multiple_select, open_answer, open_answer_long, past_date, rating or yes_no.

The links field is and array of hashes. Every hash has a language code key and it value is another hash with the following fields:

Field Data Types Description
title String The link’s text to be displayed
url String The link itself

Options Field

The option field inside the question is an array of hashes used to store the option ID and its translations. This field is used when the question has one of the following types: multiple_select, enum or drop_down. Each hash in the array has the following fields:

Field Data Types Description
id String Option’s ID.
default String Option in the default language
language code String Option in a specific language. There can be multiple fields like this, usually for all the survey’s available languages

Config Field

This field is used to configure rating labels for questions of the the rating. It is a hash with another hash inside with a key named edge_labels with the following fields:

Field Data Types Description
best Hash It contains bey-value pairs, where the key is a language code and the value is the label in that language
worst Hash It contains bey-value pairs, where the key is a language code and the value is the label in that language

Each of this fields has also a default key-value pair, which represents the label in the default language. It follows an example for the config field:

"config": {
  "edge_labels": {
      "best": {
          "en": "Best",
          "es": "Mejor",
          "default": "Best"
      },
      "worst": {
          "en": "Worst",
          "es": "Peor",
          "default": "Worst"
      }
  }
}

Texts Field

The texts field is an array of hashes. Every hash has a key and it value is another hash with the following fields:

Field Data Types Description
question String The question text to be displayed
description String The description of the question

Example Input

{
  "question": "To what extent did the staff make you feel welcome?",
  "type": "rating",
  "texts": {
    "question": {
      "de": "Inwieweit half Ihnen das Personal dabei, sich willkommen fühlen?",
      "fr": "Dans quelle mesure le personnel vous a-t-il chaleureusement accueilli ?",
      "it": "In quale misura lo staff è riuscito a farti sentire il benvenuto?",
      "nl": "In welke mate kreeg u een warm welkom van onze medewerkers?",
      "pt": "Em que medida você se sentiu bem acolhido pelos funcionários?",
      "ru": "Насколько дружелюбным был персонал?",
      "sp": "¿En qué medida el personal lo hizo sentirse bienvenido/a?",
      "ar-ae": "إلى أي مدى جعلك الموظفون تشعر بالترحيب؟"
    },
    "description": {}
    },
  "required": true,
  "enabled_followup": false,
  "links": [],
  "options": [],
  "config": {},
  "topics": ["bar", "sanitary_safety"]
}

Example Output

{
  "data": {
    {
      "id": "f9e937969ddf267b6e8cee80d",
      "type": "rating",
      "max": null,
      "min": null,
      "max_value": 5,
      "required": false,
      "enabled_followup": false,
      "links": [ ],
      "options": [ ],
      "config": { },
      "topics": [
        "staff",
        "personnel",
        "cabin_crew",
        "boarding",
        "pilot",
        "support"
      ],
      "texts": {
        "question": 
          {
            "de": "Inwieweit half Ihnen das Personal dabei, sich willkommen fühlen?",
            "fr": "Dans quelle mesure le personnel vous a-t-il chaleureusement accueilli ?",
            "it": "In quale misura lo staff è riuscito a farti sentire il benvenuto?",
            "nl": "In welke mate kreeg u een warm welkom van onze medewerkers?",
            "pt": "Em que medida você se sentiu bem acolhido pelos funcionários?",
            "ru": "Насколько дружелюбным был персонал?",
            "sp": "¿En qué medida el personal lo hizo sentirse bienvenido/a?\t",
            "ar-ae": "إلى أي مدى جعلك الموظفون تشعر بالترحيب؟"
         },
         "description": { }
        },
     "slug": null
    }
  }
}