Create Question
curl --request POST \
--url https://api.egp.scale.com/v4/questions \
--header 'Content-Type: application/json' \
--data '
{
"title": "<string>",
"prompt": "<string>",
"account_id": "<string>",
"choices": [
{
"label": "<string>",
"value": "<string>",
"audit_required": false
}
],
"ratingOptions": {
"minLabel": "<string>",
"maxLabel": "<string>",
"scaleSteps": 123
},
"numberOptions": {
"min": 123,
"max": 123
},
"freeTextOptions": {
"characterLimit": {
"min": 50,
"max": 1000
}
},
"multi": true,
"dropdown": true,
"required": true,
"conditions": [
{}
],
"default": "<unknown>",
"form_schema": {},
"allowMultiTimestamps": true
}
'import requests
url = "https://api.egp.scale.com/v4/questions"
payload = {
"title": "<string>",
"prompt": "<string>",
"account_id": "<string>",
"choices": [
{
"label": "<string>",
"value": "<string>",
"audit_required": False
}
],
"ratingOptions": {
"minLabel": "<string>",
"maxLabel": "<string>",
"scaleSteps": 123
},
"numberOptions": {
"min": 123,
"max": 123
},
"freeTextOptions": { "characterLimit": {
"min": 50,
"max": 1000
} },
"multi": True,
"dropdown": True,
"required": True,
"conditions": [{}],
"default": "<unknown>",
"form_schema": {},
"allowMultiTimestamps": True
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
title: '<string>',
prompt: '<string>',
account_id: '<string>',
choices: [{label: '<string>', value: '<string>', audit_required: false}],
ratingOptions: {minLabel: '<string>', maxLabel: '<string>', scaleSteps: 123},
numberOptions: {min: 123, max: 123},
freeTextOptions: {characterLimit: {min: 50, max: 1000}},
multi: true,
dropdown: true,
required: true,
conditions: [{}],
default: '<unknown>',
form_schema: {},
allowMultiTimestamps: true
})
};
fetch('https://api.egp.scale.com/v4/questions', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.egp.scale.com/v4/questions",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'title' => '<string>',
'prompt' => '<string>',
'account_id' => '<string>',
'choices' => [
[
'label' => '<string>',
'value' => '<string>',
'audit_required' => false
]
],
'ratingOptions' => [
'minLabel' => '<string>',
'maxLabel' => '<string>',
'scaleSteps' => 123
],
'numberOptions' => [
'min' => 123,
'max' => 123
],
'freeTextOptions' => [
'characterLimit' => [
'min' => 50,
'max' => 1000
]
],
'multi' => true,
'dropdown' => true,
'required' => true,
'conditions' => [
[
]
],
'default' => '<unknown>',
'form_schema' => [
],
'allowMultiTimestamps' => true
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.egp.scale.com/v4/questions"
payload := strings.NewReader("{\n \"title\": \"<string>\",\n \"prompt\": \"<string>\",\n \"account_id\": \"<string>\",\n \"choices\": [\n {\n \"label\": \"<string>\",\n \"value\": \"<string>\",\n \"audit_required\": false\n }\n ],\n \"ratingOptions\": {\n \"minLabel\": \"<string>\",\n \"maxLabel\": \"<string>\",\n \"scaleSteps\": 123\n },\n \"numberOptions\": {\n \"min\": 123,\n \"max\": 123\n },\n \"freeTextOptions\": {\n \"characterLimit\": {\n \"min\": 50,\n \"max\": 1000\n }\n },\n \"multi\": true,\n \"dropdown\": true,\n \"required\": true,\n \"conditions\": [\n {}\n ],\n \"default\": \"<unknown>\",\n \"form_schema\": {},\n \"allowMultiTimestamps\": true\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.egp.scale.com/v4/questions")
.header("Content-Type", "application/json")
.body("{\n \"title\": \"<string>\",\n \"prompt\": \"<string>\",\n \"account_id\": \"<string>\",\n \"choices\": [\n {\n \"label\": \"<string>\",\n \"value\": \"<string>\",\n \"audit_required\": false\n }\n ],\n \"ratingOptions\": {\n \"minLabel\": \"<string>\",\n \"maxLabel\": \"<string>\",\n \"scaleSteps\": 123\n },\n \"numberOptions\": {\n \"min\": 123,\n \"max\": 123\n },\n \"freeTextOptions\": {\n \"characterLimit\": {\n \"min\": 50,\n \"max\": 1000\n }\n },\n \"multi\": true,\n \"dropdown\": true,\n \"required\": true,\n \"conditions\": [\n {}\n ],\n \"default\": \"<unknown>\",\n \"form_schema\": {},\n \"allowMultiTimestamps\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.egp.scale.com/v4/questions")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"title\": \"<string>\",\n \"prompt\": \"<string>\",\n \"account_id\": \"<string>\",\n \"choices\": [\n {\n \"label\": \"<string>\",\n \"value\": \"<string>\",\n \"audit_required\": false\n }\n ],\n \"ratingOptions\": {\n \"minLabel\": \"<string>\",\n \"maxLabel\": \"<string>\",\n \"scaleSteps\": 123\n },\n \"numberOptions\": {\n \"min\": 123,\n \"max\": 123\n },\n \"freeTextOptions\": {\n \"characterLimit\": {\n \"min\": 50,\n \"max\": 1000\n }\n },\n \"multi\": true,\n \"dropdown\": true,\n \"required\": true,\n \"conditions\": [\n {}\n ],\n \"default\": \"<unknown>\",\n \"form_schema\": {},\n \"allowMultiTimestamps\": true\n}"
response = http.request(request)
puts response.read_body{
"type": "categorical",
"title": "<string>",
"prompt": "<string>",
"id": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"account_id": "<string>",
"created_by_user_id": "<string>",
"created_by_identity_type": "user",
"choices": [
{
"label": "<string>",
"value": "<string>",
"audit_required": false
}
],
"ratingOptions": {
"minLabel": "<string>",
"maxLabel": "<string>",
"scaleSteps": 123
},
"numberOptions": {
"min": 123,
"max": 123
},
"freeTextOptions": {
"characterLimit": {
"min": 50,
"max": 1000
}
},
"multi": true,
"dropdown": true,
"required": true,
"conditions": [
{}
],
"default": "<unknown>",
"form_schema": {},
"archived_at": "2023-11-07T05:31:56Z"
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"input": "<unknown>",
"ctx": {}
}
]
}Questions
Create Question
Description
Creates a question
Details
This API can be used to create a question. To use this API, review the request schema and pass in all fields that are required to create a question.
POST
/
v4
/
questions
Create Question
curl --request POST \
--url https://api.egp.scale.com/v4/questions \
--header 'Content-Type: application/json' \
--data '
{
"title": "<string>",
"prompt": "<string>",
"account_id": "<string>",
"choices": [
{
"label": "<string>",
"value": "<string>",
"audit_required": false
}
],
"ratingOptions": {
"minLabel": "<string>",
"maxLabel": "<string>",
"scaleSteps": 123
},
"numberOptions": {
"min": 123,
"max": 123
},
"freeTextOptions": {
"characterLimit": {
"min": 50,
"max": 1000
}
},
"multi": true,
"dropdown": true,
"required": true,
"conditions": [
{}
],
"default": "<unknown>",
"form_schema": {},
"allowMultiTimestamps": true
}
'import requests
url = "https://api.egp.scale.com/v4/questions"
payload = {
"title": "<string>",
"prompt": "<string>",
"account_id": "<string>",
"choices": [
{
"label": "<string>",
"value": "<string>",
"audit_required": False
}
],
"ratingOptions": {
"minLabel": "<string>",
"maxLabel": "<string>",
"scaleSteps": 123
},
"numberOptions": {
"min": 123,
"max": 123
},
"freeTextOptions": { "characterLimit": {
"min": 50,
"max": 1000
} },
"multi": True,
"dropdown": True,
"required": True,
"conditions": [{}],
"default": "<unknown>",
"form_schema": {},
"allowMultiTimestamps": True
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
title: '<string>',
prompt: '<string>',
account_id: '<string>',
choices: [{label: '<string>', value: '<string>', audit_required: false}],
ratingOptions: {minLabel: '<string>', maxLabel: '<string>', scaleSteps: 123},
numberOptions: {min: 123, max: 123},
freeTextOptions: {characterLimit: {min: 50, max: 1000}},
multi: true,
dropdown: true,
required: true,
conditions: [{}],
default: '<unknown>',
form_schema: {},
allowMultiTimestamps: true
})
};
fetch('https://api.egp.scale.com/v4/questions', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.egp.scale.com/v4/questions",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'title' => '<string>',
'prompt' => '<string>',
'account_id' => '<string>',
'choices' => [
[
'label' => '<string>',
'value' => '<string>',
'audit_required' => false
]
],
'ratingOptions' => [
'minLabel' => '<string>',
'maxLabel' => '<string>',
'scaleSteps' => 123
],
'numberOptions' => [
'min' => 123,
'max' => 123
],
'freeTextOptions' => [
'characterLimit' => [
'min' => 50,
'max' => 1000
]
],
'multi' => true,
'dropdown' => true,
'required' => true,
'conditions' => [
[
]
],
'default' => '<unknown>',
'form_schema' => [
],
'allowMultiTimestamps' => true
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.egp.scale.com/v4/questions"
payload := strings.NewReader("{\n \"title\": \"<string>\",\n \"prompt\": \"<string>\",\n \"account_id\": \"<string>\",\n \"choices\": [\n {\n \"label\": \"<string>\",\n \"value\": \"<string>\",\n \"audit_required\": false\n }\n ],\n \"ratingOptions\": {\n \"minLabel\": \"<string>\",\n \"maxLabel\": \"<string>\",\n \"scaleSteps\": 123\n },\n \"numberOptions\": {\n \"min\": 123,\n \"max\": 123\n },\n \"freeTextOptions\": {\n \"characterLimit\": {\n \"min\": 50,\n \"max\": 1000\n }\n },\n \"multi\": true,\n \"dropdown\": true,\n \"required\": true,\n \"conditions\": [\n {}\n ],\n \"default\": \"<unknown>\",\n \"form_schema\": {},\n \"allowMultiTimestamps\": true\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.egp.scale.com/v4/questions")
.header("Content-Type", "application/json")
.body("{\n \"title\": \"<string>\",\n \"prompt\": \"<string>\",\n \"account_id\": \"<string>\",\n \"choices\": [\n {\n \"label\": \"<string>\",\n \"value\": \"<string>\",\n \"audit_required\": false\n }\n ],\n \"ratingOptions\": {\n \"minLabel\": \"<string>\",\n \"maxLabel\": \"<string>\",\n \"scaleSteps\": 123\n },\n \"numberOptions\": {\n \"min\": 123,\n \"max\": 123\n },\n \"freeTextOptions\": {\n \"characterLimit\": {\n \"min\": 50,\n \"max\": 1000\n }\n },\n \"multi\": true,\n \"dropdown\": true,\n \"required\": true,\n \"conditions\": [\n {}\n ],\n \"default\": \"<unknown>\",\n \"form_schema\": {},\n \"allowMultiTimestamps\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.egp.scale.com/v4/questions")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"title\": \"<string>\",\n \"prompt\": \"<string>\",\n \"account_id\": \"<string>\",\n \"choices\": [\n {\n \"label\": \"<string>\",\n \"value\": \"<string>\",\n \"audit_required\": false\n }\n ],\n \"ratingOptions\": {\n \"minLabel\": \"<string>\",\n \"maxLabel\": \"<string>\",\n \"scaleSteps\": 123\n },\n \"numberOptions\": {\n \"min\": 123,\n \"max\": 123\n },\n \"freeTextOptions\": {\n \"characterLimit\": {\n \"min\": 50,\n \"max\": 1000\n }\n },\n \"multi\": true,\n \"dropdown\": true,\n \"required\": true,\n \"conditions\": [\n {}\n ],\n \"default\": \"<unknown>\",\n \"form_schema\": {},\n \"allowMultiTimestamps\": true\n}"
response = http.request(request)
puts response.read_body{
"type": "categorical",
"title": "<string>",
"prompt": "<string>",
"id": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"account_id": "<string>",
"created_by_user_id": "<string>",
"created_by_identity_type": "user",
"choices": [
{
"label": "<string>",
"value": "<string>",
"audit_required": false
}
],
"ratingOptions": {
"minLabel": "<string>",
"maxLabel": "<string>",
"scaleSteps": 123
},
"numberOptions": {
"min": 123,
"max": 123
},
"freeTextOptions": {
"characterLimit": {
"min": 50,
"max": 1000
}
},
"multi": true,
"dropdown": true,
"required": true,
"conditions": [
{}
],
"default": "<unknown>",
"form_schema": {},
"archived_at": "2023-11-07T05:31:56Z"
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"input": "<unknown>",
"ctx": {}
}
]
}Body
application/json
Response
Successful Response

