curl --request PATCH \
--url https://schoolmaker.co/api/v1/sections/{id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"description": "<string>",
"drip_delay": 16383,
"position": 1,
"section_group_position": 2,
"is_published": true,
"section_group_id": "<string>",
"product_id": "<string>"
}
'import requests
url = "https://schoolmaker.co/api/v1/sections/{id}"
payload = {
"name": "<string>",
"description": "<string>",
"drip_delay": 16383,
"position": 1,
"section_group_position": 2,
"is_published": True,
"section_group_id": "<string>",
"product_id": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: '<string>',
description: '<string>',
drip_delay: 16383,
position: 1,
section_group_position: 2,
is_published: true,
section_group_id: '<string>',
product_id: '<string>'
})
};
fetch('https://schoolmaker.co/api/v1/sections/{id}', 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://schoolmaker.co/api/v1/sections/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'name' => '<string>',
'description' => '<string>',
'drip_delay' => 16383,
'position' => 1,
'section_group_position' => 2,
'is_published' => true,
'section_group_id' => '<string>',
'product_id' => '<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://schoolmaker.co/api/v1/sections/{id}"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"drip_delay\": 16383,\n \"position\": 1,\n \"section_group_position\": 2,\n \"is_published\": true,\n \"section_group_id\": \"<string>\",\n \"product_id\": \"<string>\"\n}")
req, _ := http.NewRequest("PATCH", 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.patch("https://schoolmaker.co/api/v1/sections/{id}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"drip_delay\": 16383,\n \"position\": 1,\n \"section_group_position\": 2,\n \"is_published\": true,\n \"section_group_id\": \"<string>\",\n \"product_id\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://schoolmaker.co/api/v1/sections/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"drip_delay\": 16383,\n \"position\": 1,\n \"section_group_position\": 2,\n \"is_published\": true,\n \"section_group_id\": \"<string>\",\n \"product_id\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"id": "SECTION_ID",
"product_id": "PROGRAM_ID",
"section_group_id": "GROUP_ID",
"section_group_position": 1,
"name": "Introduction",
"description": "Start here",
"position": 1,
"drip_delay": 0,
"is_published": false,
"image_cover_url": null
}{
"error": "Access denied"
}{
"error": "You do not have permission to perform this action"
}{
"error": "Record not found"
}{
"error": "Invalid arguments"
}{
"error": "Too many requests"
}Set Section Details
Updates a section’s details, program or group. Omitted fields remain unchanged.
curl --request PATCH \
--url https://schoolmaker.co/api/v1/sections/{id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"description": "<string>",
"drip_delay": 16383,
"position": 1,
"section_group_position": 2,
"is_published": true,
"section_group_id": "<string>",
"product_id": "<string>"
}
'import requests
url = "https://schoolmaker.co/api/v1/sections/{id}"
payload = {
"name": "<string>",
"description": "<string>",
"drip_delay": 16383,
"position": 1,
"section_group_position": 2,
"is_published": True,
"section_group_id": "<string>",
"product_id": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: '<string>',
description: '<string>',
drip_delay: 16383,
position: 1,
section_group_position: 2,
is_published: true,
section_group_id: '<string>',
product_id: '<string>'
})
};
fetch('https://schoolmaker.co/api/v1/sections/{id}', 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://schoolmaker.co/api/v1/sections/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'name' => '<string>',
'description' => '<string>',
'drip_delay' => 16383,
'position' => 1,
'section_group_position' => 2,
'is_published' => true,
'section_group_id' => '<string>',
'product_id' => '<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://schoolmaker.co/api/v1/sections/{id}"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"drip_delay\": 16383,\n \"position\": 1,\n \"section_group_position\": 2,\n \"is_published\": true,\n \"section_group_id\": \"<string>\",\n \"product_id\": \"<string>\"\n}")
req, _ := http.NewRequest("PATCH", 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.patch("https://schoolmaker.co/api/v1/sections/{id}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"drip_delay\": 16383,\n \"position\": 1,\n \"section_group_position\": 2,\n \"is_published\": true,\n \"section_group_id\": \"<string>\",\n \"product_id\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://schoolmaker.co/api/v1/sections/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"drip_delay\": 16383,\n \"position\": 1,\n \"section_group_position\": 2,\n \"is_published\": true,\n \"section_group_id\": \"<string>\",\n \"product_id\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"id": "SECTION_ID",
"product_id": "PROGRAM_ID",
"section_group_id": "GROUP_ID",
"section_group_position": 1,
"name": "Introduction",
"description": "Start here",
"position": 1,
"drip_delay": 0,
"is_published": false,
"image_cover_url": null
}{
"error": "Access denied"
}{
"error": "You do not have permission to perform this action"
}{
"error": "Record not found"
}{
"error": "Invalid arguments"
}{
"error": "Too many requests"
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Path Parameters
Body
Section title. Required on creation and cannot be blank or null. Maximum 255 characters.
1 - 255Section description. Maximum 200000 characters. Empty by default. Send null to clear it.
200000Delay in days before the section becomes available, from 0 to 32767. Uses the member program drip start or earliest offer access, adjusted by their drip boost. Defaults to 0. Null is accepted only on creation.
0 <= x <= 32767Position within the program, starting at 1. Defaults to the end. Moving a section shifts the other sections. Send null to clear its position. Group order is set separately with section_group_position.
x >= 0Position within the selected group, starting at 1. Defaults to the end when creating a section or changing groups. Must fit the number of sections in the group. Null is not accepted.
x >= 1Whether the section is published. Defaults to true, including in a draft program. Send false to create a draft section. Null is accepted only on creation.
Group ID within the selected program. Defaults to the last group when creating a section or moving it to another program. Send null on update to remove the group. Changing groups places the section at the end of the new group.
255Parent program ID. Required on creation. Changing it moves the section and its lessons. You need edit access to both programs. Without section_group_id, a move uses the destination program's last group.
1 - 255Was this page helpful?