Update a Class
curl --request PUT \
--url https://api.alpha-1edtech.ai/ims/oneroster/rostering/v1p2/classes/{sourcedId} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"class": {
"metadata": {},
"title": "<string>",
"classCode": "<string>",
"location": "<string>",
"grades": [],
"subjects": [],
"subjectCodes": [
"<string>"
],
"periods": [
"<string>"
],
"resources": [
{
"sourcedId": "<string>"
}
],
"terms": [
{
"sourcedId": "<string>"
}
]
}
}
'import requests
url = "https://api.alpha-1edtech.ai/ims/oneroster/rostering/v1p2/classes/{sourcedId}"
payload = { "class": {
"metadata": {},
"title": "<string>",
"classCode": "<string>",
"location": "<string>",
"grades": [],
"subjects": [],
"subjectCodes": ["<string>"],
"periods": ["<string>"],
"resources": [{ "sourcedId": "<string>" }],
"terms": [{ "sourcedId": "<string>" }]
} }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
class: {
metadata: {},
title: '<string>',
classCode: '<string>',
location: '<string>',
grades: [],
subjects: [],
subjectCodes: ['<string>'],
periods: ['<string>'],
resources: [{sourcedId: '<string>'}],
terms: [{sourcedId: '<string>'}]
}
})
};
fetch('https://api.alpha-1edtech.ai/ims/oneroster/rostering/v1p2/classes/{sourcedId}', 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.alpha-1edtech.ai/ims/oneroster/rostering/v1p2/classes/{sourcedId}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'class' => [
'metadata' => [
],
'title' => '<string>',
'classCode' => '<string>',
'location' => '<string>',
'grades' => [
],
'subjects' => [
],
'subjectCodes' => [
'<string>'
],
'periods' => [
'<string>'
],
'resources' => [
[
'sourcedId' => '<string>'
]
],
'terms' => [
[
'sourcedId' => '<string>'
]
]
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"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.alpha-1edtech.ai/ims/oneroster/rostering/v1p2/classes/{sourcedId}"
payload := strings.NewReader("{\n \"class\": {\n \"metadata\": {},\n \"title\": \"<string>\",\n \"classCode\": \"<string>\",\n \"location\": \"<string>\",\n \"grades\": [],\n \"subjects\": [],\n \"subjectCodes\": [\n \"<string>\"\n ],\n \"periods\": [\n \"<string>\"\n ],\n \"resources\": [\n {\n \"sourcedId\": \"<string>\"\n }\n ],\n \"terms\": [\n {\n \"sourcedId\": \"<string>\"\n }\n ]\n }\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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.put("https://api.alpha-1edtech.ai/ims/oneroster/rostering/v1p2/classes/{sourcedId}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"class\": {\n \"metadata\": {},\n \"title\": \"<string>\",\n \"classCode\": \"<string>\",\n \"location\": \"<string>\",\n \"grades\": [],\n \"subjects\": [],\n \"subjectCodes\": [\n \"<string>\"\n ],\n \"periods\": [\n \"<string>\"\n ],\n \"resources\": [\n {\n \"sourcedId\": \"<string>\"\n }\n ],\n \"terms\": [\n {\n \"sourcedId\": \"<string>\"\n }\n ]\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.alpha-1edtech.ai/ims/oneroster/rostering/v1p2/classes/{sourcedId}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"class\": {\n \"metadata\": {},\n \"title\": \"<string>\",\n \"classCode\": \"<string>\",\n \"location\": \"<string>\",\n \"grades\": [],\n \"subjects\": [],\n \"subjectCodes\": [\n \"<string>\"\n ],\n \"periods\": [\n \"<string>\"\n ],\n \"resources\": [\n {\n \"sourcedId\": \"<string>\"\n }\n ],\n \"terms\": [\n {\n \"sourcedId\": \"<string>\"\n }\n ]\n }\n}"
response = http.request(request)
puts response.read_body{
"sourcedId": "<string>",
"title": "<string>",
"classCode": "<string>",
"location": "<string>",
"course": {
"href": "<string>",
"sourcedId": "<string>",
"type": "<string>"
},
"school": {
"href": "<string>",
"sourcedId": "<string>",
"type": "<string>"
},
"terms": [
{
"href": "<string>",
"sourcedId": "<string>",
"type": "<string>"
}
],
"dateLastModified": "2023-11-07T05:31:56Z",
"metadata": {},
"grades": [
"3"
],
"subjects": [],
"subjectCodes": [
"<string>"
],
"periods": [
"<string>"
],
"resources": [
{
"href": "<string>",
"sourcedId": "<string>",
"type": "<string>"
}
]
}{
"imsx_codeMajor": "failure",
"imsx_severity": "error",
"imsx_description": "<string>",
"imsx_CodeMinor": {
"imsx_codeMinorField": [
{
"imsx_codeMinorFieldName": "TargetEndSystem",
"imsx_codeMinorFieldValue": "invaliddata"
}
]
},
"imsx_error_details": [
{}
]
}{
"imsx_codeMajor": "failure",
"imsx_severity": "error",
"imsx_description": "<string>",
"imsx_CodeMinor": {
"imsx_codeMinorField": [
{
"imsx_codeMinorFieldName": "TargetEndSystem",
"imsx_codeMinorFieldValue": "unauthorisedrequest"
}
]
},
"imsx_error_details": [
{}
]
}{
"imsx_codeMajor": "failure",
"imsx_severity": "error",
"imsx_description": "<string>",
"imsx_CodeMinor": {
"imsx_codeMinorField": [
{
"imsx_codeMinorFieldName": "TargetEndSystem",
"imsx_codeMinorFieldValue": "forbidden"
}
]
},
"imsx_error_details": [
{}
]
}{
"imsx_codeMajor": "failure",
"imsx_severity": "error",
"imsx_description": "<string>",
"imsx_CodeMinor": {
"imsx_codeMinorField": [
{
"imsx_codeMinorFieldName": "TargetEndSystem",
"imsx_codeMinorFieldValue": "unknownobject"
}
]
},
"imsx_error_details": [
{}
]
}{
"imsx_codeMajor": "failure",
"imsx_severity": "error",
"imsx_description": "<string>",
"imsx_CodeMinor": {
"imsx_codeMinorField": [
{
"imsx_codeMinorFieldName": "TargetEndSystem",
"imsx_codeMinorFieldValue": "invaliddata"
}
]
},
"imsx_error_details": [
{}
]
}{
"imsx_codeMajor": "failure",
"imsx_severity": "error",
"imsx_description": "<string>",
"imsx_CodeMinor": {
"imsx_codeMinorField": [
{
"imsx_codeMinorFieldName": "TargetEndSystem",
"imsx_codeMinorFieldValue": "server_busy"
}
]
},
"imsx_error_details": [
{}
]
}{
"imsx_codeMajor": "failure",
"imsx_severity": "error",
"imsx_description": "<string>",
"imsx_CodeMinor": {
"imsx_codeMinorField": [
{
"imsx_codeMinorFieldName": "TargetEndSystem",
"imsx_codeMinorFieldValue": "internal_server_error"
}
]
},
"imsx_error_details": [
{}
]
}Classes Management
Update a Class
To update an existing Class. The sourcedId for the record to be updated is supplied by the requesting system.
PUT
/
ims
/
oneroster
/
rostering
/
v1p2
/
classes
/
{sourcedId}
Update a Class
curl --request PUT \
--url https://api.alpha-1edtech.ai/ims/oneroster/rostering/v1p2/classes/{sourcedId} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"class": {
"metadata": {},
"title": "<string>",
"classCode": "<string>",
"location": "<string>",
"grades": [],
"subjects": [],
"subjectCodes": [
"<string>"
],
"periods": [
"<string>"
],
"resources": [
{
"sourcedId": "<string>"
}
],
"terms": [
{
"sourcedId": "<string>"
}
]
}
}
'import requests
url = "https://api.alpha-1edtech.ai/ims/oneroster/rostering/v1p2/classes/{sourcedId}"
payload = { "class": {
"metadata": {},
"title": "<string>",
"classCode": "<string>",
"location": "<string>",
"grades": [],
"subjects": [],
"subjectCodes": ["<string>"],
"periods": ["<string>"],
"resources": [{ "sourcedId": "<string>" }],
"terms": [{ "sourcedId": "<string>" }]
} }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
class: {
metadata: {},
title: '<string>',
classCode: '<string>',
location: '<string>',
grades: [],
subjects: [],
subjectCodes: ['<string>'],
periods: ['<string>'],
resources: [{sourcedId: '<string>'}],
terms: [{sourcedId: '<string>'}]
}
})
};
fetch('https://api.alpha-1edtech.ai/ims/oneroster/rostering/v1p2/classes/{sourcedId}', 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.alpha-1edtech.ai/ims/oneroster/rostering/v1p2/classes/{sourcedId}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'class' => [
'metadata' => [
],
'title' => '<string>',
'classCode' => '<string>',
'location' => '<string>',
'grades' => [
],
'subjects' => [
],
'subjectCodes' => [
'<string>'
],
'periods' => [
'<string>'
],
'resources' => [
[
'sourcedId' => '<string>'
]
],
'terms' => [
[
'sourcedId' => '<string>'
]
]
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"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.alpha-1edtech.ai/ims/oneroster/rostering/v1p2/classes/{sourcedId}"
payload := strings.NewReader("{\n \"class\": {\n \"metadata\": {},\n \"title\": \"<string>\",\n \"classCode\": \"<string>\",\n \"location\": \"<string>\",\n \"grades\": [],\n \"subjects\": [],\n \"subjectCodes\": [\n \"<string>\"\n ],\n \"periods\": [\n \"<string>\"\n ],\n \"resources\": [\n {\n \"sourcedId\": \"<string>\"\n }\n ],\n \"terms\": [\n {\n \"sourcedId\": \"<string>\"\n }\n ]\n }\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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.put("https://api.alpha-1edtech.ai/ims/oneroster/rostering/v1p2/classes/{sourcedId}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"class\": {\n \"metadata\": {},\n \"title\": \"<string>\",\n \"classCode\": \"<string>\",\n \"location\": \"<string>\",\n \"grades\": [],\n \"subjects\": [],\n \"subjectCodes\": [\n \"<string>\"\n ],\n \"periods\": [\n \"<string>\"\n ],\n \"resources\": [\n {\n \"sourcedId\": \"<string>\"\n }\n ],\n \"terms\": [\n {\n \"sourcedId\": \"<string>\"\n }\n ]\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.alpha-1edtech.ai/ims/oneroster/rostering/v1p2/classes/{sourcedId}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"class\": {\n \"metadata\": {},\n \"title\": \"<string>\",\n \"classCode\": \"<string>\",\n \"location\": \"<string>\",\n \"grades\": [],\n \"subjects\": [],\n \"subjectCodes\": [\n \"<string>\"\n ],\n \"periods\": [\n \"<string>\"\n ],\n \"resources\": [\n {\n \"sourcedId\": \"<string>\"\n }\n ],\n \"terms\": [\n {\n \"sourcedId\": \"<string>\"\n }\n ]\n }\n}"
response = http.request(request)
puts response.read_body{
"sourcedId": "<string>",
"title": "<string>",
"classCode": "<string>",
"location": "<string>",
"course": {
"href": "<string>",
"sourcedId": "<string>",
"type": "<string>"
},
"school": {
"href": "<string>",
"sourcedId": "<string>",
"type": "<string>"
},
"terms": [
{
"href": "<string>",
"sourcedId": "<string>",
"type": "<string>"
}
],
"dateLastModified": "2023-11-07T05:31:56Z",
"metadata": {},
"grades": [
"3"
],
"subjects": [],
"subjectCodes": [
"<string>"
],
"periods": [
"<string>"
],
"resources": [
{
"href": "<string>",
"sourcedId": "<string>",
"type": "<string>"
}
]
}{
"imsx_codeMajor": "failure",
"imsx_severity": "error",
"imsx_description": "<string>",
"imsx_CodeMinor": {
"imsx_codeMinorField": [
{
"imsx_codeMinorFieldName": "TargetEndSystem",
"imsx_codeMinorFieldValue": "invaliddata"
}
]
},
"imsx_error_details": [
{}
]
}{
"imsx_codeMajor": "failure",
"imsx_severity": "error",
"imsx_description": "<string>",
"imsx_CodeMinor": {
"imsx_codeMinorField": [
{
"imsx_codeMinorFieldName": "TargetEndSystem",
"imsx_codeMinorFieldValue": "unauthorisedrequest"
}
]
},
"imsx_error_details": [
{}
]
}{
"imsx_codeMajor": "failure",
"imsx_severity": "error",
"imsx_description": "<string>",
"imsx_CodeMinor": {
"imsx_codeMinorField": [
{
"imsx_codeMinorFieldName": "TargetEndSystem",
"imsx_codeMinorFieldValue": "forbidden"
}
]
},
"imsx_error_details": [
{}
]
}{
"imsx_codeMajor": "failure",
"imsx_severity": "error",
"imsx_description": "<string>",
"imsx_CodeMinor": {
"imsx_codeMinorField": [
{
"imsx_codeMinorFieldName": "TargetEndSystem",
"imsx_codeMinorFieldValue": "unknownobject"
}
]
},
"imsx_error_details": [
{}
]
}{
"imsx_codeMajor": "failure",
"imsx_severity": "error",
"imsx_description": "<string>",
"imsx_CodeMinor": {
"imsx_codeMinorField": [
{
"imsx_codeMinorFieldName": "TargetEndSystem",
"imsx_codeMinorFieldValue": "invaliddata"
}
]
},
"imsx_error_details": [
{}
]
}{
"imsx_codeMajor": "failure",
"imsx_severity": "error",
"imsx_description": "<string>",
"imsx_CodeMinor": {
"imsx_codeMinorField": [
{
"imsx_codeMinorFieldName": "TargetEndSystem",
"imsx_codeMinorFieldValue": "server_busy"
}
]
},
"imsx_error_details": [
{}
]
}{
"imsx_codeMajor": "failure",
"imsx_severity": "error",
"imsx_description": "<string>",
"imsx_CodeMinor": {
"imsx_codeMinorField": [
{
"imsx_codeMinorFieldName": "TargetEndSystem",
"imsx_codeMinorFieldValue": "internal_server_error"
}
]
},
"imsx_error_details": [
{}
]
}Authorizations
The access token received from the authorization server in the OAuth 2.0 flow.
Path Parameters
Class sourcedId
Body
application/json
Show child attributes
Show child attributes
Response
Class successfully updated
Represents a class.
Available options:
active, tobedeleted Available options:
homeroom, scheduled Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Additional metadata for the object
The grades of the course
Available options:
-1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13 The subjects of the course
Available options:
Reading, Language, Vocabulary, Social Studies, Writing, Science, FastMath, Math, None, Other Show child attributes
Show child attributes
⌘I