Skip to main content
POST
Bulk add items to Question Library

Description

Add multiple survey items to the question library.

Payload

The endpoint receives an array with the multiple items to be added to the library.
  • name: Item name that appears in the library. Required.
  • item: See below for more information. Required
  • questionPackage: Question package. Optional.
  • locale: If present, the question will only be available to add if the project uses the same locale. Optional.
  • companyId: Company the item is gonna belong to. If not present it will be created as a default item (usable by every user). Optional.

Item

The item is the question to be added:
  • type: The type of the item. Required. Possible values are:
    • multiple: Multiple choice question.
    • input: Numeric question.
  • subtype: The subtype of the item. Required:
    • text: Only valid when type is multiple.
    • number: Only valid when type is input.
  • config: Object containing item configurations.
    • isRequired: Whether the item is required or not. Required.
    • allowNA: Whether the item accepts N/A as an answer or not. Required.
    • minValue: Minimum value allowed for the answer of the question. Required for type: input, subtype: number.
    • maxValue: Maximum value allowed for the answer of the question. Required for type: input, subtype: number.
    • allowMultipleSelection: Whether or not the question allows to select multiple options. Required for type: multiple, subtype: text.
    • minResponses: Minimum amount of options that can be selected. If allowMultipleSelection is false this value should always be 1. Required for type: multiple, subtype: text.
    • maxResponses: Maximum amount of options that can be selected. If allowMultipleSelection is false this value should always be 1. Required for type: multiple, subtype: text.
    • displayAs: Value to determine how the item is going to be visualized in the survey. Supported values: dropdownor list. Required for type: multiple, subtype: text.
  • position: The position of the item. Not in use. Required
  • title: The title of the question.
  • netquestId: Netquest identifier. Optional.
  • netquestName: Netquest url variable name. Optional.
For each type of item, there can be more specific properties.

Options

Options is an array of objects containing the options for the multiple choice question. It has the following structure:
  • label: The label of the option. Required.
  • position: The position of the option relative to the item. Required.
  • netquestOptionValue: The value used to map to the question option when the answer for the question is passed as an url variable. Optional.

Response

200 OK

Array of created items
where:
  • name: Item name that appears in the library.
  • item: See below for more information.
  • questionPackage: Question package.
  • locale: If present, the question will only be available to add if the project uses the same locale.
  • companyId: Company the item is gonna belong to. If not present it will be created as a default item (usable by every user).
  • isDefaultItem: Item is a default one or not.
  • isShared: Item is shared for that company.

Item

The item is the question to would be added in the project:
  • type: The type of the item. Required. Possible values are:
    • multiple: Multiple choice question.
    • input: Numeric question.
  • subtype: The subtype of the item. Required:
    • text: Only valid when type is multiple.
    • number: Only valid when type is input.
  • config: Object containing item configurations.
    • isRequired: Whether the item is required or not.
    • allowNA: Whether the item accepts N/A as an answer or not.
    • minValue: Minimum value allowed for the answer of the question.
    • maxValue: Maximum value allowed for the answer of the question.
    • allowMultipleSelection: Whether or not the question allows to select multiple options.
    • minResponses: Minimum amount of options that can be selected. If allowMultipleSelection is false this value should always be 1.
    • maxResponses: Maximum amount of options that can be selected. If allowMultipleSelection is false this value should always be 1.
  • position: The position of the item. Not in use.
  • title: The title of the question.
  • netquestId: Netquest identifier.
  • netquestName: Netquest url variable name.

Options

Options is an array of objects containing the options for the multiple choice question:
  • label: The label of the option.
  • position: The position of the option relative to the item.
  • netquestOptionValue: The value used to map to the question option when the answer for the question is passed as an url variable.

401 Unauthorized

The user is not authorized

403 Forbidden

The user doesn’t have enough privileges to use this endpoint
The company is not enabled to perform this action

500 Internal Server Error

Error occurred while processing the request.

Authorizations

Authorization
string
header
required

Access token obtained from the m2m-token endpoint.

Headers

Authorization
string
required

Authorization token

Body

application/json

The body is of type object.

Response

Bulk add items to Question Library response

The response is of type object.