Enroll user in a course
curl --request POST \
--url https://api.alpha-1edtech.ai/edubridge/enrollments/enroll/{userId}/{courseId}/{schoolId} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"sourcedId": "<string>",
"role": "student",
"beginDate": "2023-11-07T05:31:56Z",
"metadata": {
"goals": {
"dailyXp": 123,
"dailyLessons": 123,
"dailyActiveMinutes": 123,
"dailyAccuracy": 123,
"dailyMasteredUnits": 123
},
"metrics": {
"totalXp": 123,
"totalLessons": 123,
"totalGrades": 123,
"courseType": "<string>",
"isSupplemental": true
}
}
}
'import requests
url = "https://api.alpha-1edtech.ai/edubridge/enrollments/enroll/{userId}/{courseId}/{schoolId}"
payload = {
"sourcedId": "<string>",
"role": "student",
"beginDate": "2023-11-07T05:31:56Z",
"metadata": {
"goals": {
"dailyXp": 123,
"dailyLessons": 123,
"dailyActiveMinutes": 123,
"dailyAccuracy": 123,
"dailyMasteredUnits": 123
},
"metrics": {
"totalXp": 123,
"totalLessons": 123,
"totalGrades": 123,
"courseType": "<string>",
"isSupplemental": True
}
}
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
sourcedId: '<string>',
role: 'student',
beginDate: '2023-11-07T05:31:56Z',
metadata: {
goals: {
dailyXp: 123,
dailyLessons: 123,
dailyActiveMinutes: 123,
dailyAccuracy: 123,
dailyMasteredUnits: 123
},
metrics: {
totalXp: 123,
totalLessons: 123,
totalGrades: 123,
courseType: '<string>',
isSupplemental: true
}
}
})
};
fetch('https://api.alpha-1edtech.ai/edubridge/enrollments/enroll/{userId}/{courseId}/{schoolId}', 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/edubridge/enrollments/enroll/{userId}/{courseId}/{schoolId}",
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([
'sourcedId' => '<string>',
'role' => 'student',
'beginDate' => '2023-11-07T05:31:56Z',
'metadata' => [
'goals' => [
'dailyXp' => 123,
'dailyLessons' => 123,
'dailyActiveMinutes' => 123,
'dailyAccuracy' => 123,
'dailyMasteredUnits' => 123
],
'metrics' => [
'totalXp' => 123,
'totalLessons' => 123,
'totalGrades' => 123,
'courseType' => '<string>',
'isSupplemental' => true
]
]
]),
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/edubridge/enrollments/enroll/{userId}/{courseId}/{schoolId}"
payload := strings.NewReader("{\n \"sourcedId\": \"<string>\",\n \"role\": \"student\",\n \"beginDate\": \"2023-11-07T05:31:56Z\",\n \"metadata\": {\n \"goals\": {\n \"dailyXp\": 123,\n \"dailyLessons\": 123,\n \"dailyActiveMinutes\": 123,\n \"dailyAccuracy\": 123,\n \"dailyMasteredUnits\": 123\n },\n \"metrics\": {\n \"totalXp\": 123,\n \"totalLessons\": 123,\n \"totalGrades\": 123,\n \"courseType\": \"<string>\",\n \"isSupplemental\": true\n }\n }\n}")
req, _ := http.NewRequest("POST", 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.post("https://api.alpha-1edtech.ai/edubridge/enrollments/enroll/{userId}/{courseId}/{schoolId}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"sourcedId\": \"<string>\",\n \"role\": \"student\",\n \"beginDate\": \"2023-11-07T05:31:56Z\",\n \"metadata\": {\n \"goals\": {\n \"dailyXp\": 123,\n \"dailyLessons\": 123,\n \"dailyActiveMinutes\": 123,\n \"dailyAccuracy\": 123,\n \"dailyMasteredUnits\": 123\n },\n \"metrics\": {\n \"totalXp\": 123,\n \"totalLessons\": 123,\n \"totalGrades\": 123,\n \"courseType\": \"<string>\",\n \"isSupplemental\": true\n }\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.alpha-1edtech.ai/edubridge/enrollments/enroll/{userId}/{courseId}/{schoolId}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"sourcedId\": \"<string>\",\n \"role\": \"student\",\n \"beginDate\": \"2023-11-07T05:31:56Z\",\n \"metadata\": {\n \"goals\": {\n \"dailyXp\": 123,\n \"dailyLessons\": 123,\n \"dailyActiveMinutes\": 123,\n \"dailyAccuracy\": 123,\n \"dailyMasteredUnits\": 123\n },\n \"metrics\": {\n \"totalXp\": 123,\n \"totalLessons\": 123,\n \"totalGrades\": 123,\n \"courseType\": \"<string>\",\n \"isSupplemental\": true\n }\n }\n}"
response = http.request(request)
puts response.read_body{
"data": {
"id": "123",
"beginDate": "<string>",
"endDate": "<string>",
"course": {
"id": "<string>",
"title": "<string>",
"metadata": {},
"subjects": [
"<string>"
],
"grades": [
"<string>"
],
"primaryApp": {
"id": "<string>",
"name": "<string>",
"domains": [
"<string>"
]
}
},
"school": {
"id": "<string>",
"name": "<string>"
},
"testOutSupported": true,
"testOutEligible": true,
"metadata": {
"goals": {
"dailyXp": 123,
"dailyLessons": 123,
"dailyActiveMinutes": 123,
"dailyAccuracy": 123,
"dailyMasteredUnits": 123
},
"metrics": {
"totalXp": 123,
"totalLessons": 123,
"totalGrades": 123,
"courseType": "<string>",
"isSupplemental": true
}
}
}
}Enrollments
Enroll user in a course
Enrolls a user in a course with a single API call.
This endpoint handles all necessary background operations: locating or creating a default class for the course, establishing appropriate academic sessions (school year and term), and creating the enrollment record.
Consumers can simply specify the user, course, and role (default is ‘student’) without needing to understand or manage the underlying academic structure that OneRoster requires.
POST
/
edubridge
/
enrollments
/
enroll
/
{userId}
/
{courseId}
/
{schoolId}
?
Enroll user in a course
curl --request POST \
--url https://api.alpha-1edtech.ai/edubridge/enrollments/enroll/{userId}/{courseId}/{schoolId} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"sourcedId": "<string>",
"role": "student",
"beginDate": "2023-11-07T05:31:56Z",
"metadata": {
"goals": {
"dailyXp": 123,
"dailyLessons": 123,
"dailyActiveMinutes": 123,
"dailyAccuracy": 123,
"dailyMasteredUnits": 123
},
"metrics": {
"totalXp": 123,
"totalLessons": 123,
"totalGrades": 123,
"courseType": "<string>",
"isSupplemental": true
}
}
}
'import requests
url = "https://api.alpha-1edtech.ai/edubridge/enrollments/enroll/{userId}/{courseId}/{schoolId}"
payload = {
"sourcedId": "<string>",
"role": "student",
"beginDate": "2023-11-07T05:31:56Z",
"metadata": {
"goals": {
"dailyXp": 123,
"dailyLessons": 123,
"dailyActiveMinutes": 123,
"dailyAccuracy": 123,
"dailyMasteredUnits": 123
},
"metrics": {
"totalXp": 123,
"totalLessons": 123,
"totalGrades": 123,
"courseType": "<string>",
"isSupplemental": True
}
}
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
sourcedId: '<string>',
role: 'student',
beginDate: '2023-11-07T05:31:56Z',
metadata: {
goals: {
dailyXp: 123,
dailyLessons: 123,
dailyActiveMinutes: 123,
dailyAccuracy: 123,
dailyMasteredUnits: 123
},
metrics: {
totalXp: 123,
totalLessons: 123,
totalGrades: 123,
courseType: '<string>',
isSupplemental: true
}
}
})
};
fetch('https://api.alpha-1edtech.ai/edubridge/enrollments/enroll/{userId}/{courseId}/{schoolId}', 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/edubridge/enrollments/enroll/{userId}/{courseId}/{schoolId}",
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([
'sourcedId' => '<string>',
'role' => 'student',
'beginDate' => '2023-11-07T05:31:56Z',
'metadata' => [
'goals' => [
'dailyXp' => 123,
'dailyLessons' => 123,
'dailyActiveMinutes' => 123,
'dailyAccuracy' => 123,
'dailyMasteredUnits' => 123
],
'metrics' => [
'totalXp' => 123,
'totalLessons' => 123,
'totalGrades' => 123,
'courseType' => '<string>',
'isSupplemental' => true
]
]
]),
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/edubridge/enrollments/enroll/{userId}/{courseId}/{schoolId}"
payload := strings.NewReader("{\n \"sourcedId\": \"<string>\",\n \"role\": \"student\",\n \"beginDate\": \"2023-11-07T05:31:56Z\",\n \"metadata\": {\n \"goals\": {\n \"dailyXp\": 123,\n \"dailyLessons\": 123,\n \"dailyActiveMinutes\": 123,\n \"dailyAccuracy\": 123,\n \"dailyMasteredUnits\": 123\n },\n \"metrics\": {\n \"totalXp\": 123,\n \"totalLessons\": 123,\n \"totalGrades\": 123,\n \"courseType\": \"<string>\",\n \"isSupplemental\": true\n }\n }\n}")
req, _ := http.NewRequest("POST", 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.post("https://api.alpha-1edtech.ai/edubridge/enrollments/enroll/{userId}/{courseId}/{schoolId}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"sourcedId\": \"<string>\",\n \"role\": \"student\",\n \"beginDate\": \"2023-11-07T05:31:56Z\",\n \"metadata\": {\n \"goals\": {\n \"dailyXp\": 123,\n \"dailyLessons\": 123,\n \"dailyActiveMinutes\": 123,\n \"dailyAccuracy\": 123,\n \"dailyMasteredUnits\": 123\n },\n \"metrics\": {\n \"totalXp\": 123,\n \"totalLessons\": 123,\n \"totalGrades\": 123,\n \"courseType\": \"<string>\",\n \"isSupplemental\": true\n }\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.alpha-1edtech.ai/edubridge/enrollments/enroll/{userId}/{courseId}/{schoolId}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"sourcedId\": \"<string>\",\n \"role\": \"student\",\n \"beginDate\": \"2023-11-07T05:31:56Z\",\n \"metadata\": {\n \"goals\": {\n \"dailyXp\": 123,\n \"dailyLessons\": 123,\n \"dailyActiveMinutes\": 123,\n \"dailyAccuracy\": 123,\n \"dailyMasteredUnits\": 123\n },\n \"metrics\": {\n \"totalXp\": 123,\n \"totalLessons\": 123,\n \"totalGrades\": 123,\n \"courseType\": \"<string>\",\n \"isSupplemental\": true\n }\n }\n}"
response = http.request(request)
puts response.read_body{
"data": {
"id": "123",
"beginDate": "<string>",
"endDate": "<string>",
"course": {
"id": "<string>",
"title": "<string>",
"metadata": {},
"subjects": [
"<string>"
],
"grades": [
"<string>"
],
"primaryApp": {
"id": "<string>",
"name": "<string>",
"domains": [
"<string>"
]
}
},
"school": {
"id": "<string>",
"name": "<string>"
},
"testOutSupported": true,
"testOutEligible": true,
"metadata": {
"goals": {
"dailyXp": 123,
"dailyLessons": 123,
"dailyActiveMinutes": 123,
"dailyAccuracy": 123,
"dailyMasteredUnits": 123
},
"metrics": {
"totalXp": 123,
"totalLessons": 123,
"totalGrades": 123,
"courseType": "<string>",
"isSupplemental": true
}
}
}
}Authorizations
The access token received from the authorization server in the OAuth 2.0 flow.
Path Parameters
The unique identifier for the user
The unique identifier for the course
The unique identifier for the school
Body
application/json
Response
201 - application/json
Successful response
Show child attributes
Show child attributes
⌘I