Create Classroom
curl --request POST \
--url https://api.example.com/v1/classrooms \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"subject_id": "<string>",
"period_price_cents": 123,
"join_fee_cents": 123,
"billing_anchor_date": "<string>"
}
'import requests
url = "https://api.example.com/v1/classrooms"
payload = {
"name": "<string>",
"subject_id": "<string>",
"period_price_cents": 123,
"join_fee_cents": 123,
"billing_anchor_date": "<string>"
}
headers = {
"Authorization": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: '<string>',
subject_id: '<string>',
period_price_cents: 123,
join_fee_cents: 123,
billing_anchor_date: '<string>'
})
};
fetch('https://api.example.com/v1/classrooms', 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.example.com/v1/classrooms",
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([
'name' => '<string>',
'subject_id' => '<string>',
'period_price_cents' => 123,
'join_fee_cents' => 123,
'billing_anchor_date' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>",
"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.example.com/v1/classrooms"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"subject_id\": \"<string>\",\n \"period_price_cents\": 123,\n \"join_fee_cents\": 123,\n \"billing_anchor_date\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "<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://api.example.com/v1/classrooms")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"subject_id\": \"<string>\",\n \"period_price_cents\": 123,\n \"join_fee_cents\": 123,\n \"billing_anchor_date\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/v1/classrooms")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"<string>\",\n \"subject_id\": \"<string>\",\n \"period_price_cents\": 123,\n \"join_fee_cents\": 123,\n \"billing_anchor_date\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"name": "<string>",
"tutor_id": "<string>",
"subject_id": "<string>",
"join_code": "<string>",
"period_price_cents": 123,
"join_fee_cents": 123,
"billing_interval": "<string>",
"billing_anchor_date": "<string>",
"group_id": "<string>",
"created_at": "<string>",
"updated_at": "<string>"
}{
"error": {
"code": "not_found",
"message": "Session not found",
"status": 404,
"details": {}
}
}{
"error": {
"code": "not_found",
"message": "Session not found",
"status": 404,
"details": {}
}
}{
"error": {
"code": "not_found",
"message": "Session not found",
"status": 404,
"details": {}
}
}{
"error": {
"code": "not_found",
"message": "Session not found",
"status": 404,
"details": {}
}
}Curriculum
Create Classroom
Create a classroom scoped to this org. The org owner is set as the tutor (owner-as-merchant model).
Returns 422 with a reason field on validation failure. Honours Idempotency-Key.
POST
/
v1
/
classrooms
Create Classroom
curl --request POST \
--url https://api.example.com/v1/classrooms \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"subject_id": "<string>",
"period_price_cents": 123,
"join_fee_cents": 123,
"billing_anchor_date": "<string>"
}
'import requests
url = "https://api.example.com/v1/classrooms"
payload = {
"name": "<string>",
"subject_id": "<string>",
"period_price_cents": 123,
"join_fee_cents": 123,
"billing_anchor_date": "<string>"
}
headers = {
"Authorization": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: '<string>',
subject_id: '<string>',
period_price_cents: 123,
join_fee_cents: 123,
billing_anchor_date: '<string>'
})
};
fetch('https://api.example.com/v1/classrooms', 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.example.com/v1/classrooms",
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([
'name' => '<string>',
'subject_id' => '<string>',
'period_price_cents' => 123,
'join_fee_cents' => 123,
'billing_anchor_date' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>",
"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.example.com/v1/classrooms"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"subject_id\": \"<string>\",\n \"period_price_cents\": 123,\n \"join_fee_cents\": 123,\n \"billing_anchor_date\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "<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://api.example.com/v1/classrooms")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"subject_id\": \"<string>\",\n \"period_price_cents\": 123,\n \"join_fee_cents\": 123,\n \"billing_anchor_date\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/v1/classrooms")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"<string>\",\n \"subject_id\": \"<string>\",\n \"period_price_cents\": 123,\n \"join_fee_cents\": 123,\n \"billing_anchor_date\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"name": "<string>",
"tutor_id": "<string>",
"subject_id": "<string>",
"join_code": "<string>",
"period_price_cents": 123,
"join_fee_cents": 123,
"billing_interval": "<string>",
"billing_anchor_date": "<string>",
"group_id": "<string>",
"created_at": "<string>",
"updated_at": "<string>"
}{
"error": {
"code": "not_found",
"message": "Session not found",
"status": 404,
"details": {}
}
}{
"error": {
"code": "not_found",
"message": "Session not found",
"status": 404,
"details": {}
}
}{
"error": {
"code": "not_found",
"message": "Session not found",
"status": 404,
"details": {}
}
}{
"error": {
"code": "not_found",
"message": "Session not found",
"status": 404,
"details": {}
}
}Authorizations
Org API key as Token token=ei_live_...
Headers
Body
application/json
Response
Successful Response
Was this page helpful?