Create a new question owned by the caller’s account.
The question is one of six types selected by the required question_type
discriminator (categorical, rating, number, free_text, form, or timestamp),
and each type carries its own configuration block; name and prompt
are required for every type. Questions are the reusable units that are grouped
into question sets and referenced by rubrics, so create them before assembling
a question set. The created question is scoped to the caller’s account and
records the creating identity. The question type and its configuration are set
at creation time and cannot be changed afterward through the update endpoint.
Create a question
import os
from scale_gp_beta import SGPClient
client = SGPClient(
api_key=os.environ.get("SGP_API_KEY"), # This is the default and can be omitted
)
question = client.questions.create(
question={
"configuration": {
"choices": ["string"]
},
"name": "name",
"prompt": "prompt",
"question_type": "categorical",
},
)
print(question){
"id": "id",
"configuration": {
"choices": [
"string"
],
"dropdown": true,
"multi": true
},
"created_at": "2019-12-27T18:11:19.117Z",
"created_by": {
"id": "id",
"type": "user",
"object": "identity"
},
"name": "name",
"prompt": "prompt",
"archived_at": "2019-12-27T18:11:19.117Z",
"conditions": [
{
"foo": "bar"
}
],
"object": "question",
"question_type": "categorical"
}Returns Examples
{
"id": "id",
"configuration": {
"choices": [
"string"
],
"dropdown": true,
"multi": true
},
"created_at": "2019-12-27T18:11:19.117Z",
"created_by": {
"id": "id",
"type": "user",
"object": "identity"
},
"name": "name",
"prompt": "prompt",
"archived_at": "2019-12-27T18:11:19.117Z",
"conditions": [
{
"foo": "bar"
}
],
"object": "question",
"question_type": "categorical"
}