Skip to main content
LINE友だちをシナリオ登録
curl --request POST \
  --url https://api.utage-system.com/v1/accounts/{account_id}/line/friends/{friend_id}/readers \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "scenario_id": "<string>",
  "has_step_immediately": false,
  "has_step_scheduled": false,
  "has_reminder": false,
  "allow_duplicates": false
}
'
import requests

url = "https://api.utage-system.com/v1/accounts/{account_id}/line/friends/{friend_id}/readers"

payload = {
"scenario_id": "<string>",
"has_step_immediately": False,
"has_step_scheduled": False,
"has_reminder": False,
"allow_duplicates": False
}
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({
scenario_id: '<string>',
has_step_immediately: false,
has_step_scheduled: false,
has_reminder: false,
allow_duplicates: false
})
};

fetch('https://api.utage-system.com/v1/accounts/{account_id}/line/friends/{friend_id}/readers', 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}/line/friends/{friend_id}/readers",
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([
'scenario_id' => '<string>',
'has_step_immediately' => false,
'has_step_scheduled' => false,
'has_reminder' => false,
'allow_duplicates' => false
]),
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}/line/friends/{friend_id}/readers"

payload := strings.NewReader("{\n \"scenario_id\": \"<string>\",\n \"has_step_immediately\": false,\n \"has_step_scheduled\": false,\n \"has_reminder\": false,\n \"allow_duplicates\": false\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}/line/friends/{friend_id}/readers")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"scenario_id\": \"<string>\",\n \"has_step_immediately\": false,\n \"has_step_scheduled\": false,\n \"has_reminder\": false,\n \"allow_duplicates\": false\n}")
.asString();
require 'uri'
require 'net/http'

url = URI("https://api.utage-system.com/v1/accounts/{account_id}/line/friends/{friend_id}/readers")

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 \"scenario_id\": \"<string>\",\n \"has_step_immediately\": false,\n \"has_step_scheduled\": false,\n \"has_reminder\": false,\n \"allow_duplicates\": false\n}"

response = http.request(request)
puts response.read_body
{
  "data": {}
}
{
"error": {
"code": "unauthorized",
"message": "認証に失敗しました"
}
}
{
"error": {
"code": "not_found",
"message": "リソースが見つかりません"
}
}
{
"error": {
"code": "conflict",
"message": "すでに登録されています"
}
}
{
"error": {
"code": "validation_error",
"message": "バリデーションエラーが発生しました"
}
}
{
"error": {
"code": "monthly_limit_exceeded",
"message": "月間の作成上限に達しました",
"details": {
"resource_type": "reader",
"retry_after": "2026-06-20 00:00:00"
}
}
}
POST
https://api.utage-system.com/v1/accounts/{account_id}/line/friends/{friend_id}/readers
読者作成はバーストが発生しやすいため、このエンドポイントは分間レート制限(60回/分)の対象外です。代わりに時間単位・月間単位の作成上限で制御されます。
この機能はプレビュー版です。仕様が変更される場合があります。

Authorizations

Authorization
string
header
required

APIキーをBearerトークンとして指定

Path Parameters

account_id
string
required

アカウントID

friend_id
string
required

LINE友だちID

Body

application/json
scenario_id
string
required

登録先シナリオID

has_step_immediately
boolean
default:false

登録直後のステップ配信の対象にする

has_step_scheduled
boolean
default:false

登録以降のステップ配信の対象にする

has_reminder
boolean
default:false

リマインダ配信の対象にする

allow_duplicates
boolean
default:false

重複登録を許可する

Response

登録された読者

data
object

読者詳細(line_friend_id / line_display_name / line_picture_url / is_line_blocked を含む)