Lists

פתח ב-Claudeפתח ב-ChatGPT.md

יצירת רשימה

http
POST https://smsprovider-web.vercel.app/api/v1/lists

יצירת רשימה עם עד 10,000 אנשי קשר (טלפון + df1–df6). מספרים לא תקינים מוחזרים ב-rejected.

אימות: Authorization: Bearer bm_live_… · Scope נדרש: lists

גוף הבקשה

שדהסוגחובההערות
namestringכןlen 1–100
contactsobject[]לאitems 0–10000, default []

תשובה

201 — ContactList

שגיאות

סטטוסקוד
400validation_error
401unauthorized
403insufficient_scope
429rate_limited
500internal_error

דוגמאות

curl

bash
curl -X POST "https://smsprovider-web.vercel.app/api/v1/lists" \
  -H "Authorization: Bearer $BATLER_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"name":"לקוחות VIP","contacts":[{"phone":"0501234567","df1":"דנה"},{"phone":"0527654321","df1":"יוסי"}]}'

Node.js

ts
import { BatlerSMS } from "@batler/sms";

const sms = new BatlerSMS({ apiKey: process.env.BATLER_API_KEY! });
const body = {
  "name": "לקוחות VIP",
  "contacts": [
    {
      "phone": "0501234567",
      "df1": "דנה"
    },
    {
      "phone": "0527654321",
      "df1": "יוסי"
    }
  ]
};
const result = await sms.lists.create(body);

PHP

php
<?php
$ch = curl_init("https://smsprovider-web.vercel.app/api/v1/lists");
curl_setopt_array($ch, [
  CURLOPT_CUSTOMREQUEST => "POST",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_HTTPHEADER => [
    "Authorization: Bearer " . getenv("BATLER_API_KEY"),
    "Content-Type: application/json",
  ],
  CURLOPT_POSTFIELDS => json_encode(["name" => "לקוחות VIP", "contacts" => [["phone" => "0501234567", "df1" => "דנה"], ["phone" => "0527654321", "df1" => "יוסי"]]], JSON_UNESCAPED_UNICODE),
]);
$result = json_decode(curl_exec($ch), true);

Python

python
import os, uuid, requests

resp = requests.request(
    "POST", "https://smsprovider-web.vercel.app/api/v1/lists",
    headers={"Authorization": f"Bearer {os.environ['BATLER_API_KEY']}"},
    json={"name": "לקוחות VIP", "contacts": [{"phone": "0501234567", "df1": "דנה"}, {"phone": "0527654321", "df1": "יוסי"}]},
    timeout=30,
)
resp.raise_for_status()
result = resp.json()

C#

csharp
using var http = new HttpClient();
http.DefaultRequestHeaders.Authorization = new("Bearer", Environment.GetEnvironmentVariable("BATLER_API_KEY"));
var req = new HttpRequestMessage(HttpMethod.Post, "https://smsprovider-web.vercel.app/api/v1/lists");
req.Content = new StringContent("{\"name\":\"לקוחות VIP\",\"contacts\":[{\"phone\":\"0501234567\",\"df1\":\"דנה\"},{\"phone\":\"0527654321\",\"df1\":\"יוסי\"}]}", System.Text.Encoding.UTF8, "application/json");
var res = await http.SendAsync(req);
var result = await res.Content.ReadAsStringAsync();
☰
יצירת רשימה · Batler SMS API · Batler SMS