HumHub - Survey API (1.0.0)

Download OpenAPI specification:

Welcome to the HumHub Survey module API reference.

Survey

Find all surveys

query Parameters
page
integer
Default: 1

Page number

limit
integer
Default: 20

Number of items per page

Responses

Response samples

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

Find all global surveys

The surveys in containers are excluded

query Parameters
page
integer
Default: 1

Page number

limit
integer
Default: 20

Number of items per page

Responses

Response samples

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

Find all surveys by container

path Parameters
id
required
integer

ID of content container

query Parameters
topics
string

Filter by topics

page
integer
Default: 1

Page number

limit
integer
Default: 20

Number of items per page

Responses

Response samples

Content type
{
  • "total": 0,
  • "page": 0,
  • "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
integer
Default: 1

Page number

limit
integer
Default: 20

Number of items per page

Responses

Response samples

Content type
application/json
{
  • "total": 0,
  • "page": 0,
  • "pages": 0,
  • "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": { }
}