cURL
curl --request POST 'https://api.brightalk.ai/line-messages' \
--header "Authorization: Bearer $BRIGHTALK_API_KEY" \
--header "Brightalk-Version: 2026-07-16" \
--header "Content-Type: application/json" \
--header "Idempotency-Key: line-example-update-1" \
--data '{"contact_id":"123e4567-e89b-42d3-a456-426614174000","message":"Hello, your requested update is ready."}'const response = await fetch("https://api.brightalk.ai/line-messages", {
method: "POST",
headers: {
Authorization: `Bearer ${process.env.BRIGHTALK_API_KEY}`,
"Brightalk-Version": "2026-07-16",
"Content-Type": "application/json",
"Idempotency-Key": "line-example-update-1",
},
body: JSON.stringify({"contact_id":"123e4567-e89b-42d3-a456-426614174000","message":"Hello, your requested update is ready."}),
});
console.log(response.status, await response.json());import os
import requests
response = requests.request(
"POST",
"https://api.brightalk.ai/line-messages",
headers={
"Authorization": f"Bearer {os.environ['BRIGHTALK_API_KEY']}",
"Brightalk-Version": "2026-07-16",
"Content-Type": "application/json",
"Idempotency-Key": "line-example-update-1",
},
json={"contact_id":"123e4567-e89b-42d3-a456-426614174000","message":"Hello, your requested update is ready."},
)
print(response.status_code, response.json()){
"id": "<string>",
"contact_id": "<string>",
"status": "pending",
"error_code": null,
"created_at": "2023-11-07T05:31:56Z"
}LINE messages
發送 LINE 文字訊息
傳送文字給同組織聯絡人唯一綁定、仍追蹤官方帳號的個人 LINE 帳號。組織須已啟用 LINE 模組並設定頻道。201 代表建立發送紀錄,請檢查 status:sent 代表 LINE 已接受,不保證送達或已讀;failed 代表未成功發送;pending 或 unknown 須查明結果。以相同內容及 Idempotency-Key 重送只會取得目前紀錄,不會再次發送。紀錄不會到期,刪除收件匣訊息或聯絡人也不會解除防重送保護。文字原樣傳送,不展開範本變數。
POST
/
line-messages
cURL
curl --request POST 'https://api.brightalk.ai/line-messages' \
--header "Authorization: Bearer $BRIGHTALK_API_KEY" \
--header "Brightalk-Version: 2026-07-16" \
--header "Content-Type: application/json" \
--header "Idempotency-Key: line-example-update-1" \
--data '{"contact_id":"123e4567-e89b-42d3-a456-426614174000","message":"Hello, your requested update is ready."}'const response = await fetch("https://api.brightalk.ai/line-messages", {
method: "POST",
headers: {
Authorization: `Bearer ${process.env.BRIGHTALK_API_KEY}`,
"Brightalk-Version": "2026-07-16",
"Content-Type": "application/json",
"Idempotency-Key": "line-example-update-1",
},
body: JSON.stringify({"contact_id":"123e4567-e89b-42d3-a456-426614174000","message":"Hello, your requested update is ready."}),
});
console.log(response.status, await response.json());import os
import requests
response = requests.request(
"POST",
"https://api.brightalk.ai/line-messages",
headers={
"Authorization": f"Bearer {os.environ['BRIGHTALK_API_KEY']}",
"Brightalk-Version": "2026-07-16",
"Content-Type": "application/json",
"Idempotency-Key": "line-example-update-1",
},
json={"contact_id":"123e4567-e89b-42d3-a456-426614174000","message":"Hello, your requested update is ready."},
)
print(response.status_code, response.json()){
"id": "<string>",
"contact_id": "<string>",
"status": "pending",
"error_code": null,
"created_at": "2023-11-07T05:31:56Z"
}標頭
主體
application/json
JSON request body. The raw encoded body is limited to 1 MiB and unknown fields are rejected.
回應
已建立或讀回 LINE 發送紀錄。請檢查 status;建立紀錄不代表送達。