Query SDQ
Fetch SDQ assessment scores for a student across all three respondents
Query SDQ for One Student
Fetches all three SDQ respondents (teacher / parent / student) in a single call. Omit semesterId to score the caller's active semester.
curl -X POST https://data.nextschool.io/ \
-H "Content-Type: application/json" \
-H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
-d '{
"query": "{ student(id: 12345) { id fullName sdq { respondent totalScore totalLevel totalLevelText dimensions { name nameText score level levelText } } } }"
}'const response = await fetch('https://data.nextschool.io/', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
'Authorization': `Bearer ${accessToken}`
},
body: JSON.stringify({
query: `{
student(id: 12345) {
id
fullName
sdq {
respondent
totalScore
totalLevel
totalLevelText
dimensions {
name
nameText
score
level
levelText
}
}
}
}`
})
});
const { data } = await response.json();
console.log(data.student.sdq);response = requests.post('https://data.nextschool.io/',
headers={
'Content-Type': 'application/json',
'Authorization': f'Bearer {access_token}'
},
json={
'query': '''{
student(id: 12345) {
id
fullName
sdq {
respondent
totalScore
totalLevel
totalLevelText
dimensions {
name
nameText
score
level
levelText
}
}
}
}'''
}
)
sdq = response.json()['data']['student']['sdq']<?php
$ch = curl_init('https://data.nextschool.io/');
curl_setopt_array($ch, [
CURLOPT_POST => true,
CURLOPT_HTTPHEADER => [
'Content-Type: application/json',
"Authorization: Bearer $accessToken"
],
CURLOPT_POSTFIELDS => json_encode([
'query' => '{ student(id: 12345) { id fullName sdq { respondent totalScore totalLevel totalLevelText dimensions { name nameText score level levelText } } } }'
]),
CURLOPT_RETURNTRANSFER => true,
]);
$result = json_decode(curl_exec($ch), true);
$sdq = $result['data']['student']['sdq'];body, _ := json.Marshal(map[string]string{
"query": `{ student(id: 12345) { id fullName sdq { respondent totalScore totalLevel totalLevelText dimensions { name nameText score level levelText } } } }`,
})
req, _ := http.NewRequest("POST", "https://data.nextschool.io/", bytes.NewBuffer(body))
req.Header.Set("Content-Type", "application/json")
req.Header.Set("Authorization", "Bearer "+accessToken)
resp, _ := http.DefaultClient.Do(req)
defer resp.Body.Close()
var result map[string]any
json.NewDecoder(resp.Body).Decode(&result)
fmt.Println(result["data"])let resp = client.post("https://data.nextschool.io/")
.header("Content-Type", "application/json")
.header("Authorization", format!("Bearer {}", access_token))
.json(&serde_json::json!({
"query": "{ student(id: 12345) { id fullName sdq { respondent totalScore totalLevel totalLevelText dimensions { name nameText score level levelText } } } }"
}))
.send().await?
.json::<serde_json::Value>().await?;
println!("{:#}", resp["data"]["student"]["sdq"]);Query SDQ Student List
List students in a classroom with their SDQ completion status for each respondent.
curl -X POST https://data.nextschool.io/ \
-H "Content-Type: application/json" \
-H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
-d '{
"query": "{ sdqStudents(classroomId: 42, status: \"progress\", limit: 20) { studentId code firstname lastname classroomName teacherDone parentDone studentDone } }"
}'const response = await fetch('https://data.nextschool.io/', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
'Authorization': `Bearer ${accessToken}`
},
body: JSON.stringify({
query: `{
sdqStudents(classroomId: 42, status: "progress", limit: 20) {
studentId
code
firstname
lastname
classroomName
teacherDone
parentDone
studentDone
}
}`
})
});
const { data } = await response.json();
console.log(data.sdqStudents);response = requests.post('https://data.nextschool.io/',
headers={
'Content-Type': 'application/json',
'Authorization': f'Bearer {access_token}'
},
json={
'query': '''{
sdqStudents(classroomId: 42, status: "progress", limit: 20) {
studentId
code
firstname
lastname
classroomName
teacherDone
parentDone
studentDone
}
}'''
}
)
students = response.json()['data']['sdqStudents']<?php
$ch = curl_init('https://data.nextschool.io/');
curl_setopt_array($ch, [
CURLOPT_POST => true,
CURLOPT_HTTPHEADER => [
'Content-Type: application/json',
"Authorization: Bearer $accessToken"
],
CURLOPT_POSTFIELDS => json_encode([
'query' => '{ sdqStudents(classroomId: 42, status: "progress", limit: 20) { studentId code firstname lastname classroomName teacherDone parentDone studentDone } }'
]),
CURLOPT_RETURNTRANSFER => true,
]);
$result = json_decode(curl_exec($ch), true);
$students = $result['data']['sdqStudents'];body, _ := json.Marshal(map[string]string{
"query": `{ sdqStudents(classroomId: 42, status: "progress", limit: 20) { studentId code firstname lastname classroomName teacherDone parentDone studentDone } }`,
})
req, _ := http.NewRequest("POST", "https://data.nextschool.io/", bytes.NewBuffer(body))
req.Header.Set("Content-Type", "application/json")
req.Header.Set("Authorization", "Bearer "+accessToken)
resp, _ := http.DefaultClient.Do(req)
defer resp.Body.Close()
var result map[string]any
json.NewDecoder(resp.Body).Decode(&result)
fmt.Println(result["data"])let resp = client.post("https://data.nextschool.io/")
.header("Content-Type", "application/json")
.header("Authorization", format!("Bearer {}", access_token))
.json(&serde_json::json!({
"query": "{ sdqStudents(classroomId: 42, status: \"progress\", limit: 20) { studentId code firstname lastname classroomName teacherDone parentDone studentDone } }"
}))
.send().await?
.json::<serde_json::Value>().await?;
println!("{:#}", resp["data"]["sdqStudents"]);