curl --request POST \
--url https://schoolmaker.co/api/v1/sections/{id}/duplicate \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"idempotency_key": "<string>",
"destination_program_id": "<string>",
"destination_section_group_id": "<string>"
}
'import requests
url = "https://schoolmaker.co/api/v1/sections/{id}/duplicate"
payload = {
"name": "<string>",
"idempotency_key": "<string>",
"destination_program_id": "<string>",
"destination_section_group_id": "<string>"
}
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({
name: '<string>',
idempotency_key: '<string>',
destination_program_id: '<string>',
destination_section_group_id: '<string>'
})
};
fetch('https://schoolmaker.co/api/v1/sections/{id}/duplicate', 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}/duplicate",
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>',
'idempotency_key' => '<string>',
'destination_program_id' => '<string>',
'destination_section_group_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}/duplicate"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"idempotency_key\": \"<string>\",\n \"destination_program_id\": \"<string>\",\n \"destination_section_group_id\": \"<string>\"\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://schoolmaker.co/api/v1/sections/{id}/duplicate")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"idempotency_key\": \"<string>\",\n \"destination_program_id\": \"<string>\",\n \"destination_section_group_id\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://schoolmaker.co/api/v1/sections/{id}/duplicate")
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 \"name\": \"<string>\",\n \"idempotency_key\": \"<string>\",\n \"destination_program_id\": \"<string>\",\n \"destination_section_group_id\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"id": "OPERATION_ID",
"operation": "duplicate_section",
"status": "completed",
"result": {
"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": null
}{
"id": "OPERATION_ID",
"operation": "duplicate_section",
"status": "pending",
"result": null,
"error": 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"
}Duplicate a Section
Duplicates a section and its lessons in the selected program. The copied section and lessons are unpublished. Returns a background operation. Check its status until completed or failed.
curl --request POST \
--url https://schoolmaker.co/api/v1/sections/{id}/duplicate \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"idempotency_key": "<string>",
"destination_program_id": "<string>",
"destination_section_group_id": "<string>"
}
'import requests
url = "https://schoolmaker.co/api/v1/sections/{id}/duplicate"
payload = {
"name": "<string>",
"idempotency_key": "<string>",
"destination_program_id": "<string>",
"destination_section_group_id": "<string>"
}
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({
name: '<string>',
idempotency_key: '<string>',
destination_program_id: '<string>',
destination_section_group_id: '<string>'
})
};
fetch('https://schoolmaker.co/api/v1/sections/{id}/duplicate', 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}/duplicate",
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>',
'idempotency_key' => '<string>',
'destination_program_id' => '<string>',
'destination_section_group_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}/duplicate"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"idempotency_key\": \"<string>\",\n \"destination_program_id\": \"<string>\",\n \"destination_section_group_id\": \"<string>\"\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://schoolmaker.co/api/v1/sections/{id}/duplicate")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"idempotency_key\": \"<string>\",\n \"destination_program_id\": \"<string>\",\n \"destination_section_group_id\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://schoolmaker.co/api/v1/sections/{id}/duplicate")
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 \"name\": \"<string>\",\n \"idempotency_key\": \"<string>\",\n \"destination_program_id\": \"<string>\",\n \"destination_section_group_id\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"id": "OPERATION_ID",
"operation": "duplicate_section",
"status": "completed",
"result": {
"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": null
}{
"id": "OPERATION_ID",
"operation": "duplicate_section",
"status": "pending",
"result": null,
"error": 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
Name of the copy, up to 255 characters. Omitted or empty uses Copy of followed by the original name, in the school language. The complete name must fit the limit.
255Reuse the same key with identical request details to return the existing operation. Different request details with the same key return HTTP 422.
1 - 255Destination program ID. Defaults to the source program. You need edit access to both programs.
1 - 255Group ID within the destination program. Defaults to that program's last group.
1 - 255Was this page helpful?