Skip to content

Questions

Questions define what has been asked to get the feedback. They give the meaning for the different feedback options. Questions are company-specific.

Summary of available resource patterns

CodeURL
GET/v1/questions
GET/v1/questions/:key
GET/v1/questions/:key/surveys

Question

JSON presentation of question.

Properties
NameDescription
keyThe identifier of the question
nameThe question
localeIETF BCP 47-formatted language tag

The default language of the question. For example: en-US.

Example JSON objects

Single question without surveys.
{
  "key": 1,
  "name": "How was your day?",
  "locale": "en-US"
}

GET /v1/questions

Lists the company’s questions.

Parameters
NameDescription
offsetoptional, zero-based numeric value

The index of the first result returned and used to paginate results.

limitoptional, numeric value in range 1..100

The number of results returned and used to paginate results. Default value is 50 and maximum is 100.

Example requests and responses

GET /v1/questions?offset=0&limit=5
{
  "meta": {
    "offset": 0,
    "limit": 5,
    "total": 1
  },
  "data": [
    {
      "key": 3,
      "name": "How was your day?",
      "locale": "en-US"
    }
  ]
}
Result
NameDescription
SuccessObject containing two properties: meta for additional information (of pagination etc.) and data for a list of questions. Empty list when company does not have any questions.

GET /v1/questions/:key

Retrieves a specific question.

Parameters
NameDescription
keyrequired, identifier of the question

Example requests and responses

GET /v1/questions/3
{
  "key": 3,
  "name": "How was your day?",
  "locale": "en-US"
}
Result
NameDescription
SuccessQuestion
ErrorHTTP status code 404 when no question is found.

GET /v1/questions/:key/surveys

Lists surveys for specific question.

Parameters
NameDescription
keyrequired, identifier of question
stateoptional, one of active, ended, starting When present, the result only contains surveys in given state.
offsetoptional, zero-based numeric value. The index of first result returned and used to paginate results.
limitoptional, numeric value in range 1..100. The number of results returned and used to paginate results Default value is 50 and maximum 100.

Examples

GET /v1/questions/3/surveys
{
  "meta": {
    "offset": 0,
    "limit": 50,
    "total": 4
  },
  "data": [
    {
      "key": 1,
      "folder": {
        "key": 3,
        "name": "Tampere"
      },
      "timeZone": "Europe/Helsinki",
      "activePeriods": [
        {
          "start": "2013-01-01T00:00:00.000+0200",
          "end": "2013-02-01T00:00:00.000+0200"
        },
        {
          "start": "2013-03-01T00:00:00.000+0200",
          "end": "2013-04-01T00:00:00.000+0300"
        }
      ]
    },
    {
      "key": 2,
      "folder": {
        "key": 4,
        "name": "London"
      },
      "timeZone": "Europe/London",
      "activePeriods": [
        {
          "start": "2013-01-01T00:00:00.000+0200",
          "end": "2013-02-01T00:00:00.000+0200"
        },
        {
          "start": "2013-03-01T00:00:00.000+0200",
          "end": "2013-04-01T00:00:00.000+0300"
        }
      ]
    }
  ]
}
Result
NameDescription
SuccessObject containing two properties: meta for additional information (of pagination etc.) and data for a list of folders.
ErrorHTTP status code 404 when no folder is found.