Create a study (draft) from a guide
curl --request POST \
--url https://listenlabs.ai/api/public/v1/studies/create \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"title": "<string>",
"studyGuide": [
{
"title": "<string>",
"items": [
{
"text": "<string>",
"type": "open_ended",
"externalId": "<string>",
"conditional": {
"criteria": [
{
"type": "selectedTemplateOptions",
"questionId": "<string>",
"choices": [
"<string>"
],
"matrixRow": "<string>"
}
]
},
"media": [
{
"name": "<string>",
"url": "<string>",
"widthPercentage": 123,
"forceWatching": true
}
],
"embed": {
"url": "<string>",
"proxyUrl": "<string>"
},
"addInstructions": "<string>",
"screenObservationEnabled": true
}
],
"externalId": "<string>",
"conceptSamplingConfig": {
"concepts": [
{
"nickname": "<string>",
"content": {
"title": "<string>",
"description": "<string>",
"media": [
{
"name": "<unknown>",
"url": "<unknown>",
"type": "<unknown>",
"widthPercentage": "<unknown>"
}
],
"embed": {
"url": "<string>"
}
},
"externalId": "<string>",
"conditional": {
"criteria": [
{
"type": "selectedTemplateOptions",
"questionId": "<string>",
"choices": [
"<string>"
],
"matrixRow": "<string>"
}
]
}
}
],
"subsampleCount": 1
}
}
],
"externalTitle": "<string>",
"background": "<string>",
"studyGoal": "<string>",
"config": {
"availableLanguages": [
"<unknown>"
],
"targetPlatforms": []
},
"welcomeMessage": {
"title": "<string>",
"message": "<string>"
},
"closingMessage": "<string>"
}
'import requests
url = "https://listenlabs.ai/api/public/v1/studies/create"
payload = {
"title": "<string>",
"studyGuide": [
{
"title": "<string>",
"items": [
{
"text": "<string>",
"type": "open_ended",
"externalId": "<string>",
"conditional": { "criteria": [
{
"type": "selectedTemplateOptions",
"questionId": "<string>",
"choices": ["<string>"],
"matrixRow": "<string>"
}
] },
"media": [
{
"name": "<string>",
"url": "<string>",
"widthPercentage": 123,
"forceWatching": True
}
],
"embed": {
"url": "<string>",
"proxyUrl": "<string>"
},
"addInstructions": "<string>",
"screenObservationEnabled": True
}
],
"externalId": "<string>",
"conceptSamplingConfig": {
"concepts": [
{
"nickname": "<string>",
"content": {
"title": "<string>",
"description": "<string>",
"media": [
{
"name": "<unknown>",
"url": "<unknown>",
"type": "<unknown>",
"widthPercentage": "<unknown>"
}
],
"embed": { "url": "<string>" }
},
"externalId": "<string>",
"conditional": { "criteria": [
{
"type": "selectedTemplateOptions",
"questionId": "<string>",
"choices": ["<string>"],
"matrixRow": "<string>"
}
] }
}
],
"subsampleCount": 1
}
}
],
"externalTitle": "<string>",
"background": "<string>",
"studyGoal": "<string>",
"config": {
"availableLanguages": ["<unknown>"],
"targetPlatforms": []
},
"welcomeMessage": {
"title": "<string>",
"message": "<string>"
},
"closingMessage": "<string>"
}
headers = {
"x-api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'x-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
title: '<string>',
studyGuide: [
{
title: '<string>',
items: [
{
text: '<string>',
type: 'open_ended',
externalId: '<string>',
conditional: {
criteria: [
{
type: 'selectedTemplateOptions',
questionId: '<string>',
choices: ['<string>'],
matrixRow: '<string>'
}
]
},
media: [{name: '<string>', url: '<string>', widthPercentage: 123, forceWatching: true}],
embed: {url: '<string>', proxyUrl: '<string>'},
addInstructions: '<string>',
screenObservationEnabled: true
}
],
externalId: '<string>',
conceptSamplingConfig: {
concepts: [
{
nickname: '<string>',
content: {
title: '<string>',
description: '<string>',
media: [
{
name: '<unknown>',
url: '<unknown>',
type: '<unknown>',
widthPercentage: '<unknown>'
}
],
embed: {url: '<string>'}
},
externalId: '<string>',
conditional: {
criteria: [
{
type: 'selectedTemplateOptions',
questionId: '<string>',
choices: ['<string>'],
matrixRow: '<string>'
}
]
}
}
],
subsampleCount: 1
}
}
],
externalTitle: '<string>',
background: '<string>',
studyGoal: '<string>',
config: {availableLanguages: ['<unknown>'], targetPlatforms: []},
welcomeMessage: {title: '<string>', message: '<string>'},
closingMessage: '<string>'
})
};
fetch('https://listenlabs.ai/api/public/v1/studies/create', 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://listenlabs.ai/api/public/v1/studies/create",
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>',
'studyGuide' => [
[
'title' => '<string>',
'items' => [
[
'text' => '<string>',
'type' => 'open_ended',
'externalId' => '<string>',
'conditional' => [
'criteria' => [
[
'type' => 'selectedTemplateOptions',
'questionId' => '<string>',
'choices' => [
'<string>'
],
'matrixRow' => '<string>'
]
]
],
'media' => [
[
'name' => '<string>',
'url' => '<string>',
'widthPercentage' => 123,
'forceWatching' => true
]
],
'embed' => [
'url' => '<string>',
'proxyUrl' => '<string>'
],
'addInstructions' => '<string>',
'screenObservationEnabled' => true
]
],
'externalId' => '<string>',
'conceptSamplingConfig' => [
'concepts' => [
[
'nickname' => '<string>',
'content' => [
'title' => '<string>',
'description' => '<string>',
'media' => [
[
'name' => '<unknown>',
'url' => '<unknown>',
'type' => '<unknown>',
'widthPercentage' => '<unknown>'
]
],
'embed' => [
'url' => '<string>'
]
],
'externalId' => '<string>',
'conditional' => [
'criteria' => [
[
'type' => 'selectedTemplateOptions',
'questionId' => '<string>',
'choices' => [
'<string>'
],
'matrixRow' => '<string>'
]
]
]
]
],
'subsampleCount' => 1
]
]
],
'externalTitle' => '<string>',
'background' => '<string>',
'studyGoal' => '<string>',
'config' => [
'availableLanguages' => [
'<unknown>'
],
'targetPlatforms' => [
]
],
'welcomeMessage' => [
'title' => '<string>',
'message' => '<string>'
],
'closingMessage' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-api-key: <api-key>"
],
]);
$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://listenlabs.ai/api/public/v1/studies/create"
payload := strings.NewReader("{\n \"title\": \"<string>\",\n \"studyGuide\": [\n {\n \"title\": \"<string>\",\n \"items\": [\n {\n \"text\": \"<string>\",\n \"type\": \"open_ended\",\n \"externalId\": \"<string>\",\n \"conditional\": {\n \"criteria\": [\n {\n \"type\": \"selectedTemplateOptions\",\n \"questionId\": \"<string>\",\n \"choices\": [\n \"<string>\"\n ],\n \"matrixRow\": \"<string>\"\n }\n ]\n },\n \"media\": [\n {\n \"name\": \"<string>\",\n \"url\": \"<string>\",\n \"widthPercentage\": 123,\n \"forceWatching\": true\n }\n ],\n \"embed\": {\n \"url\": \"<string>\",\n \"proxyUrl\": \"<string>\"\n },\n \"addInstructions\": \"<string>\",\n \"screenObservationEnabled\": true\n }\n ],\n \"externalId\": \"<string>\",\n \"conceptSamplingConfig\": {\n \"concepts\": [\n {\n \"nickname\": \"<string>\",\n \"content\": {\n \"title\": \"<string>\",\n \"description\": \"<string>\",\n \"media\": [\n {\n \"name\": \"<unknown>\",\n \"url\": \"<unknown>\",\n \"type\": \"<unknown>\",\n \"widthPercentage\": \"<unknown>\"\n }\n ],\n \"embed\": {\n \"url\": \"<string>\"\n }\n },\n \"externalId\": \"<string>\",\n \"conditional\": {\n \"criteria\": [\n {\n \"type\": \"selectedTemplateOptions\",\n \"questionId\": \"<string>\",\n \"choices\": [\n \"<string>\"\n ],\n \"matrixRow\": \"<string>\"\n }\n ]\n }\n }\n ],\n \"subsampleCount\": 1\n }\n }\n ],\n \"externalTitle\": \"<string>\",\n \"background\": \"<string>\",\n \"studyGoal\": \"<string>\",\n \"config\": {\n \"availableLanguages\": [\n \"<unknown>\"\n ],\n \"targetPlatforms\": []\n },\n \"welcomeMessage\": {\n \"title\": \"<string>\",\n \"message\": \"<string>\"\n },\n \"closingMessage\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-api-key", "<api-key>")
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://listenlabs.ai/api/public/v1/studies/create")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"title\": \"<string>\",\n \"studyGuide\": [\n {\n \"title\": \"<string>\",\n \"items\": [\n {\n \"text\": \"<string>\",\n \"type\": \"open_ended\",\n \"externalId\": \"<string>\",\n \"conditional\": {\n \"criteria\": [\n {\n \"type\": \"selectedTemplateOptions\",\n \"questionId\": \"<string>\",\n \"choices\": [\n \"<string>\"\n ],\n \"matrixRow\": \"<string>\"\n }\n ]\n },\n \"media\": [\n {\n \"name\": \"<string>\",\n \"url\": \"<string>\",\n \"widthPercentage\": 123,\n \"forceWatching\": true\n }\n ],\n \"embed\": {\n \"url\": \"<string>\",\n \"proxyUrl\": \"<string>\"\n },\n \"addInstructions\": \"<string>\",\n \"screenObservationEnabled\": true\n }\n ],\n \"externalId\": \"<string>\",\n \"conceptSamplingConfig\": {\n \"concepts\": [\n {\n \"nickname\": \"<string>\",\n \"content\": {\n \"title\": \"<string>\",\n \"description\": \"<string>\",\n \"media\": [\n {\n \"name\": \"<unknown>\",\n \"url\": \"<unknown>\",\n \"type\": \"<unknown>\",\n \"widthPercentage\": \"<unknown>\"\n }\n ],\n \"embed\": {\n \"url\": \"<string>\"\n }\n },\n \"externalId\": \"<string>\",\n \"conditional\": {\n \"criteria\": [\n {\n \"type\": \"selectedTemplateOptions\",\n \"questionId\": \"<string>\",\n \"choices\": [\n \"<string>\"\n ],\n \"matrixRow\": \"<string>\"\n }\n ]\n }\n }\n ],\n \"subsampleCount\": 1\n }\n }\n ],\n \"externalTitle\": \"<string>\",\n \"background\": \"<string>\",\n \"studyGoal\": \"<string>\",\n \"config\": {\n \"availableLanguages\": [\n \"<unknown>\"\n ],\n \"targetPlatforms\": []\n },\n \"welcomeMessage\": {\n \"title\": \"<string>\",\n \"message\": \"<string>\"\n },\n \"closingMessage\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://listenlabs.ai/api/public/v1/studies/create")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-api-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"title\": \"<string>\",\n \"studyGuide\": [\n {\n \"title\": \"<string>\",\n \"items\": [\n {\n \"text\": \"<string>\",\n \"type\": \"open_ended\",\n \"externalId\": \"<string>\",\n \"conditional\": {\n \"criteria\": [\n {\n \"type\": \"selectedTemplateOptions\",\n \"questionId\": \"<string>\",\n \"choices\": [\n \"<string>\"\n ],\n \"matrixRow\": \"<string>\"\n }\n ]\n },\n \"media\": [\n {\n \"name\": \"<string>\",\n \"url\": \"<string>\",\n \"widthPercentage\": 123,\n \"forceWatching\": true\n }\n ],\n \"embed\": {\n \"url\": \"<string>\",\n \"proxyUrl\": \"<string>\"\n },\n \"addInstructions\": \"<string>\",\n \"screenObservationEnabled\": true\n }\n ],\n \"externalId\": \"<string>\",\n \"conceptSamplingConfig\": {\n \"concepts\": [\n {\n \"nickname\": \"<string>\",\n \"content\": {\n \"title\": \"<string>\",\n \"description\": \"<string>\",\n \"media\": [\n {\n \"name\": \"<unknown>\",\n \"url\": \"<unknown>\",\n \"type\": \"<unknown>\",\n \"widthPercentage\": \"<unknown>\"\n }\n ],\n \"embed\": {\n \"url\": \"<string>\"\n }\n },\n \"externalId\": \"<string>\",\n \"conditional\": {\n \"criteria\": [\n {\n \"type\": \"selectedTemplateOptions\",\n \"questionId\": \"<string>\",\n \"choices\": [\n \"<string>\"\n ],\n \"matrixRow\": \"<string>\"\n }\n ]\n }\n }\n ],\n \"subsampleCount\": 1\n }\n }\n ],\n \"externalTitle\": \"<string>\",\n \"background\": \"<string>\",\n \"studyGoal\": \"<string>\",\n \"config\": {\n \"availableLanguages\": [\n \"<unknown>\"\n ],\n \"targetPlatforms\": []\n },\n \"welcomeMessage\": {\n \"title\": \"<string>\",\n \"message\": \"<string>\"\n },\n \"closingMessage\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"linkId": "<string>",
"status": "draft"
}
Create Study
Validate a study guide and create a draft study in your organization
POST
/
api
/
public
/
v1
/
studies
/
create
Create a study (draft) from a guide
curl --request POST \
--url https://listenlabs.ai/api/public/v1/studies/create \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"title": "<string>",
"studyGuide": [
{
"title": "<string>",
"items": [
{
"text": "<string>",
"type": "open_ended",
"externalId": "<string>",
"conditional": {
"criteria": [
{
"type": "selectedTemplateOptions",
"questionId": "<string>",
"choices": [
"<string>"
],
"matrixRow": "<string>"
}
]
},
"media": [
{
"name": "<string>",
"url": "<string>",
"widthPercentage": 123,
"forceWatching": true
}
],
"embed": {
"url": "<string>",
"proxyUrl": "<string>"
},
"addInstructions": "<string>",
"screenObservationEnabled": true
}
],
"externalId": "<string>",
"conceptSamplingConfig": {
"concepts": [
{
"nickname": "<string>",
"content": {
"title": "<string>",
"description": "<string>",
"media": [
{
"name": "<unknown>",
"url": "<unknown>",
"type": "<unknown>",
"widthPercentage": "<unknown>"
}
],
"embed": {
"url": "<string>"
}
},
"externalId": "<string>",
"conditional": {
"criteria": [
{
"type": "selectedTemplateOptions",
"questionId": "<string>",
"choices": [
"<string>"
],
"matrixRow": "<string>"
}
]
}
}
],
"subsampleCount": 1
}
}
],
"externalTitle": "<string>",
"background": "<string>",
"studyGoal": "<string>",
"config": {
"availableLanguages": [
"<unknown>"
],
"targetPlatforms": []
},
"welcomeMessage": {
"title": "<string>",
"message": "<string>"
},
"closingMessage": "<string>"
}
'import requests
url = "https://listenlabs.ai/api/public/v1/studies/create"
payload = {
"title": "<string>",
"studyGuide": [
{
"title": "<string>",
"items": [
{
"text": "<string>",
"type": "open_ended",
"externalId": "<string>",
"conditional": { "criteria": [
{
"type": "selectedTemplateOptions",
"questionId": "<string>",
"choices": ["<string>"],
"matrixRow": "<string>"
}
] },
"media": [
{
"name": "<string>",
"url": "<string>",
"widthPercentage": 123,
"forceWatching": True
}
],
"embed": {
"url": "<string>",
"proxyUrl": "<string>"
},
"addInstructions": "<string>",
"screenObservationEnabled": True
}
],
"externalId": "<string>",
"conceptSamplingConfig": {
"concepts": [
{
"nickname": "<string>",
"content": {
"title": "<string>",
"description": "<string>",
"media": [
{
"name": "<unknown>",
"url": "<unknown>",
"type": "<unknown>",
"widthPercentage": "<unknown>"
}
],
"embed": { "url": "<string>" }
},
"externalId": "<string>",
"conditional": { "criteria": [
{
"type": "selectedTemplateOptions",
"questionId": "<string>",
"choices": ["<string>"],
"matrixRow": "<string>"
}
] }
}
],
"subsampleCount": 1
}
}
],
"externalTitle": "<string>",
"background": "<string>",
"studyGoal": "<string>",
"config": {
"availableLanguages": ["<unknown>"],
"targetPlatforms": []
},
"welcomeMessage": {
"title": "<string>",
"message": "<string>"
},
"closingMessage": "<string>"
}
headers = {
"x-api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'x-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
title: '<string>',
studyGuide: [
{
title: '<string>',
items: [
{
text: '<string>',
type: 'open_ended',
externalId: '<string>',
conditional: {
criteria: [
{
type: 'selectedTemplateOptions',
questionId: '<string>',
choices: ['<string>'],
matrixRow: '<string>'
}
]
},
media: [{name: '<string>', url: '<string>', widthPercentage: 123, forceWatching: true}],
embed: {url: '<string>', proxyUrl: '<string>'},
addInstructions: '<string>',
screenObservationEnabled: true
}
],
externalId: '<string>',
conceptSamplingConfig: {
concepts: [
{
nickname: '<string>',
content: {
title: '<string>',
description: '<string>',
media: [
{
name: '<unknown>',
url: '<unknown>',
type: '<unknown>',
widthPercentage: '<unknown>'
}
],
embed: {url: '<string>'}
},
externalId: '<string>',
conditional: {
criteria: [
{
type: 'selectedTemplateOptions',
questionId: '<string>',
choices: ['<string>'],
matrixRow: '<string>'
}
]
}
}
],
subsampleCount: 1
}
}
],
externalTitle: '<string>',
background: '<string>',
studyGoal: '<string>',
config: {availableLanguages: ['<unknown>'], targetPlatforms: []},
welcomeMessage: {title: '<string>', message: '<string>'},
closingMessage: '<string>'
})
};
fetch('https://listenlabs.ai/api/public/v1/studies/create', 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://listenlabs.ai/api/public/v1/studies/create",
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>',
'studyGuide' => [
[
'title' => '<string>',
'items' => [
[
'text' => '<string>',
'type' => 'open_ended',
'externalId' => '<string>',
'conditional' => [
'criteria' => [
[
'type' => 'selectedTemplateOptions',
'questionId' => '<string>',
'choices' => [
'<string>'
],
'matrixRow' => '<string>'
]
]
],
'media' => [
[
'name' => '<string>',
'url' => '<string>',
'widthPercentage' => 123,
'forceWatching' => true
]
],
'embed' => [
'url' => '<string>',
'proxyUrl' => '<string>'
],
'addInstructions' => '<string>',
'screenObservationEnabled' => true
]
],
'externalId' => '<string>',
'conceptSamplingConfig' => [
'concepts' => [
[
'nickname' => '<string>',
'content' => [
'title' => '<string>',
'description' => '<string>',
'media' => [
[
'name' => '<unknown>',
'url' => '<unknown>',
'type' => '<unknown>',
'widthPercentage' => '<unknown>'
]
],
'embed' => [
'url' => '<string>'
]
],
'externalId' => '<string>',
'conditional' => [
'criteria' => [
[
'type' => 'selectedTemplateOptions',
'questionId' => '<string>',
'choices' => [
'<string>'
],
'matrixRow' => '<string>'
]
]
]
]
],
'subsampleCount' => 1
]
]
],
'externalTitle' => '<string>',
'background' => '<string>',
'studyGoal' => '<string>',
'config' => [
'availableLanguages' => [
'<unknown>'
],
'targetPlatforms' => [
]
],
'welcomeMessage' => [
'title' => '<string>',
'message' => '<string>'
],
'closingMessage' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-api-key: <api-key>"
],
]);
$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://listenlabs.ai/api/public/v1/studies/create"
payload := strings.NewReader("{\n \"title\": \"<string>\",\n \"studyGuide\": [\n {\n \"title\": \"<string>\",\n \"items\": [\n {\n \"text\": \"<string>\",\n \"type\": \"open_ended\",\n \"externalId\": \"<string>\",\n \"conditional\": {\n \"criteria\": [\n {\n \"type\": \"selectedTemplateOptions\",\n \"questionId\": \"<string>\",\n \"choices\": [\n \"<string>\"\n ],\n \"matrixRow\": \"<string>\"\n }\n ]\n },\n \"media\": [\n {\n \"name\": \"<string>\",\n \"url\": \"<string>\",\n \"widthPercentage\": 123,\n \"forceWatching\": true\n }\n ],\n \"embed\": {\n \"url\": \"<string>\",\n \"proxyUrl\": \"<string>\"\n },\n \"addInstructions\": \"<string>\",\n \"screenObservationEnabled\": true\n }\n ],\n \"externalId\": \"<string>\",\n \"conceptSamplingConfig\": {\n \"concepts\": [\n {\n \"nickname\": \"<string>\",\n \"content\": {\n \"title\": \"<string>\",\n \"description\": \"<string>\",\n \"media\": [\n {\n \"name\": \"<unknown>\",\n \"url\": \"<unknown>\",\n \"type\": \"<unknown>\",\n \"widthPercentage\": \"<unknown>\"\n }\n ],\n \"embed\": {\n \"url\": \"<string>\"\n }\n },\n \"externalId\": \"<string>\",\n \"conditional\": {\n \"criteria\": [\n {\n \"type\": \"selectedTemplateOptions\",\n \"questionId\": \"<string>\",\n \"choices\": [\n \"<string>\"\n ],\n \"matrixRow\": \"<string>\"\n }\n ]\n }\n }\n ],\n \"subsampleCount\": 1\n }\n }\n ],\n \"externalTitle\": \"<string>\",\n \"background\": \"<string>\",\n \"studyGoal\": \"<string>\",\n \"config\": {\n \"availableLanguages\": [\n \"<unknown>\"\n ],\n \"targetPlatforms\": []\n },\n \"welcomeMessage\": {\n \"title\": \"<string>\",\n \"message\": \"<string>\"\n },\n \"closingMessage\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-api-key", "<api-key>")
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://listenlabs.ai/api/public/v1/studies/create")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"title\": \"<string>\",\n \"studyGuide\": [\n {\n \"title\": \"<string>\",\n \"items\": [\n {\n \"text\": \"<string>\",\n \"type\": \"open_ended\",\n \"externalId\": \"<string>\",\n \"conditional\": {\n \"criteria\": [\n {\n \"type\": \"selectedTemplateOptions\",\n \"questionId\": \"<string>\",\n \"choices\": [\n \"<string>\"\n ],\n \"matrixRow\": \"<string>\"\n }\n ]\n },\n \"media\": [\n {\n \"name\": \"<string>\",\n \"url\": \"<string>\",\n \"widthPercentage\": 123,\n \"forceWatching\": true\n }\n ],\n \"embed\": {\n \"url\": \"<string>\",\n \"proxyUrl\": \"<string>\"\n },\n \"addInstructions\": \"<string>\",\n \"screenObservationEnabled\": true\n }\n ],\n \"externalId\": \"<string>\",\n \"conceptSamplingConfig\": {\n \"concepts\": [\n {\n \"nickname\": \"<string>\",\n \"content\": {\n \"title\": \"<string>\",\n \"description\": \"<string>\",\n \"media\": [\n {\n \"name\": \"<unknown>\",\n \"url\": \"<unknown>\",\n \"type\": \"<unknown>\",\n \"widthPercentage\": \"<unknown>\"\n }\n ],\n \"embed\": {\n \"url\": \"<string>\"\n }\n },\n \"externalId\": \"<string>\",\n \"conditional\": {\n \"criteria\": [\n {\n \"type\": \"selectedTemplateOptions\",\n \"questionId\": \"<string>\",\n \"choices\": [\n \"<string>\"\n ],\n \"matrixRow\": \"<string>\"\n }\n ]\n }\n }\n ],\n \"subsampleCount\": 1\n }\n }\n ],\n \"externalTitle\": \"<string>\",\n \"background\": \"<string>\",\n \"studyGoal\": \"<string>\",\n \"config\": {\n \"availableLanguages\": [\n \"<unknown>\"\n ],\n \"targetPlatforms\": []\n },\n \"welcomeMessage\": {\n \"title\": \"<string>\",\n \"message\": \"<string>\"\n },\n \"closingMessage\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://listenlabs.ai/api/public/v1/studies/create")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-api-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"title\": \"<string>\",\n \"studyGuide\": [\n {\n \"title\": \"<string>\",\n \"items\": [\n {\n \"text\": \"<string>\",\n \"type\": \"open_ended\",\n \"externalId\": \"<string>\",\n \"conditional\": {\n \"criteria\": [\n {\n \"type\": \"selectedTemplateOptions\",\n \"questionId\": \"<string>\",\n \"choices\": [\n \"<string>\"\n ],\n \"matrixRow\": \"<string>\"\n }\n ]\n },\n \"media\": [\n {\n \"name\": \"<string>\",\n \"url\": \"<string>\",\n \"widthPercentage\": 123,\n \"forceWatching\": true\n }\n ],\n \"embed\": {\n \"url\": \"<string>\",\n \"proxyUrl\": \"<string>\"\n },\n \"addInstructions\": \"<string>\",\n \"screenObservationEnabled\": true\n }\n ],\n \"externalId\": \"<string>\",\n \"conceptSamplingConfig\": {\n \"concepts\": [\n {\n \"nickname\": \"<string>\",\n \"content\": {\n \"title\": \"<string>\",\n \"description\": \"<string>\",\n \"media\": [\n {\n \"name\": \"<unknown>\",\n \"url\": \"<unknown>\",\n \"type\": \"<unknown>\",\n \"widthPercentage\": \"<unknown>\"\n }\n ],\n \"embed\": {\n \"url\": \"<string>\"\n }\n },\n \"externalId\": \"<string>\",\n \"conditional\": {\n \"criteria\": [\n {\n \"type\": \"selectedTemplateOptions\",\n \"questionId\": \"<string>\",\n \"choices\": [\n \"<string>\"\n ],\n \"matrixRow\": \"<string>\"\n }\n ]\n }\n }\n ],\n \"subsampleCount\": 1\n }\n }\n ],\n \"externalTitle\": \"<string>\",\n \"background\": \"<string>\",\n \"studyGoal\": \"<string>\",\n \"config\": {\n \"availableLanguages\": [\n \"<unknown>\"\n ],\n \"targetPlatforms\": []\n },\n \"welcomeMessage\": {\n \"title\": \"<string>\",\n \"message\": \"<string>\"\n },\n \"closingMessage\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"linkId": "<string>",
"status": "draft"
}
Authorizations
Body
application/json
Rules enforced by the server: at most one screening block and it must be first; screening blocks may contain only multiple_choice items and every option must carry a status; concept blocks require conceptSamplingConfig (>=1 concept) and other blocks must omit it; externalIds must be unique across blocks, items, options, and concepts; conditional questionId and carryForwardFrom must reference the externalId of an earlier item; concept conditionals must reference an item in a block before the concept block.
⌘I