curl --request POST \
--url https://api.utage-system.com/v1/accounts/{account_id}/scenarios/{scenario_id}/messages \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"status": "draft",
"title": "<string>",
"use_ab_test": true,
"send_type": "<string>",
"send_date": "2023-12-25",
"send_day": 123,
"send_hour": 11,
"send_min": 29,
"base_date": "<string>",
"line": {
"sender_id": "<string>",
"messages": [
{}
]
},
"sms": {
"message": "<string>"
},
"action_id": "<string>",
"shorten_type": "shorten_url",
"shorten_domain": "<string>",
"conditions": [
{}
],
"url_actions": [
{}
]
}
'import requests
url = "https://api.utage-system.com/v1/accounts/{account_id}/scenarios/{scenario_id}/messages"
payload = {
"status": "draft",
"title": "<string>",
"use_ab_test": True,
"send_type": "<string>",
"send_date": "2023-12-25",
"send_day": 123,
"send_hour": 11,
"send_min": 29,
"base_date": "<string>",
"line": {
"sender_id": "<string>",
"messages": [{}]
},
"sms": { "message": "<string>" },
"action_id": "<string>",
"shorten_type": "shorten_url",
"shorten_domain": "<string>",
"conditions": [{}],
"url_actions": [{}]
}
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({
status: 'draft',
title: '<string>',
use_ab_test: true,
send_type: '<string>',
send_date: '2023-12-25',
send_day: 123,
send_hour: 11,
send_min: 29,
base_date: '<string>',
line: {sender_id: '<string>', messages: [{}]},
sms: {message: '<string>'},
action_id: '<string>',
shorten_type: 'shorten_url',
shorten_domain: '<string>',
conditions: [{}],
url_actions: [{}]
})
};
fetch('https://api.utage-system.com/v1/accounts/{account_id}/scenarios/{scenario_id}/messages', 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}/messages",
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([
'status' => 'draft',
'title' => '<string>',
'use_ab_test' => true,
'send_type' => '<string>',
'send_date' => '2023-12-25',
'send_day' => 123,
'send_hour' => 11,
'send_min' => 29,
'base_date' => '<string>',
'line' => [
'sender_id' => '<string>',
'messages' => [
[
]
]
],
'sms' => [
'message' => '<string>'
],
'action_id' => '<string>',
'shorten_type' => 'shorten_url',
'shorten_domain' => '<string>',
'conditions' => [
[
]
],
'url_actions' => [
[
]
]
]),
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}/messages"
payload := strings.NewReader("{\n \"status\": \"draft\",\n \"title\": \"<string>\",\n \"use_ab_test\": true,\n \"send_type\": \"<string>\",\n \"send_date\": \"2023-12-25\",\n \"send_day\": 123,\n \"send_hour\": 11,\n \"send_min\": 29,\n \"base_date\": \"<string>\",\n \"line\": {\n \"sender_id\": \"<string>\",\n \"messages\": [\n {}\n ]\n },\n \"sms\": {\n \"message\": \"<string>\"\n },\n \"action_id\": \"<string>\",\n \"shorten_type\": \"shorten_url\",\n \"shorten_domain\": \"<string>\",\n \"conditions\": [\n {}\n ],\n \"url_actions\": [\n {}\n ]\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}/messages")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"status\": \"draft\",\n \"title\": \"<string>\",\n \"use_ab_test\": true,\n \"send_type\": \"<string>\",\n \"send_date\": \"2023-12-25\",\n \"send_day\": 123,\n \"send_hour\": 11,\n \"send_min\": 29,\n \"base_date\": \"<string>\",\n \"line\": {\n \"sender_id\": \"<string>\",\n \"messages\": [\n {}\n ]\n },\n \"sms\": {\n \"message\": \"<string>\"\n },\n \"action_id\": \"<string>\",\n \"shorten_type\": \"shorten_url\",\n \"shorten_domain\": \"<string>\",\n \"conditions\": [\n {}\n ],\n \"url_actions\": [\n {}\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.utage-system.com/v1/accounts/{account_id}/scenarios/{scenario_id}/messages")
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 \"status\": \"draft\",\n \"title\": \"<string>\",\n \"use_ab_test\": true,\n \"send_type\": \"<string>\",\n \"send_date\": \"2023-12-25\",\n \"send_day\": 123,\n \"send_hour\": 11,\n \"send_min\": 29,\n \"base_date\": \"<string>\",\n \"line\": {\n \"sender_id\": \"<string>\",\n \"messages\": [\n {}\n ]\n },\n \"sms\": {\n \"message\": \"<string>\"\n },\n \"action_id\": \"<string>\",\n \"shorten_type\": \"shorten_url\",\n \"shorten_domain\": \"<string>\",\n \"conditions\": [\n {}\n ],\n \"url_actions\": [\n {}\n ]\n}"
response = http.request(request)
puts response.read_body{
"data": {
"id": "<string>",
"channel": "mail",
"type": "broadcast",
"status": "draft",
"title": "<string>",
"mail": {},
"line": {
"sender_id": "<string>",
"messages": [
{}
]
},
"sms": {},
"url_actions": [
{}
]
},
"warnings": [
"<string>"
]
}{
"error": {
"code": "<string>",
"message": "<string>",
"details": {}
}
}{
"error": {
"code": "unauthorized",
"message": "認証に失敗しました"
}
}{
"error": {
"code": "not_found",
"message": "リソースが見つかりません"
}
}{
"error": {
"code": "validation_error",
"message": "バリデーションエラーが発生しました"
}
}{
"error": {
"code": "rate_limit_exceeded",
"message": "リクエスト上限を超えました。しばらく時間を空けて再試行してください"
}
}配信メッセージ作成
プレビュー機能。仕様は今後変更される可能性があります。 指定シナリオに配信メッセージを新規作成します。
channelとtypeは作成後に変更できません。statusをreserved(予約)にすると、配信安全制御・DKIM/SMS前提チェックが実行されます。- 媒体に応じて原稿オブジェクト(
mail/line/sms)を指定します。 channel=mailのメール本文には配信解除URL(%cancel%または%cancelall%)を必ず含めてください。含めない場合はバリデーションエラーになります。channel=actionの場合は原稿オブジェクト不要。status=reserved時はaction_idが必須です。
curl --request POST \
--url https://api.utage-system.com/v1/accounts/{account_id}/scenarios/{scenario_id}/messages \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"status": "draft",
"title": "<string>",
"use_ab_test": true,
"send_type": "<string>",
"send_date": "2023-12-25",
"send_day": 123,
"send_hour": 11,
"send_min": 29,
"base_date": "<string>",
"line": {
"sender_id": "<string>",
"messages": [
{}
]
},
"sms": {
"message": "<string>"
},
"action_id": "<string>",
"shorten_type": "shorten_url",
"shorten_domain": "<string>",
"conditions": [
{}
],
"url_actions": [
{}
]
}
'import requests
url = "https://api.utage-system.com/v1/accounts/{account_id}/scenarios/{scenario_id}/messages"
payload = {
"status": "draft",
"title": "<string>",
"use_ab_test": True,
"send_type": "<string>",
"send_date": "2023-12-25",
"send_day": 123,
"send_hour": 11,
"send_min": 29,
"base_date": "<string>",
"line": {
"sender_id": "<string>",
"messages": [{}]
},
"sms": { "message": "<string>" },
"action_id": "<string>",
"shorten_type": "shorten_url",
"shorten_domain": "<string>",
"conditions": [{}],
"url_actions": [{}]
}
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({
status: 'draft',
title: '<string>',
use_ab_test: true,
send_type: '<string>',
send_date: '2023-12-25',
send_day: 123,
send_hour: 11,
send_min: 29,
base_date: '<string>',
line: {sender_id: '<string>', messages: [{}]},
sms: {message: '<string>'},
action_id: '<string>',
shorten_type: 'shorten_url',
shorten_domain: '<string>',
conditions: [{}],
url_actions: [{}]
})
};
fetch('https://api.utage-system.com/v1/accounts/{account_id}/scenarios/{scenario_id}/messages', 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}/messages",
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([
'status' => 'draft',
'title' => '<string>',
'use_ab_test' => true,
'send_type' => '<string>',
'send_date' => '2023-12-25',
'send_day' => 123,
'send_hour' => 11,
'send_min' => 29,
'base_date' => '<string>',
'line' => [
'sender_id' => '<string>',
'messages' => [
[
]
]
],
'sms' => [
'message' => '<string>'
],
'action_id' => '<string>',
'shorten_type' => 'shorten_url',
'shorten_domain' => '<string>',
'conditions' => [
[
]
],
'url_actions' => [
[
]
]
]),
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}/messages"
payload := strings.NewReader("{\n \"status\": \"draft\",\n \"title\": \"<string>\",\n \"use_ab_test\": true,\n \"send_type\": \"<string>\",\n \"send_date\": \"2023-12-25\",\n \"send_day\": 123,\n \"send_hour\": 11,\n \"send_min\": 29,\n \"base_date\": \"<string>\",\n \"line\": {\n \"sender_id\": \"<string>\",\n \"messages\": [\n {}\n ]\n },\n \"sms\": {\n \"message\": \"<string>\"\n },\n \"action_id\": \"<string>\",\n \"shorten_type\": \"shorten_url\",\n \"shorten_domain\": \"<string>\",\n \"conditions\": [\n {}\n ],\n \"url_actions\": [\n {}\n ]\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}/messages")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"status\": \"draft\",\n \"title\": \"<string>\",\n \"use_ab_test\": true,\n \"send_type\": \"<string>\",\n \"send_date\": \"2023-12-25\",\n \"send_day\": 123,\n \"send_hour\": 11,\n \"send_min\": 29,\n \"base_date\": \"<string>\",\n \"line\": {\n \"sender_id\": \"<string>\",\n \"messages\": [\n {}\n ]\n },\n \"sms\": {\n \"message\": \"<string>\"\n },\n \"action_id\": \"<string>\",\n \"shorten_type\": \"shorten_url\",\n \"shorten_domain\": \"<string>\",\n \"conditions\": [\n {}\n ],\n \"url_actions\": [\n {}\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.utage-system.com/v1/accounts/{account_id}/scenarios/{scenario_id}/messages")
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 \"status\": \"draft\",\n \"title\": \"<string>\",\n \"use_ab_test\": true,\n \"send_type\": \"<string>\",\n \"send_date\": \"2023-12-25\",\n \"send_day\": 123,\n \"send_hour\": 11,\n \"send_min\": 29,\n \"base_date\": \"<string>\",\n \"line\": {\n \"sender_id\": \"<string>\",\n \"messages\": [\n {}\n ]\n },\n \"sms\": {\n \"message\": \"<string>\"\n },\n \"action_id\": \"<string>\",\n \"shorten_type\": \"shorten_url\",\n \"shorten_domain\": \"<string>\",\n \"conditions\": [\n {}\n ],\n \"url_actions\": [\n {}\n ]\n}"
response = http.request(request)
puts response.read_body{
"data": {
"id": "<string>",
"channel": "mail",
"type": "broadcast",
"status": "draft",
"title": "<string>",
"mail": {},
"line": {
"sender_id": "<string>",
"messages": [
{}
]
},
"sms": {},
"url_actions": [
{}
]
},
"warnings": [
"<string>"
]
}{
"error": {
"code": "<string>",
"message": "<string>",
"details": {}
}
}{
"error": {
"code": "unauthorized",
"message": "認証に失敗しました"
}
}{
"error": {
"code": "not_found",
"message": "リソースが見つかりません"
}
}{
"error": {
"code": "validation_error",
"message": "バリデーションエラーが発生しました"
}
}{
"error": {
"code": "rate_limit_exceeded",
"message": "リクエスト上限を超えました。しばらく時間を空けて再試行してください"
}
}POST
https://api.utage-system.com/v1/accounts/{account_id}/scenarios/{scenario_id}/messages
Authorizations
APIキーをBearerトークンとして指定
Body
配信メッセージ作成リクエスト。type に応じて送信タイミング系フィールドを指定します。
送信タイミングの詳細な指定方法は MCPツール(message_create)の説明も参照してください。
媒体(作成後に変更不可)
mail, line, sms, action 配信タイプ(作成後に変更不可)
broadcast, step, reminder ステータス。reserved(予約)にすると配信安全制御・DKIM/SMS前提チェックが実行されます。
draft, reserved 管理名称
255A/Bテスト使用
送信タイプ。broadcast: immediately(即時)/scheduled(日時指定)。
step: immediately / scheduled(日数指定)/scheduled_addition(追加配信)。
送信日(broadcast用、YYYY-MM-DD)
送信日数(step / reminder 用)。step: 登録からの日数(0=当日)。 reminder: 基準日からの日数(0以上)。
送信時(0-23)
0 <= x <= 23送信分(0-59)
0 <= x <= 59送信タイミング(reminder用)。before=基準日の前、after=基準日の後、today=基準日当日、 addition_before/addition_after=追加配信。
before, after, today, addition_before, addition_after 基準日の読者項目名(reminder用)。置き換え文字一覧の reader_item から取得。
ステップ送信タイプ(step用)。none=指定日時に送信、immediately=登録直後に即時送信。
none, immediately メール原稿(channel=mail 時に必須)
Show child attributes
Show child attributes
LINE原稿(channel=line 時に必須)
Show child attributes
Show child attributes
SMS原稿(channel=sms 時に必須)
Show child attributes
Show child attributes
配信後に実行するアクションID(channel=action かつ status=reserved 時に必須)
URL置換方法(shorten_url: 置換URLを表示、original_url: 元のURLを表示)
shorten_url, original_url URL置換ドメイン
配信条件。グループ間はOR結合、グループ内の rules はAND結合。 使用可能な key / condition / value は配信条件タイプ定義を参照してください。
URLアクションの配列
Response
作成された配信メッセージ
配信メッセージの詳細。共通フィールドに加え、type に応じた送信タイミング系フィールド
(send_type / send_date / send_day / send_hour / send_min / base_date /
send_timing / step_send_type 等)と、channel に応じた原稿(mail / line / sms)、
url_actions を含みます。
Show child attributes
Show child attributes
予約(reserved)化時に検出された警告(DKIM未設定・配信安全制御など)。 警告がある場合のみ返されることがあります。