登録フォーム項目作成
curl --request POST \
--url https://api.utage-system.com/v1/accounts/{account_id}/scenarios/{scenario_id}/form-items \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"reader_item_id": "<string>",
"is_required": false,
"default_value": "<string>"
}
'import requests
url = "https://api.utage-system.com/v1/accounts/{account_id}/scenarios/{scenario_id}/form-items"
payload = {
"reader_item_id": "<string>",
"is_required": False,
"default_value": "<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({reader_item_id: '<string>', is_required: false, default_value: '<string>'})
};
fetch('https://api.utage-system.com/v1/accounts/{account_id}/scenarios/{scenario_id}/form-items', 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/accounts/{account_id}/scenarios/{scenario_id}/form-items",
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([
'reader_item_id' => '<string>',
'is_required' => false,
'default_value' => '<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/accounts/{account_id}/scenarios/{scenario_id}/form-items"
payload := strings.NewReader("{\n \"reader_item_id\": \"<string>\",\n \"is_required\": false,\n \"default_value\": \"<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/accounts/{account_id}/scenarios/{scenario_id}/form-items")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"reader_item_id\": \"<string>\",\n \"is_required\": false,\n \"default_value\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.utage-system.com/v1/accounts/{account_id}/scenarios/{scenario_id}/form-items")
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 \"reader_item_id\": \"<string>\",\n \"is_required\": false,\n \"default_value\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"data": {
"id": "<string>",
"reader_item_id": "<string>",
"reserved_word": "<string>",
"name": "<string>",
"input_type": "<string>",
"is_required": true,
"default_value": "<string>",
"order": 123
}
}{
"error": {
"code": "bad_request",
"message": "LINEアカウントではフォーム項目の変更操作はできません"
}
}{
"error": {
"code": "unauthorized",
"message": "APIキーが無効です"
}
}{
"error": {
"code": "not_found",
"message": "ページが見つかりません"
}
}{
"error": {
"code": "conflict",
"message": "この読者項目は既に登録フォームに追加されています"
}
}{
"error": {
"code": "validation_error",
"message": "入力内容に誤りがあります",
"details": {
"name": [
"管理用タイトルは必須です"
]
}
}
}{
"error": {
"code": "rate_limit_exceeded",
"message": "レート制限を超過しました"
}
}登録フォーム・読者項目
登録フォーム項目作成
既存の読者項目をシナリオの登録フォームに組み込みます。表示順は末尾になります(並び替えは登録フォーム項目並び替えで行います)。
組み込めるのは読者項目一覧で取得できる項目です。ただし「お名前(シナリオ固有)」(reserved_word=reader_name)は組み込めず 404 になります(名前欄は全シナリオ共通の「お名前」を組み込みます)。
同じ読者項目を2回組み込むことはできません(409 conflict)。
input_type はデータ形式が file の項目では不要(指定しても空になります)、それ以外では必須です。email はメールアドレス項目(reserved_word=mail)専用で、メールアドレス項目は text / hidden / email だけ指定できます(違反は 422)。
LINE の配信アカウントでは作成できません(400 bad_request)。
登録フォーム項目作成
curl --request POST \
--url https://api.utage-system.com/v1/accounts/{account_id}/scenarios/{scenario_id}/form-items \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"reader_item_id": "<string>",
"is_required": false,
"default_value": "<string>"
}
'import requests
url = "https://api.utage-system.com/v1/accounts/{account_id}/scenarios/{scenario_id}/form-items"
payload = {
"reader_item_id": "<string>",
"is_required": False,
"default_value": "<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({reader_item_id: '<string>', is_required: false, default_value: '<string>'})
};
fetch('https://api.utage-system.com/v1/accounts/{account_id}/scenarios/{scenario_id}/form-items', 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/accounts/{account_id}/scenarios/{scenario_id}/form-items",
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([
'reader_item_id' => '<string>',
'is_required' => false,
'default_value' => '<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/accounts/{account_id}/scenarios/{scenario_id}/form-items"
payload := strings.NewReader("{\n \"reader_item_id\": \"<string>\",\n \"is_required\": false,\n \"default_value\": \"<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/accounts/{account_id}/scenarios/{scenario_id}/form-items")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"reader_item_id\": \"<string>\",\n \"is_required\": false,\n \"default_value\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.utage-system.com/v1/accounts/{account_id}/scenarios/{scenario_id}/form-items")
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 \"reader_item_id\": \"<string>\",\n \"is_required\": false,\n \"default_value\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"data": {
"id": "<string>",
"reader_item_id": "<string>",
"reserved_word": "<string>",
"name": "<string>",
"input_type": "<string>",
"is_required": true,
"default_value": "<string>",
"order": 123
}
}{
"error": {
"code": "bad_request",
"message": "LINEアカウントではフォーム項目の変更操作はできません"
}
}{
"error": {
"code": "unauthorized",
"message": "APIキーが無効です"
}
}{
"error": {
"code": "not_found",
"message": "ページが見つかりません"
}
}{
"error": {
"code": "conflict",
"message": "この読者項目は既に登録フォームに追加されています"
}
}{
"error": {
"code": "validation_error",
"message": "入力内容に誤りがあります",
"details": {
"name": [
"管理用タイトルは必須です"
]
}
}
}{
"error": {
"code": "rate_limit_exceeded",
"message": "レート制限を超過しました"
}
}POST
https://api.utage-system.com/v1/accounts/{account_id}/scenarios/{scenario_id}/form-items
Body
application/json