リマインダーAPI
リマインダーの作成API
スケジュールに従って自動的に送信される、繰り返しのWhatsAppメッセージを作成します。支払いリマインダー、毎週の状況確認、毎日のフォローアップなど、繰り返し送るメッセージに利用できます。
https://wbiztool.com/api/v1/reminder/create/リクエストボディ: JSONまたはフォームフィールド
スケジュールはcron式とタイムゾーンで指定します。スケジュールに一致するたびに、Wbiztoolはメッセージ送信で送るメッセージと同じように、電話番号またはグループ宛てのメッセージをキューに登録します。ここで作成したリマインダーはダッシュボードのリマインダーページにも表示され、そこで一時停止や編集ができます。
クイック例#
curl -X POST https://wbiztool.com/api/v1/reminder/create/ \
-H "Content-Type: application/json" \
-d '{
"client_id": 12345,
"api_key": "YOUR_API_KEY",
"whatsapp_client": 678,
"reminder_name": "Monthly rent reminder",
"phone": "919876543210",
"message": "Hi Aman, a reminder that your rent is due on {current_date_formatted}.",
"cron_expression": "0 10 1 * *",
"timezone": "Asia/Kolkata"
}'import requests
response = requests.post(
"https://wbiztool.com/api/v1/reminder/create/",
json={
"client_id": 12345,
"api_key": "YOUR_API_KEY",
"whatsapp_client": 678,
"reminder_name": "Monthly rent reminder",
"phone": "919876543210",
"message": "Hi Aman, a reminder that your rent is due on {current_date_formatted}.",
"cron_expression": "0 10 1 * *",
"timezone": "Asia/Kolkata",
},
timeout=60,
)
try:
result = response.json() # read the body even when the HTTP code is 400
except ValueError:
raise SystemExit(f"HTTP {response.status_code}: not JSON. Check that your api_key exists.")
if result["status"] == 1:
print("Reminder created with reminder_id", result["reminder_id"])
else:
print("Failed:", result["message"])// Node.js 18+ (built-in fetch). Save as .mjs to use top-level await.
const response = await fetch("https://wbiztool.com/api/v1/reminder/create/", {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({
client_id: 12345,
api_key: "YOUR_API_KEY",
whatsapp_client: 678,
reminder_name: "Monthly rent reminder",
phone: "919876543210",
message: "Hi Aman, a reminder that your rent is due on {current_date_formatted}.",
cron_expression: "0 10 1 * *",
timezone: "Asia/Kolkata",
}),
});
// Read the body even when the HTTP code is 400. A non-JSON reply means the api_key wasn't found.
const text = await response.text();
let result;
try {
result = JSON.parse(text);
} catch {
throw new Error(`HTTP ${response.status}: not JSON. Check that your api_key exists.`);
}
if (result.status === 1) {
console.log("Reminder created with reminder_id", result.reminder_id);
} else {
console.error("Failed:", result.message);
}<?php
$payload = [
'client_id' => 12345,
'api_key' => 'YOUR_API_KEY',
'whatsapp_client' => 678,
'reminder_name' => 'Monthly rent reminder',
'phone' => '919876543210',
'message' => 'Hi Aman, a reminder that your rent is due on {current_date_formatted}.',
'cron_expression' => '0 10 1 * *',
'timezone' => 'Asia/Kolkata',
];
$ch = curl_init('https://wbiztool.com/api/v1/reminder/create/');
curl_setopt_array($ch, [
CURLOPT_POST => true,
CURLOPT_HTTPHEADER => ['Content-Type: application/json'],
CURLOPT_POSTFIELDS => json_encode($payload),
CURLOPT_RETURNTRANSFER => true,
CURLOPT_TIMEOUT => 60,
]);
$result = json_decode(curl_exec($ch), true);
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close($ch);
if ($result === null) {
echo "HTTP $httpCode: not JSON. Check that your api_key exists.";
} elseif ($result['status'] === 1) {
echo 'Reminder created with reminder_id ' . $result['reminder_id'];
} else {
echo 'Failed: ' . $result['message'];
}このリマインダーは、毎月1日のインド時間10:00に送信されます。12345、YOUR_API_KEY、678はご自身の値に置き換えてください。値の確認場所は認証をご覧ください。
リクエストパラメータ#
パラメータはJSONボディまたはフォームフィールドで送信します。JSONでは、すべてのテキスト値(api_key、reminder_name、phone、message、cron_expression、timezone、img_url、file_name)を文字列で送信してください。
認証
client_idinteger必須設定 → APIキーに表示されるAPIクライアントIDです。
api_keystring必須同じページにあるAPIキーです。
送信元
whatsapp_clientinteger任意送信に使うWhatsApp番号のIDです。WhatsApp設定で確認できます。省略した場合、またはIDがワークスペースにない場合、各リマインダーは実行時点でワークスペース内の最初の接続済み番号から送信されます。
リマインダー
reminder_namestring必須リマインダーの名前です。リマインダーページに表示され、メッセージ内では
{reminder_name}として使用できます。phonestring必須受信者のWhatsApp番号で、国コード付きで指定します(例:
919876543210)。country_codeパラメータは別途ありません。スペース、+、-、.、括弧が削除され、先頭の0が削除されます(JSONボディでは先頭の0が最大2つまで削除されます)。すべて数字でない値は、WhatsAppのグループ名として扱われます。messagestring必須メッセージ本文です。リマインダーが実行されるたびに値が入るテンプレート変数を含めることができます。WhatsAppの書式(
*bold*、_italic_、~strikethrough~)が使えます。cron_expressionstring必須送信タイミングで、
0 9 * * 1-5のような5つのフィールドからなるcron式で指定します。cron式を参照してください。timezonestring任意cron式を実行するタイムゾーンで、
Asia/Kolkata、America/New_York、Europe/LondonのようなIANAタイムゾーン名で指定します。省略するとUTCが使用されます。空文字列を指定するとInvalid timezoneが返ります。完全な一覧はタイムゾーンリファレンスをご覧ください。
画像とファイル
msg_typeinteger任意0テキスト(デフォルト)、1画像、2ファイルのいずれかで、messageがキャプションになります。それ以外の値は0として扱われます。img_urlstringmsg_typeが1または2の場合は必須画像(
msg_type2の場合はファイル)の公開httpまたはhttpsURLで、最大1,000文字です。リマインダーが実行されるたびにダウンロードされるため、リンクを有効な状態に保ってください。ファイルはメディアのアップロードAPIでホストできます。file_namestringmsg_typeが2の場合は必須msg_type2の場合の、拡張子付きのファイル名で、最大100文字です(例:invoice.pdf)。他のメッセージタイプでは無視されます。
cron式#
cron式は、スペースで区切られた5つの値です。timezoneでの現在時刻が5つすべてに一致するたびに、リマインダーが実行されます。
┌───────── minute (0-59)
│ ┌─────── hour (0-23)
│ │ ┌───── day of month (1-31)
│ │ │ ┌─── month (1-12)
│ │ │ │ ┌─ day of week (0-7, where 0 and 7 are Sunday)
│ │ │ │ │
0 9 * * 1-5
| 記号 | 意味 | 例 |
|---|---|---|
* | すべての値 | 時のフィールドの*は毎時を意味します。 |
, | 値のリスト | 時のフィールドの9,18は9:00と18:00を意味します。 |
- | 範囲 | 曜日のフィールドの1-5は月曜日から金曜日を意味します。 |
/ | 間隔 | 時のフィールドの*/6は6時間ごとを意味します。 |
よく使われる例#
| 式 | 実行タイミング |
|---|---|
0 9 * * * | 毎日9:00 |
0 9 * * 1-5 | 月曜日から金曜日の9:00 |
0 9 * * 1 | 毎週月曜日の9:00 |
30 18 * * 0 | 毎週日曜日の18:30 |
0 9,18 * * * | 毎日9:00と18:00 |
0 */6 * * * | 6時間ごと(毎正時) |
*/30 9-17 * * 1-5 | 月曜日から金曜日の9:00から17:30まで30分ごと |
0 9 1 * * | 毎月1日の9:00 |
0 10 15 * * | 毎月15日の10:00 |
0 8 1 1 * | 毎年1月1日の8:00 |
時刻はリマインダーのtimezoneで解釈されます。フィールドは5つだけにしてください。秒のフィールドや@dailyのような省略形は使わないでください。
テンプレート変数#
message内の次のプレースホルダーは、リマインダーが実行されるたびに置き換えられます。日付と時刻はリマインダーのtimezoneで表されます。
| 変数 | 置き換えられる値 | 例 |
|---|---|---|
{current_date} | 日付 | 2026-10-01 |
{current_date_formatted} | 英語表記の日付(日は0埋め) | October 01, 2026 |
{current_time} | 24時間制の時刻 | 09:00:00 |
{current_time_12h} | 12時間制の時刻 | 09:00 AM |
{current_datetime} | 日付と時刻 | 2026-10-01 09:00:00 |
{timezone} | timezoneの値 | Asia/Kolkata |
{timezone_short} | タイムゾーンの略称 | IST |
{reminder_name} | reminder_nameの値 | Monthly rent reminder |
{to_number} | 保存されたphoneの値 | 919876543210 |
{client_name} | ワークスペースのオーナーの名前 | |
{organisation_name} | ワークスペースの名前 |
画像リマインダー#
curl -X POST https://wbiztool.com/api/v1/reminder/create/ \
-H "Content-Type: application/json" \
-d '{
"client_id": 12345,
"api_key": "YOUR_API_KEY",
"whatsapp_client": 678,
"reminder_name": "Weekly class timetable",
"phone": "919876543210",
"msg_type": 1,
"img_url": "https://example.com/timetable.png",
"message": "Here is this week'\''s timetable.",
"cron_expression": "0 8 * * 1",
"timezone": "Asia/Kolkata"
}'import requests
response = requests.post(
"https://wbiztool.com/api/v1/reminder/create/",
json={
"client_id": 12345,
"api_key": "YOUR_API_KEY",
"whatsapp_client": 678,
"reminder_name": "Weekly class timetable",
"phone": "919876543210",
"msg_type": 1,
"img_url": "https://example.com/timetable.png",
"message": "Here is this week's timetable.",
"cron_expression": "0 8 * * 1",
"timezone": "Asia/Kolkata",
},
timeout=60,
)
print(response.status_code, response.text)// Node.js 18+ (built-in fetch). Save as .mjs to use top-level await.
const response = await fetch("https://wbiztool.com/api/v1/reminder/create/", {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({
client_id: 12345,
api_key: "YOUR_API_KEY",
whatsapp_client: 678,
reminder_name: "Weekly class timetable",
phone: "919876543210",
msg_type: 1,
img_url: "https://example.com/timetable.png",
message: "Here is this week's timetable.",
cron_expression: "0 8 * * 1",
timezone: "Asia/Kolkata",
}),
});
console.log(response.status, await response.text());<?php
$ch = curl_init('https://wbiztool.com/api/v1/reminder/create/');
curl_setopt_array($ch, [
CURLOPT_POST => true,
CURLOPT_POSTFIELDS => http_build_query([
'client_id' => 12345,
'api_key' => 'YOUR_API_KEY',
'whatsapp_client' => 678,
'reminder_name' => 'Weekly class timetable',
'phone' => '919876543210',
'msg_type' => 1,
'img_url' => 'https://example.com/timetable.png',
'message' => "Here is this week's timetable.",
'cron_expression' => '0 8 * * 1',
'timezone' => 'Asia/Kolkata',
]),
CURLOPT_RETURNTRANSFER => true,
]);
echo curl_exec($ch);
curl_close($ch);PHPの例では、JSONではなくフォームフィールドを送信しています。どちらでも動作します。
レスポンス#
リクエストが成功すると、HTTP 200が返ります。
{
"reminder_id": 3187,
"message": "Reminder created successfully",
"status": 1
}
| フィールド | 型 | 説明 |
|---|---|---|
status | integer | リマインダーが作成された場合は1、リクエストが失敗した場合は0。 |
message | string | Reminder created successfully、それ以外はエラー内容。 |
reminder_id | integer | 新しいリマインダーのID。後でリマインダーをキャンセルするために保存してください。成功時のみ含まれます。 |
新しいリマインダーはすぐに有効になります。
エラー#
特に記載がない限り、エラーはHTTP 400で返り、statusは0になります。
{ "status": 0, "message": "Invalid timezone" }
| メッセージ | 対処方法 |
|---|---|
Invalid JSON format: … | JSONボディが無効です。末尾のカンマや、message内のエスケープされていない改行が原因であることがよくあります。改行には\nを使用してください。client_idなしのフォームリクエストや、すべてのGETリクエストでもこのエラーになります。 |
Invalid client id. | client_idを数値で送信してください。 |
Reminder name cannot be null | reminder_nameを追加してください。 |
Phone number cannot be null | phoneを追加してください。 |
Message template cannot be null | messageを追加してください。 |
Cron expression cannot be null | cron_expressionを追加してください。 |
Auth Error - Please send correct API key and Client id | 空でないapi_keyを送信してください。 |
Invalid cron expression | 式が5つの有効なフィールドで構成されているか確認してください。cron式を参照してください。 |
Invalid timezone | ISTのような略称ではなく、Asia/KolkataのようなIANA名を使用してください。 |
Image URL cannot be null for image messages | msg_type 1の場合はimg_urlを送信してください。 |
File URL cannot be null for file messages | msg_type 2の場合はfile_nameを送信してください。 |
Auth Error: invalid api key | キーが別のclient_idに属しています。 |
Auth Error: please check client id | キーがワークスペースに紐付いていません。使用したいワークスペースで新しいキーを作成してください。 |
Demo Account cannot access APIs | 通常のアカウントを使用してください。 |
Not enough credits | プランの残りメッセージ数がありません。 |
Upgrade your plan to use reminders feature | ご利用のプランにはリマインダーが含まれていません。プランをアップグレードしてください。 |
WhatsApp Logged Out. Please Reconnect!! | whatsapp_clientの番号の接続が切れています。WhatsApp設定で再接続してください。 |
Invalid WhatsApp client id | whatsapp_clientを数値で送信してください。 |
Error creating reminder: …(HTTP 500) | リマインダーを保存できませんでした。送信した値を確認してください(例:img_urlが1,000文字以内か、file_nameが100文字以内か)。 |
リマインダーの実行の仕組み#
- スケジュールはリマインダーの
timezoneで確認され、現在時刻がcron式に一致するとメッセージがキューに登録されます。 - 実行のたびに、あなたのWhatsApp番号から送信される通常のメッセージが作成されるため、番号は接続したままにしておく必要があります。
- ワークスペースのクレジットが残っていない場合、または
whatsapp_clientが設定されておらず、その時点でワークスペースに接続済みの番号がない場合、その回の実行はスキップされます。 whatsapp_clientが設定されている場合、その番号が切断されていても、各回のメッセージはその番号でキューに登録され、そこで待機します。別の番号に切り替わることはありません。- リマインダーは秒単位ではなく定期的に確認され、その後メッセージはほかのメッセージと同様に送信キューで待機します。正確なタイミングを前提にしないでください。確認が遅れた場合でも、実行は最大10分遅れまで(リマインダーの初回実行では最大1分遅れまで)送信され、それを過ぎるとスキップされます。同じ実行が2回送信されることはありません。
ヒント#
- 一覧の確認と整理:リマインダー一覧でリマインダーとそのIDを取得し、リマインダーのキャンセルで停止できます。
- 一時停止と編集はAPIでは利用できません。ダッシュボードのリマインダーページを使用してください。
- 多数のリマインダーをまとめて作成:リマインダーページでは、CSVファイルからリマインダーをインポートすることもできます。
- JSONでの改行:
message内では\nと記述してください。そのまま改行を入れるとJSONが無効になります。
