HumHub - Survey API (1.0.0)

Download OpenAPI specification:Download

Welcome to the HumHub Survey module API reference.

Survey

Find all surveys

query Parameters
page
string >= 0

The number of page of the result set.

limit
string [ 1 .. 50 ]
Default: 20

The numbers of items to return per page.

Responses

Response samples

Content type
{
  • "total": 76,
  • "page": 1,
  • "results": [
    ]
}

Find all global surveys

The surveys in containers are excluded

query Parameters
page
string >= 0

The number of page of the result set.

limit
string [ 1 .. 50 ]
Default: 20

The numbers of items to return per page.

Responses

Response samples

Content type
{
  • "total": 76,
  • "page": 1,
  • "results": [
    ]
}

Find all surveys by container

path Parameters
id
required
integer

ID of content container

query Parameters
topics
string
Example: topics=Music,Dancing

Coma separated list of topics to filter

page
string >= 0

The number of page of the result set.

limit
string [ 1 .. 50 ]
Default: 20

The numbers of items to return per page.

Responses

Response samples

Content type
{
  • "total": 76,
  • "page": 1,
  • "results": [
    ]
}

Get survey by id

path Parameters
id
required
integer

The id of the survey

Responses

Response samples

Content type
application/json
{
  • "id": 201,
  • "title": "Some Survey title",
  • "description": "Some Survey description",
  • "schema": { },
  • "state": "Some Survey description",
  • "state_updated_at": "2022-02-27 00:00:00",
  • "restricted_to_group_ids": [
    ],
  • "show_in_menu": 1,
  • "answers_visibility": "all",
  • "show_who_answered": "all",
  • "max_answers": 100,
  • "max_total_answers": 1000,
  • "edit_answer": 1,
  • "url_after_answering": "all",
  • "fields": [
    ],
  • "content": {
    }
}

Survey Answers

Find all answers of a survey

path Parameters
surveyId
required
integer

ID of survey

query Parameters
page
string >= 0

The number of page of the result set.

limit
string [ 1 .. 50 ]
Default: 20

The numbers of items to return per page.

Responses

Response samples

Content type
application/json
{
  • "total": 76,
  • "page": 1,
  • "pages": 8,
  • "links": {
    },
  • "results": [
    ]
}

Answer

Get answer by id

path Parameters
id
required
integer

The id of the answer

Responses

Response samples

Content type
application/json
{
  • "id": 2424,
  • "survey_id": 145,
  • "state": "visible",
  • "created_at": "2022-02-27 00:00:00",
  • "updated_at": "2022-02-27 00:00:00",
  • "created_by": {},
  • "answerFields": [
    ],
  • "likes": {
    },
  • "files": {}
}