curl --request POST \
--url https://api.utage-system.com/v1/members/{site_id}/courses/{course_id}/lessons \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"lesson_group_id": "<string>",
"elements": [
{
"type": "<string>",
"element_id": 123,
"children": [
{}
]
}
],
"type": "html",
"is_published": false,
"show_title": true,
"width": 123,
"background_color": "<string>",
"use_comment": false,
"is_comment_override": false,
"comment_text": "<string>",
"comment_show_type": "all",
"hide_comment_posted_at": false,
"comment_default_value": "<string>",
"has_target_persons": false,
"target_persons_date_from": "2023-12-25",
"target_persons_date_to": "2023-12-25",
"release_type": "immediately",
"release_day": 4999,
"release_month": 4999,
"release_date": "2023-12-25",
"release_hour": 11,
"action_before_release": "show",
"js_head": "<string>",
"js_body_top": "<string>",
"js_body": "<string>",
"css": "<string>"
}
'import requests
url = "https://api.utage-system.com/v1/members/{site_id}/courses/{course_id}/lessons"
payload = {
"name": "<string>",
"lesson_group_id": "<string>",
"elements": [
{
"type": "<string>",
"element_id": 123,
"children": [{}]
}
],
"type": "html",
"is_published": False,
"show_title": True,
"width": 123,
"background_color": "<string>",
"use_comment": False,
"is_comment_override": False,
"comment_text": "<string>",
"comment_show_type": "all",
"hide_comment_posted_at": False,
"comment_default_value": "<string>",
"has_target_persons": False,
"target_persons_date_from": "2023-12-25",
"target_persons_date_to": "2023-12-25",
"release_type": "immediately",
"release_day": 4999,
"release_month": 4999,
"release_date": "2023-12-25",
"release_hour": 11,
"action_before_release": "show",
"js_head": "<string>",
"js_body_top": "<string>",
"js_body": "<string>",
"css": "<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>',
lesson_group_id: '<string>',
elements: [{type: '<string>', element_id: 123, children: [{}]}],
type: 'html',
is_published: false,
show_title: true,
width: 123,
background_color: '<string>',
use_comment: false,
is_comment_override: false,
comment_text: '<string>',
comment_show_type: 'all',
hide_comment_posted_at: false,
comment_default_value: '<string>',
has_target_persons: false,
target_persons_date_from: '2023-12-25',
target_persons_date_to: '2023-12-25',
release_type: 'immediately',
release_day: 4999,
release_month: 4999,
release_date: '2023-12-25',
release_hour: 11,
action_before_release: 'show',
js_head: '<string>',
js_body_top: '<string>',
js_body: '<string>',
css: '<string>'
})
};
fetch('https://api.utage-system.com/v1/members/{site_id}/courses/{course_id}/lessons', 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.utage-system.com/v1/members/{site_id}/courses/{course_id}/lessons",
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>',
'lesson_group_id' => '<string>',
'elements' => [
[
'type' => '<string>',
'element_id' => 123,
'children' => [
[
]
]
]
],
'type' => 'html',
'is_published' => false,
'show_title' => true,
'width' => 123,
'background_color' => '<string>',
'use_comment' => false,
'is_comment_override' => false,
'comment_text' => '<string>',
'comment_show_type' => 'all',
'hide_comment_posted_at' => false,
'comment_default_value' => '<string>',
'has_target_persons' => false,
'target_persons_date_from' => '2023-12-25',
'target_persons_date_to' => '2023-12-25',
'release_type' => 'immediately',
'release_day' => 4999,
'release_month' => 4999,
'release_date' => '2023-12-25',
'release_hour' => 11,
'action_before_release' => 'show',
'js_head' => '<string>',
'js_body_top' => '<string>',
'js_body' => '<string>',
'css' => '<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://api.utage-system.com/v1/members/{site_id}/courses/{course_id}/lessons"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"lesson_group_id\": \"<string>\",\n \"elements\": [\n {\n \"type\": \"<string>\",\n \"element_id\": 123,\n \"children\": [\n {}\n ]\n }\n ],\n \"type\": \"html\",\n \"is_published\": false,\n \"show_title\": true,\n \"width\": 123,\n \"background_color\": \"<string>\",\n \"use_comment\": false,\n \"is_comment_override\": false,\n \"comment_text\": \"<string>\",\n \"comment_show_type\": \"all\",\n \"hide_comment_posted_at\": false,\n \"comment_default_value\": \"<string>\",\n \"has_target_persons\": false,\n \"target_persons_date_from\": \"2023-12-25\",\n \"target_persons_date_to\": \"2023-12-25\",\n \"release_type\": \"immediately\",\n \"release_day\": 4999,\n \"release_month\": 4999,\n \"release_date\": \"2023-12-25\",\n \"release_hour\": 11,\n \"action_before_release\": \"show\",\n \"js_head\": \"<string>\",\n \"js_body_top\": \"<string>\",\n \"js_body\": \"<string>\",\n \"css\": \"<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://api.utage-system.com/v1/members/{site_id}/courses/{course_id}/lessons")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"lesson_group_id\": \"<string>\",\n \"elements\": [\n {\n \"type\": \"<string>\",\n \"element_id\": 123,\n \"children\": [\n {}\n ]\n }\n ],\n \"type\": \"html\",\n \"is_published\": false,\n \"show_title\": true,\n \"width\": 123,\n \"background_color\": \"<string>\",\n \"use_comment\": false,\n \"is_comment_override\": false,\n \"comment_text\": \"<string>\",\n \"comment_show_type\": \"all\",\n \"hide_comment_posted_at\": false,\n \"comment_default_value\": \"<string>\",\n \"has_target_persons\": false,\n \"target_persons_date_from\": \"2023-12-25\",\n \"target_persons_date_to\": \"2023-12-25\",\n \"release_type\": \"immediately\",\n \"release_day\": 4999,\n \"release_month\": 4999,\n \"release_date\": \"2023-12-25\",\n \"release_hour\": 11,\n \"action_before_release\": \"show\",\n \"js_head\": \"<string>\",\n \"js_body_top\": \"<string>\",\n \"js_body\": \"<string>\",\n \"css\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.utage-system.com/v1/members/{site_id}/courses/{course_id}/lessons")
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 \"lesson_group_id\": \"<string>\",\n \"elements\": [\n {\n \"type\": \"<string>\",\n \"element_id\": 123,\n \"children\": [\n {}\n ]\n }\n ],\n \"type\": \"html\",\n \"is_published\": false,\n \"show_title\": true,\n \"width\": 123,\n \"background_color\": \"<string>\",\n \"use_comment\": false,\n \"is_comment_override\": false,\n \"comment_text\": \"<string>\",\n \"comment_show_type\": \"all\",\n \"hide_comment_posted_at\": false,\n \"comment_default_value\": \"<string>\",\n \"has_target_persons\": false,\n \"target_persons_date_from\": \"2023-12-25\",\n \"target_persons_date_to\": \"2023-12-25\",\n \"release_type\": \"immediately\",\n \"release_day\": 4999,\n \"release_month\": 4999,\n \"release_date\": \"2023-12-25\",\n \"release_hour\": 11,\n \"action_before_release\": \"show\",\n \"js_head\": \"<string>\",\n \"js_body_top\": \"<string>\",\n \"js_body\": \"<string>\",\n \"css\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"data": {
"id": "<string>",
"name": "<string>",
"lesson_group_id": "<string>",
"type": "html",
"lesson_url": "<string>",
"is_published": true,
"show_title": true,
"width": 123,
"background_color": "<string>",
"use_comment": true,
"is_comment_override": true,
"comment_text": "<string>",
"comment_show_type": "<string>",
"hide_comment_posted_at": true,
"comment_default_value": "<string>",
"js_head": "<string>",
"js_body_top": "<string>",
"js_body": "<string>",
"css": "<string>",
"release_type": "<string>",
"release_day": 123,
"release_month": 123,
"release_date": "<string>",
"release_hour": 123,
"action_before_release": "show",
"has_target_persons": true,
"target_persons_date_from": "<string>",
"target_persons_date_to": "<string>",
"elements": [
{
"type": "<string>",
"element_id": 123,
"children": [
{}
]
}
],
"order": 123,
"created_at": "<string>",
"updated_at": "<string>"
}
}レッスン作成
コースにレッスンを作成します。作成できる種類は「コンテンツエディター」(type=html)だけです(「リッチテキスト」は作成できません)。
レッスンは lesson_group_id のレッスングループの末尾に追加されます。並び位置の変更は PATCH /members/{site_id}/courses/{course_id}/lessons/reorder で行います。
本文は要素の階層構造(section > row > col > コンテンツ要素)の elements で指定します。使える要素タイプとプロパティは先に GET /element-types/lesson と GET /element-types/lesson/properties で確認してください(ファネルページとは使える要素・プロパティが異なります)。
参照系プロパティ(button の target_element_id、video-chapter の related_element_id、countdown / video の show_element_ids / hide_element_ids)は作成時には指定できません(422)。作成後に応答の element_id を使って更新で設定してください。
次の場合は 400(bad_request)になります。
typeにhtml以外を指定した- 契約内容による件数上限に達している(コース内のレッスン数。種類を問いません)
release_type=reader_dateを指定したが、会員サイトの「ログインなしでの閲覧」が「不可」(login_type=require)- レッスンで使えない要素タイプを含む
レート制限(rate_limit_exceeded)に加え、API 経由の作成上限(月間・累計)が適用され、超過時は 429 を返します。
curl --request POST \
--url https://api.utage-system.com/v1/members/{site_id}/courses/{course_id}/lessons \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"lesson_group_id": "<string>",
"elements": [
{
"type": "<string>",
"element_id": 123,
"children": [
{}
]
}
],
"type": "html",
"is_published": false,
"show_title": true,
"width": 123,
"background_color": "<string>",
"use_comment": false,
"is_comment_override": false,
"comment_text": "<string>",
"comment_show_type": "all",
"hide_comment_posted_at": false,
"comment_default_value": "<string>",
"has_target_persons": false,
"target_persons_date_from": "2023-12-25",
"target_persons_date_to": "2023-12-25",
"release_type": "immediately",
"release_day": 4999,
"release_month": 4999,
"release_date": "2023-12-25",
"release_hour": 11,
"action_before_release": "show",
"js_head": "<string>",
"js_body_top": "<string>",
"js_body": "<string>",
"css": "<string>"
}
'import requests
url = "https://api.utage-system.com/v1/members/{site_id}/courses/{course_id}/lessons"
payload = {
"name": "<string>",
"lesson_group_id": "<string>",
"elements": [
{
"type": "<string>",
"element_id": 123,
"children": [{}]
}
],
"type": "html",
"is_published": False,
"show_title": True,
"width": 123,
"background_color": "<string>",
"use_comment": False,
"is_comment_override": False,
"comment_text": "<string>",
"comment_show_type": "all",
"hide_comment_posted_at": False,
"comment_default_value": "<string>",
"has_target_persons": False,
"target_persons_date_from": "2023-12-25",
"target_persons_date_to": "2023-12-25",
"release_type": "immediately",
"release_day": 4999,
"release_month": 4999,
"release_date": "2023-12-25",
"release_hour": 11,
"action_before_release": "show",
"js_head": "<string>",
"js_body_top": "<string>",
"js_body": "<string>",
"css": "<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>',
lesson_group_id: '<string>',
elements: [{type: '<string>', element_id: 123, children: [{}]}],
type: 'html',
is_published: false,
show_title: true,
width: 123,
background_color: '<string>',
use_comment: false,
is_comment_override: false,
comment_text: '<string>',
comment_show_type: 'all',
hide_comment_posted_at: false,
comment_default_value: '<string>',
has_target_persons: false,
target_persons_date_from: '2023-12-25',
target_persons_date_to: '2023-12-25',
release_type: 'immediately',
release_day: 4999,
release_month: 4999,
release_date: '2023-12-25',
release_hour: 11,
action_before_release: 'show',
js_head: '<string>',
js_body_top: '<string>',
js_body: '<string>',
css: '<string>'
})
};
fetch('https://api.utage-system.com/v1/members/{site_id}/courses/{course_id}/lessons', 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.utage-system.com/v1/members/{site_id}/courses/{course_id}/lessons",
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>',
'lesson_group_id' => '<string>',
'elements' => [
[
'type' => '<string>',
'element_id' => 123,
'children' => [
[
]
]
]
],
'type' => 'html',
'is_published' => false,
'show_title' => true,
'width' => 123,
'background_color' => '<string>',
'use_comment' => false,
'is_comment_override' => false,
'comment_text' => '<string>',
'comment_show_type' => 'all',
'hide_comment_posted_at' => false,
'comment_default_value' => '<string>',
'has_target_persons' => false,
'target_persons_date_from' => '2023-12-25',
'target_persons_date_to' => '2023-12-25',
'release_type' => 'immediately',
'release_day' => 4999,
'release_month' => 4999,
'release_date' => '2023-12-25',
'release_hour' => 11,
'action_before_release' => 'show',
'js_head' => '<string>',
'js_body_top' => '<string>',
'js_body' => '<string>',
'css' => '<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://api.utage-system.com/v1/members/{site_id}/courses/{course_id}/lessons"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"lesson_group_id\": \"<string>\",\n \"elements\": [\n {\n \"type\": \"<string>\",\n \"element_id\": 123,\n \"children\": [\n {}\n ]\n }\n ],\n \"type\": \"html\",\n \"is_published\": false,\n \"show_title\": true,\n \"width\": 123,\n \"background_color\": \"<string>\",\n \"use_comment\": false,\n \"is_comment_override\": false,\n \"comment_text\": \"<string>\",\n \"comment_show_type\": \"all\",\n \"hide_comment_posted_at\": false,\n \"comment_default_value\": \"<string>\",\n \"has_target_persons\": false,\n \"target_persons_date_from\": \"2023-12-25\",\n \"target_persons_date_to\": \"2023-12-25\",\n \"release_type\": \"immediately\",\n \"release_day\": 4999,\n \"release_month\": 4999,\n \"release_date\": \"2023-12-25\",\n \"release_hour\": 11,\n \"action_before_release\": \"show\",\n \"js_head\": \"<string>\",\n \"js_body_top\": \"<string>\",\n \"js_body\": \"<string>\",\n \"css\": \"<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://api.utage-system.com/v1/members/{site_id}/courses/{course_id}/lessons")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"lesson_group_id\": \"<string>\",\n \"elements\": [\n {\n \"type\": \"<string>\",\n \"element_id\": 123,\n \"children\": [\n {}\n ]\n }\n ],\n \"type\": \"html\",\n \"is_published\": false,\n \"show_title\": true,\n \"width\": 123,\n \"background_color\": \"<string>\",\n \"use_comment\": false,\n \"is_comment_override\": false,\n \"comment_text\": \"<string>\",\n \"comment_show_type\": \"all\",\n \"hide_comment_posted_at\": false,\n \"comment_default_value\": \"<string>\",\n \"has_target_persons\": false,\n \"target_persons_date_from\": \"2023-12-25\",\n \"target_persons_date_to\": \"2023-12-25\",\n \"release_type\": \"immediately\",\n \"release_day\": 4999,\n \"release_month\": 4999,\n \"release_date\": \"2023-12-25\",\n \"release_hour\": 11,\n \"action_before_release\": \"show\",\n \"js_head\": \"<string>\",\n \"js_body_top\": \"<string>\",\n \"js_body\": \"<string>\",\n \"css\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.utage-system.com/v1/members/{site_id}/courses/{course_id}/lessons")
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 \"lesson_group_id\": \"<string>\",\n \"elements\": [\n {\n \"type\": \"<string>\",\n \"element_id\": 123,\n \"children\": [\n {}\n ]\n }\n ],\n \"type\": \"html\",\n \"is_published\": false,\n \"show_title\": true,\n \"width\": 123,\n \"background_color\": \"<string>\",\n \"use_comment\": false,\n \"is_comment_override\": false,\n \"comment_text\": \"<string>\",\n \"comment_show_type\": \"all\",\n \"hide_comment_posted_at\": false,\n \"comment_default_value\": \"<string>\",\n \"has_target_persons\": false,\n \"target_persons_date_from\": \"2023-12-25\",\n \"target_persons_date_to\": \"2023-12-25\",\n \"release_type\": \"immediately\",\n \"release_day\": 4999,\n \"release_month\": 4999,\n \"release_date\": \"2023-12-25\",\n \"release_hour\": 11,\n \"action_before_release\": \"show\",\n \"js_head\": \"<string>\",\n \"js_body_top\": \"<string>\",\n \"js_body\": \"<string>\",\n \"css\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"data": {
"id": "<string>",
"name": "<string>",
"lesson_group_id": "<string>",
"type": "html",
"lesson_url": "<string>",
"is_published": true,
"show_title": true,
"width": 123,
"background_color": "<string>",
"use_comment": true,
"is_comment_override": true,
"comment_text": "<string>",
"comment_show_type": "<string>",
"hide_comment_posted_at": true,
"comment_default_value": "<string>",
"js_head": "<string>",
"js_body_top": "<string>",
"js_body": "<string>",
"css": "<string>",
"release_type": "<string>",
"release_day": 123,
"release_month": 123,
"release_date": "<string>",
"release_hour": 123,
"action_before_release": "show",
"has_target_persons": true,
"target_persons_date_from": "<string>",
"target_persons_date_to": "<string>",
"elements": [
{
"type": "<string>",
"element_id": 123,
"children": [
{}
]
}
],
"order": 123,
"created_at": "<string>",
"updated_at": "<string>"
}
}POST
https://api.utage-system.com/v1/members/{site_id}/courses/{course_id}/lessons
Body
開放日(開始日)(immediately: コースへ登録後すぐに開放、scheduled: コースへ登録後、指定した日数経過後に開放、scheduled_month: コースへ登録後、指定した月数経過後に開放、datetime: 指定した日時に開放、reader_date: アクセス元シナリオの配信基準日時から指定した日数経過後に開放)。reader_date は会員サイトの「ログインなしでの閲覧」が「可」(login_type が optional / none)の場合のみ指定できます
immediately, scheduled, scheduled_month, datetime, reader_date