Create new questions by question group id

post

/spms/v1/questionnaires/templates/{templateId}/questionGroups/{questionGroupId}/questions

This is to create new questions by question group id

Request

Supported Media Types
Path Parameters
Body ()
Required to create question
Root Schema : Question List
Type: array
Title: Question List
List of Questions
Show Source
Example:
[
    {
        "question":{
            "default":"Do you have the following symptoms?",
            "zh":"????????????????????????"
        },
        "orderNumber":1,
        "questionType":"MULTI_SELECTION",
        "displayMethod":"HORIZONTAL",
        "answers":[
            {
                "orderNumber":1,
                "answerText":{
                    "default":"Diarrhea",
                    "zh":"??????"
                },
                "alert":{
                    "enabled":true,
                    "alertMessage":"Alert!!!! Diarrhea!!!"
                }
            },
            {
                "orderNumber":2,
                "answerText":{
                    "default":"Vomiting",
                    "zh":"??????"
                }
            },
            {
                "orderNumber":3,
                "answerText":{
                    "default":"Others (please specify)",
                    "zh":"?????????????????????"
                },
                "requiredToSpecify":true
            }
        ]
    },
    {
        "question":{
            "default":"Do you have any allegy?",
            "zh":"??????????????????"
        },
        "orderNumber":2,
        "questionType":"FREE_TEXT"
    }
]
Nested Schema : Question
Type: object
Title: Question
Question for questionnaire
Show Source
Nested Schema : answers
Type: array
Show Source
Nested Schema : question
Type: object
A hashmap which contains key/value pairs
Show Source
Nested Schema : items
Type: object
Show Source
Nested Schema : alert
Type: object
Show Source
Nested Schema : answerText
Type: object
A hashmap which contains key/value pairs
Show Source
Back to Top

Response

Supported Media Types

201 Response

OK
Body ()
Root Schema : Question List
Type: object
Title: Question List
List of Questions
Show Source
Nested Schema : items
Type: array
Show Source
Example:
[
    {
        "id":1,
        "question":{
            "default":"Do you have the following symptoms?",
            "zh":"????????????????????????"
        },
        "orderNumber":1,
        "questionType":"MULTI_SELECTION",
        "displayMethod":"HORIZONTAL",
        "answers":[
            {
                "id":1,
                "orderNumber":1,
                "answerText":{
                    "default":"Diarrhea",
                    "zh":"??????"
                },
                "alert":{
                    "id":1,
                    "enabled":true,
                    "alertMessage":"Alert!!!! Diarrhea!!!"
                }
            },
            {
                "id":2,
                "orderNumber":2,
                "answerText":{
                    "default":"Vomiting",
                    "zh":"??????"
                }
            },
            {
                "id":3,
                "orderNumber":3,
                "answerText":{
                    "default":"Others (please specify)",
                    "zh":"?????????????????????"
                },
                "requiredToSpecify":true
            }
        ],
        "viewOnly":true
    },
    {
        "id":2,
        "question":{
            "default":"Do you have any allegy?",
            "zh":"??????????????????"
        },
        "orderNumber":2,
        "questionType":"FREE_TEXT",
        "viewOnly":true
    }
]
Nested Schema : Question
Type: object
Title: Question
Question for questionnaire
Show Source
Nested Schema : answers
Type: array
Show Source
Nested Schema : question
Type: object
A hashmap which contains key/value pairs
Show Source
Nested Schema : items
Type: object
Show Source
Nested Schema : alert
Type: object
Show Source
Nested Schema : answerText
Type: object
A hashmap which contains key/value pairs
Show Source

400 Response

Bad Request
Body ()
Root Schema : schema
Match All
Show Source
Example:
{
    "type":"https://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.4.1",
    "title":"Bad Request",
    "detail":"The parameter 'templateId' has incorrect format"
}
Nested Schema : Error Response
Type: object
Title: Error Response
Error Response returned when encountered error
Show Source

401 Response

Unauthorized
Body ()
Root Schema : schema
Match All
Show Source
Example:
{
    "type":"HTTP://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.4.2",
    "title":"Unauthorized",
    "detail":"Valid token is required to access this resource"
}
Nested Schema : Error Response
Type: object
Title: Error Response
Error Response returned when encountered error
Show Source

403 Response

Forbidden
Body ()
Root Schema : schema
Match All
Show Source
Example:
{
    "type":"HTTP://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.4.4",
    "title":"Forbidden",
    "detail":"Access to this resource was forbidden"
}
Nested Schema : Error Response
Type: object
Title: Error Response
Error Response returned when encountered error
Show Source

404 Response

Not Found
Body ()
Root Schema : schema
Match All
Show Source
Example:
{
    "type":"https://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.4.5",
    "title":"Not Found",
    "detail":"Question group not found."
}
Nested Schema : Error Response
Type: object
Title: Error Response
Error Response returned when encountered error
Show Source

405 Response

Method Not Allowed
Body ()
Root Schema : schema
Match All
Show Source
Example:
{
    "type":"https://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.4.6",
    "title":"Method Not Supported",
    "detail":"HTTP method not supported for this resource"
}
Nested Schema : Error Response
Type: object
Title: Error Response
Error Response returned when encountered error
Show Source

415 Response

Unsupported Media Type
Body ()
Root Schema : schema
Match All
Show Source
Example:
{
    "type":"https://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.4.16",
    "title":"Invalid content",
    "detail":"Content type not supported"
}
Nested Schema : Error Response
Type: object
Title: Error Response
Error Response returned when encountered error
Show Source

500 Response

Internal Server Error
Body ()
Root Schema : schema
Match All
Show Source
Example:
{
    "type":"https://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.5.1",
    "title":"Internal Server Error",
    "detail":"Issue fulfilling request. Please retry or contact support"
}
Nested Schema : Error Response
Type: object
Title: Error Response
Error Response returned when encountered error
Show Source

503 Response

Service Unavailable
Body ()
Root Schema : schema
Match All
Show Source
Example:
{
    "type":"https://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.5.4",
    "title":"Service Unavailable",
    "detail":"Service Unavailable. Try again later"
}
Nested Schema : Error Response
Type: object
Title: Error Response
Error Response returned when encountered error
Show Source
Back to Top