Duplicate a Program
curl --request POST \
--url https://schoolmaker.co/api/v1/products/{id}/duplicate \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"idempotency_key": "<string>"
}
'import requests
url = "https://schoolmaker.co/api/v1/products/{id}/duplicate"
payload = {
"name": "<string>",
"idempotency_key": "<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>'})
};
fetch('https://schoolmaker.co/api/v1/products/{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/products/{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>'
]),
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/products/{id}/duplicate"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"idempotency_key\": \"<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/products/{id}/duplicate")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"idempotency_key\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://schoolmaker.co/api/v1/products/{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}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"operation": "<string>",
"status": "pending",
"result": {
"name": "<string>",
"description": "<string>",
"is_published": true,
"is_default_granularity_access_enabled": true,
"settings_store_url": "<string>",
"settings_show_member_count": true,
"settings_is_certificate_enabled": true,
"settings_is_milestone_display_enabled": true,
"settings_is_coaching_disabled": true,
"settings_is_section_groups_enabled": true,
"is_secret": true,
"questions_category_id": "<string>",
"questions_category_type": "<string>",
"settings_is_inline_questions_category": true,
"settings_is_questions_disabled": true,
"default_reviewer_ids": [
"<string>"
],
"id": "<string>",
"section_groups": [
{
"id": "<string>",
"name": "<string>",
"position": 123
}
],
"image_logo_url": "<string>",
"image_cover_url": "<string>"
},
"error": "<string>"
}{
"id": "OPERATION_ID",
"operation": "duplicate_program",
"status": "pending",
"result": null,
"error": null
}{
"error": "Access denied"
}{
"error": "Forbidden"
}{
"error": "Record not found"
}{
"error": "Validation failed"
}Programs
Duplicate a Program
Duplicates a program without members and leaves the copy unpublished. Returns a background operation. Check its status until completed or failed.
POST
/
products
/
{id}
/
duplicate
Duplicate a Program
curl --request POST \
--url https://schoolmaker.co/api/v1/products/{id}/duplicate \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"idempotency_key": "<string>"
}
'import requests
url = "https://schoolmaker.co/api/v1/products/{id}/duplicate"
payload = {
"name": "<string>",
"idempotency_key": "<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>'})
};
fetch('https://schoolmaker.co/api/v1/products/{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/products/{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>'
]),
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/products/{id}/duplicate"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"idempotency_key\": \"<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/products/{id}/duplicate")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"idempotency_key\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://schoolmaker.co/api/v1/products/{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}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"operation": "<string>",
"status": "pending",
"result": {
"name": "<string>",
"description": "<string>",
"is_published": true,
"is_default_granularity_access_enabled": true,
"settings_store_url": "<string>",
"settings_show_member_count": true,
"settings_is_certificate_enabled": true,
"settings_is_milestone_display_enabled": true,
"settings_is_coaching_disabled": true,
"settings_is_section_groups_enabled": true,
"is_secret": true,
"questions_category_id": "<string>",
"questions_category_type": "<string>",
"settings_is_inline_questions_category": true,
"settings_is_questions_disabled": true,
"default_reviewer_ids": [
"<string>"
],
"id": "<string>",
"section_groups": [
{
"id": "<string>",
"name": "<string>",
"position": 123
}
],
"image_logo_url": "<string>",
"image_cover_url": "<string>"
},
"error": "<string>"
}{
"id": "OPERATION_ID",
"operation": "duplicate_program",
"status": "pending",
"result": null,
"error": null
}{
"error": "Access denied"
}{
"error": "Forbidden"
}{
"error": "Record not found"
}{
"error": "Validation failed"
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Path Parameters
Program ID.
Body
application/jsonapplication/x-www-form-urlencoded
Name of the copy, up to 255 characters. If omitted or empty, uses the original name with the translated Copy of prefix; the resulting name must fit this limit.
Maximum string length:
10000Reuse the same key with identical request details to return the existing operation. Different request details with the same key return HTTP 422.
Required string length:
1 - 255Was this page helpful?