---
url: https://textme-docs.matat.io/he/endpoints/bulk.md
description: >-
  bulk: שליחת עד 2,500 הודעות שונות בקריאה אחת, כל אחת עם הטקסט, השולח והיעדים
  שלה.
---

# שליחה מרובה

שולחת **הודעות שונות** בקריאה אחת. כל אחת עם הטקסט שלה, השולח שלה והיעדים שלה. כשכל נמען מקבל את *אותו* גוף הודעה, [`sms`](./send.md) היא הפעולה הנכונה; שליחת אצווה של הודעות זהות דרך `bulk` תעבוד אבל תבזבז את תקציב האצווה.

```http
POST https://my.textme.co.il/api
```

## `bulk` שליחת אצווה

גוף הבקשה עוטף אלמנט `messages` שמחזיק עד **2,500** אובייקטי `sms`. כל אחד מהם הוא גרסה מוקטנת של גוף הבקשה של [`sms`](./send.md): שולח, יעדים, טקסט וקישורים אופציונליים. הגדרות שחלות על האצווה כולה (תזמון, סינון לפי מועד שליחה אחרון, שם קמפיין) יושבות ברמה העליונה, מחוץ ל-`messages`.

### פרמטרים

| שם | סוג | תיאור | חובה |
|---|---|---|---|
| `bulk` | object | אלמנט השורש. | ✔️ |
| `user` | object | מכיל את אלמנט המשתמש. | ✔️ |
| `username` | string | שם המשתמש של החשבון שבו אתם מזוהים במערכת. | ✔️ |
| `messages` | array of objects | מכיל את כל אובייקטי ה-sms. **מספר האובייקטים לא יעלה על 2500.** | ✔️ |
| `messages.sms.source` | string | השולח של ההודעה הזו. עד 11 תווים, ספרות ואותיות באנגלית בלבד, בלי `+`. חייב להיות [שולח מאומת](./verified-senders.md). | ✔️ |
| `messages.sms.destinations` | object | היעדים של ההודעה הזו. יכול להחזיק כמה אלמנטי `phone`. | ✔️ |
| `messages.sms.phone` | string | מספר יעד, בפורמט `5xxxxxxx` או `05xxxxxxx`. | ✔️ |
| `messages.sms.id` | string | תכונה של `phone`. מזהה חיצוני משלכם ליעד הזה, ל[דוחות מסירה](./reports.md) בהמשך. | ➖ |
| `messages.sms.message` | string | גוף ההודעה הזו. עד 1005 תווים. | ✔️ |
| `messages.sms.links` | object | קישורים לקיצור בתוך ההודעה הזו. `[link-id]` בגוף ההודעה מסמן איפה כל אחד יופיע. | ➖ |
| `messages.sms.cl_id` | string | שליחת ההודעה הזו גם ל[רשימת תפוצה](./contact-lists.md). | ➖ |
| `timing` | string | תזמון האצווה כולה, בפורמט `dd/mm/yy hh:mm`. נשלח מיד כשהשדה נעדר. | ➖ |
| `add_unsubscribe` | int | מנגנון הסרה לאצווה: `3` לקישור, `2` להסרה בהודעה חוזרת. | ➖ |
| `temp_bl` | string | דילוג על יעדים שקיבלו הודעה ב-*n* הימים האחרונים, 1 עד 14. | ➖ |
| `includes_international` | int | `1` כדי לאפשר יעדים מחוץ לישראל, `0` אחרת. | ➖ |
| `campaign_name` | string | שם לאצווה בדוחות המערכת, והידית ל[ביטול לפי שם](./campaigns.md). עד 50 תווים. | ➖ |

### דוגמת בקשה

שתי הודעות, כל אחת ליעדים שלה, כשהשנייה נושאת קישור מקוצר:

::: code-group

```xml [XML]
<?xml version="1.0" encoding="UTF-8"?>
<bulk>
    <user>
        <username>Leeroy</username>
    </user>
    <messages>
        <sms>
            <source>DemoAPI</source>
            <destinations>
                <phone id="external id1">5xxxxxxxx</phone>
                <phone id="external id2">5xxxxxxxx</phone>
                <phone>5xxxxxxxx</phone>
                <phone id="">5xxxxxxxx</phone>
            </destinations>
            <message>This is a sample message</message>
        </sms>
        <sms>
            <source>DemoAPI</source>
            <destinations>
                <phone id="">5xxxxxxxx</phone>
            </destinations>
            <message>This is a different message sent. [link-a1]</message>
            <links>
                <link id="a1">https://www.example.com/path/to/resource</link>
            </links>
        </sms>
    </messages>
    <timing>10/10/17 10:10</timing>
    <temp_bl>2</temp_bl>
    <includes_international>1</includes_international>
    <campaign_name>Sample Bulk Campaign</campaign_name>
</bulk>
```

```json [JSON]
{
  "bulk": {
    "user": {
      "username": "Leeroy"
    },
    "messages": {
      "sms": [
        {
          "source": "DemoAPI",
          "destinations": {
            "phone": [
              {
                "$": {
                  "id": "external id1"
                },
                "_": "5xxxxxxxx"
              },
              {
                "$": {
                  "id": "external id2"
                },
                "_": "5xxxxxxxx"
              },
              {
                "_": "5xxxxxxxx"
              },
              {
                "$": {
                  "id": ""
                },
                "_": "5xxxxxxxx"
              }
            ]
          },
          "message": "This is a sample message"
        },
        {
          "source": "DemoAPI",
          "destinations": {
            "phone": {
              "$": {
                "id": ""
              },
              "_": "5xxxxxxxx"
            }
          },
          "message": "This is a different message sent. [link-a1]",
          "links": {
            "link": [
              {
                "$": {
                  "id": "a1"
                },
                "_": "https://www.example.com/path/to/resource"
              }
            ]
          }
        }
      ]
    },
    "timing": "10/10/17 10:10",
    "temp_bl": "2",
    "includes_international": "1",
    "campaign_name": "Sample Bulk Campaign"
  }
}
```

```bash [cURL]
curl --location 'https://my.textme.co.il/api' \
--header "Authorization: Bearer $TEXTME_API_TOKEN" \
--header 'Content-Type: application/json' \
--data '{
  "bulk": {
    "user": {
      "username": "Leeroy"
    },
    "messages": {
      "sms": [
        {
          "source": "DemoAPI",
          "destinations": {
            "phone": [
              {
                "$": {
                  "id": "external id1"
                },
                "_": "5xxxxxxxx"
              },
              {
                "$": {
                  "id": "external id2"
                },
                "_": "5xxxxxxxx"
              },
              {
                "_": "5xxxxxxxx"
              },
              {
                "$": {
                  "id": ""
                },
                "_": "5xxxxxxxx"
              }
            ]
          },
          "message": "This is a sample message"
        },
        {
          "source": "DemoAPI",
          "destinations": {
            "phone": {
              "$": {
                "id": ""
              },
              "_": "5xxxxxxxx"
            }
          },
          "message": "This is a different message sent. [link-a1]",
          "links": {
            "link": [
              {
                "$": {
                  "id": "a1"
                },
                "_": "https://www.example.com/path/to/resource"
              }
            ]
          }
        }
      ]
    },
    "timing": "10/10/17 10:10",
    "temp_bl": "2",
    "includes_international": "1",
    "campaign_name": "Sample Bulk Campaign"
  }
}'
```

```js [JavaScript]
// Node.js 18+ או כל דפדפן מודרני. ללא תלויות
const response = await fetch('https://my.textme.co.il/api', {
  method: 'POST',
  headers: {
    Authorization: `Bearer ${process.env.TEXTME_API_TOKEN}`,
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({
    bulk: {
      user: {
        username: 'Leeroy',
      },
      messages: {
        sms: [
          {
            source: 'DemoAPI',
            destinations: {
              phone: [
                {
                  $: {
                    id: 'external id1',
                  },
                  _: '5xxxxxxxx',
                },
                {
                  $: {
                    id: 'external id2',
                  },
                  _: '5xxxxxxxx',
                },
                {
                  _: '5xxxxxxxx',
                },
                {
                  $: {
                    id: '',
                  },
                  _: '5xxxxxxxx',
                },
              ],
            },
            message: 'This is a sample message',
          },
          {
            source: 'DemoAPI',
            destinations: {
              phone: {
                $: {
                  id: '',
                },
                _: '5xxxxxxxx',
              },
            },
            message: 'This is a different message sent. [link-a1]',
            links: {
              link: [
                {
                  $: {
                    id: 'a1',
                  },
                  _: 'https://www.example.com/path/to/resource',
                },
              ],
            },
          },
        ],
      },
      timing: '10/10/17 10:10',
      temp_bl: '2',
      includes_international: '1',
      campaign_name: 'Sample Bulk Campaign',
    },
  }),
})

const result = await response.json()

// גם שגיאה חוזרת כ-HTTP 200, לכן הסטטוס שבגוף התשובה הוא הקובע
if (Number(result.status) !== 0) {
  throw new Error(`TextMe ${result.status}: ${result.message}`)
}

console.log(result)
```

```php [PHP]
<?php
// composer require guzzlehttp/guzzle

$client = new \GuzzleHttp\Client([
    'headers' => [
        'Authorization' => 'Bearer '.getenv('TEXTME_API_TOKEN'),
        'Accept' => 'application/json',
    ],
]);

$response = $client->post('https://my.textme.co.il/api', [
    'json' => [
        'bulk' => [
            'user' => [
                'username' => 'Leeroy',
            ],
            'messages' => [
                'sms' => [
                    [
                        'source' => 'DemoAPI',
                        'destinations' => [
                            'phone' => [
                                [
                                    '$' => [
                                        'id' => 'external id1',
                                    ],
                                    '_' => '5xxxxxxxx',
                                ],
                                [
                                    '$' => [
                                        'id' => 'external id2',
                                    ],
                                    '_' => '5xxxxxxxx',
                                ],
                                [
                                    '_' => '5xxxxxxxx',
                                ],
                                [
                                    '$' => [
                                        'id' => '',
                                    ],
                                    '_' => '5xxxxxxxx',
                                ],
                            ],
                        ],
                        'message' => 'This is a sample message',
                    ],
                    [
                        'source' => 'DemoAPI',
                        'destinations' => [
                            'phone' => [
                                '$' => [
                                    'id' => '',
                                ],
                                '_' => '5xxxxxxxx',
                            ],
                        ],
                        'message' => 'This is a different message sent. [link-a1]',
                        'links' => [
                            'link' => [
                                [
                                    '$' => [
                                        'id' => 'a1',
                                    ],
                                    '_' => 'https://www.example.com/path/to/resource',
                                ],
                            ],
                        ],
                    ],
                ],
            ],
            'timing' => '10/10/17 10:10',
            'temp_bl' => '2',
            'includes_international' => '1',
            'campaign_name' => 'Sample Bulk Campaign',
        ],
    ],
]);

$result = json_decode($response->getBody()->getContents(), true);

// גם שגיאה חוזרת כ-HTTP 200, לכן הסטטוס שבגוף התשובה הוא הקובע
if ((int) $result['status'] !== 0) {
    throw new RuntimeException("TextMe {$result['status']}: {$result['message']}");
}

print_r($result);
```

```php [Laravel]
<?php

use Illuminate\Support\Facades\Http;

$result = Http::withToken(config('services.textme.token'))
    ->acceptJson()
    ->post('https://my.textme.co.il/api', [
        'bulk' => [
            'user' => [
                'username' => 'Leeroy',
            ],
            'messages' => [
                'sms' => [
                    [
                        'source' => 'DemoAPI',
                        'destinations' => [
                            'phone' => [
                                [
                                    '$' => [
                                        'id' => 'external id1',
                                    ],
                                    '_' => '5xxxxxxxx',
                                ],
                                [
                                    '$' => [
                                        'id' => 'external id2',
                                    ],
                                    '_' => '5xxxxxxxx',
                                ],
                                [
                                    '_' => '5xxxxxxxx',
                                ],
                                [
                                    '$' => [
                                        'id' => '',
                                    ],
                                    '_' => '5xxxxxxxx',
                                ],
                            ],
                        ],
                        'message' => 'This is a sample message',
                    ],
                    [
                        'source' => 'DemoAPI',
                        'destinations' => [
                            'phone' => [
                                '$' => [
                                    'id' => '',
                                ],
                                '_' => '5xxxxxxxx',
                            ],
                        ],
                        'message' => 'This is a different message sent. [link-a1]',
                        'links' => [
                            'link' => [
                                [
                                    '$' => [
                                        'id' => 'a1',
                                    ],
                                    '_' => 'https://www.example.com/path/to/resource',
                                ],
                            ],
                        ],
                    ],
                ],
            ],
            'timing' => '10/10/17 10:10',
            'temp_bl' => '2',
            'includes_international' => '1',
            'campaign_name' => 'Sample Bulk Campaign',
        ],
    ])
    ->throw()
    ->json();

// גם שגיאה חוזרת כ-HTTP 200, לכן הסטטוס שבגוף התשובה הוא הקובע
throw_if((int) $result['status'] !== 0, RuntimeException::class,
    "TextMe {$result['status']}: {$result['message']}");

logger()->info('TextMe', $result);
```

```python [Python]
# pip install httpx
import os

import httpx

response = httpx.post(
    "https://my.textme.co.il/api",
    headers={"Authorization": f"Bearer {os.environ['TEXTME_API_TOKEN']}"},
    json={
        "bulk": {
            "user": {
                "username": "Leeroy",
            },
            "messages": {
                "sms": [
                    {
                        "source": "DemoAPI",
                        "destinations": {
                            "phone": [
                                {
                                    "$": {
                                        "id": "external id1",
                                    },
                                    "_": "5xxxxxxxx",
                                },
                                {
                                    "$": {
                                        "id": "external id2",
                                    },
                                    "_": "5xxxxxxxx",
                                },
                                {
                                    "_": "5xxxxxxxx",
                                },
                                {
                                    "$": {
                                        "id": "",
                                    },
                                    "_": "5xxxxxxxx",
                                },
                            ],
                        },
                        "message": "This is a sample message",
                    },
                    {
                        "source": "DemoAPI",
                        "destinations": {
                            "phone": {
                                "$": {
                                    "id": "",
                                },
                                "_": "5xxxxxxxx",
                            },
                        },
                        "message": "This is a different message sent. [link-a1]",
                        "links": {
                            "link": [
                                {
                                    "$": {
                                        "id": "a1",
                                    },
                                    "_": "https://www.example.com/path/to/resource",
                                },
                            ],
                        },
                    },
                ],
            },
            "timing": "10/10/17 10:10",
            "temp_bl": "2",
            "includes_international": "1",
            "campaign_name": "Sample Bulk Campaign",
        },
    },
)
response.raise_for_status()
result = response.json()

# גם שגיאה חוזרת כ-HTTP 200, לכן הסטטוס שבגוף התשובה הוא הקובע
if int(result["status"]) != 0:
    raise RuntimeError(f"TextMe {result['status']}: {result['message']}")

print(result)
```

```go [Go]
package main

import (
	"bytes"
	"encoding/json"
	"fmt"
	"net/http"
	"os"
)

func main() {
	payload, _ := json.Marshal(map[string]any{
		"bulk": map[string]any{
			"user": map[string]any{
				"username": "Leeroy",
			},
			"messages": map[string]any{
				"sms": []any{
					map[string]any{
						"source": "DemoAPI",
						"destinations": map[string]any{
							"phone": []any{
								map[string]any{
									"$": map[string]any{
										"id": "external id1",
									},
									"_": "5xxxxxxxx",
								},
								map[string]any{
									"$": map[string]any{
										"id": "external id2",
									},
									"_": "5xxxxxxxx",
								},
								map[string]any{
									"_": "5xxxxxxxx",
								},
								map[string]any{
									"$": map[string]any{
										"id": "",
									},
									"_": "5xxxxxxxx",
								},
							},
						},
						"message": "This is a sample message",
					},
					map[string]any{
						"source": "DemoAPI",
						"destinations": map[string]any{
							"phone": map[string]any{
								"$": map[string]any{
									"id": "",
								},
								"_": "5xxxxxxxx",
							},
						},
						"message": "This is a different message sent. [link-a1]",
						"links": map[string]any{
							"link": []any{
								map[string]any{
									"$": map[string]any{
										"id": "a1",
									},
									"_": "https://www.example.com/path/to/resource",
								},
							},
						},
					},
				},
			},
			"timing": "10/10/17 10:10",
			"temp_bl": "2",
			"includes_international": "1",
			"campaign_name": "Sample Bulk Campaign",
		},
	})

	req, _ := http.NewRequest("POST", "https://my.textme.co.il/api", bytes.NewReader(payload))
	req.Header.Set("Authorization", "Bearer "+os.Getenv("TEXTME_API_TOKEN"))
	req.Header.Set("Content-Type", "application/json")

	res, err := http.DefaultClient.Do(req)
	if err != nil {
		panic(err)
	}
	defer res.Body.Close()

	var result struct {
		Status  json.Number `json:"status"`
		Message string      `json:"message"`
	}
	if err := json.NewDecoder(res.Body).Decode(&result); err != nil {
		panic(err)
	}

	// גם שגיאה חוזרת כ-HTTP 200, לכן הסטטוס שבגוף התשובה הוא הקובע
	if result.Status.String() != "0" {
		panic(fmt.Sprintf("TextMe %s: %s", result.Status, result.Message))
	}

	fmt.Println(result.Message)
}
```

```java [Java]
// Java 17+ באמצעות java.net.http. ללא תלויות (פענוח עם Jackson/Gson)
import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;

public class TextMeSendBulk {
    public static void main(String[] args) throws Exception {
        String body = """
            {
              "bulk": {
                "user": {
                  "username": "Leeroy"
                },
                "messages": {
                  "sms": [
                    {
                      "source": "DemoAPI",
                      "destinations": {
                        "phone": [
                          {
                            "$": {
                              "id": "external id1"
                            },
                            "_": "5xxxxxxxx"
                          },
                          {
                            "$": {
                              "id": "external id2"
                            },
                            "_": "5xxxxxxxx"
                          },
                          {
                            "_": "5xxxxxxxx"
                          },
                          {
                            "$": {
                              "id": ""
                            },
                            "_": "5xxxxxxxx"
                          }
                        ]
                      },
                      "message": "This is a sample message"
                    },
                    {
                      "source": "DemoAPI",
                      "destinations": {
                        "phone": {
                          "$": {
                            "id": ""
                          },
                          "_": "5xxxxxxxx"
                        }
                      },
                      "message": "This is a different message sent. [link-a1]",
                      "links": {
                        "link": [
                          {
                            "$": {
                              "id": "a1"
                            },
                            "_": "https://www.example.com/path/to/resource"
                          }
                        ]
                      }
                    }
                  ]
                },
                "timing": "10/10/17 10:10",
                "temp_bl": "2",
                "includes_international": "1",
                "campaign_name": "Sample Bulk Campaign"
              }
            }
            """;

        HttpRequest request = HttpRequest.newBuilder(URI.create("https://my.textme.co.il/api"))
            .header("Authorization", "Bearer " + System.getenv("TEXTME_API_TOKEN"))
            .header("Content-Type", "application/json")
            .POST(HttpRequest.BodyPublishers.ofString(body))
            .build();

        HttpResponse<String> response = HttpClient.newHttpClient()
            .send(request, HttpResponse.BodyHandlers.ofString());

        // גם שגיאה חוזרת כ-HTTP 200, לכן הסטטוס שבגוף התשובה הוא הקובע
        System.out.println(response.body());
    }
}
```

```csharp [C#]
// .NET 8+ using System.Net.Http
using System.Net.Http.Headers;
using System.Text;
using System.Text.Json;

var payload = """
    {
      "bulk": {
        "user": {
          "username": "Leeroy"
        },
        "messages": {
          "sms": [
            {
              "source": "DemoAPI",
              "destinations": {
                "phone": [
                  {
                    "$": {
                      "id": "external id1"
                    },
                    "_": "5xxxxxxxx"
                  },
                  {
                    "$": {
                      "id": "external id2"
                    },
                    "_": "5xxxxxxxx"
                  },
                  {
                    "_": "5xxxxxxxx"
                  },
                  {
                    "$": {
                      "id": ""
                    },
                    "_": "5xxxxxxxx"
                  }
                ]
              },
              "message": "This is a sample message"
            },
            {
              "source": "DemoAPI",
              "destinations": {
                "phone": {
                  "$": {
                    "id": ""
                  },
                  "_": "5xxxxxxxx"
                }
              },
              "message": "This is a different message sent. [link-a1]",
              "links": {
                "link": [
                  {
                    "$": {
                      "id": "a1"
                    },
                    "_": "https://www.example.com/path/to/resource"
                  }
                ]
              }
            }
          ]
        },
        "timing": "10/10/17 10:10",
        "temp_bl": "2",
        "includes_international": "1",
        "campaign_name": "Sample Bulk Campaign"
      }
    }
    """;

using var http = new HttpClient();
http.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue(
    "Bearer", Environment.GetEnvironmentVariable("TEXTME_API_TOKEN"));

var response = await http.PostAsync("https://my.textme.co.il/api",
    new StringContent(payload, Encoding.UTF8, "application/json"));

var result = JsonDocument.Parse(await response.Content.ReadAsStringAsync()).RootElement;
var status = result.GetProperty("status").ToString();

// גם שגיאה חוזרת כ-HTTP 200, לכן הסטטוס שבגוף התשובה הוא הקובע
if (status != "0")
{
    var message = result.GetProperty("message").ToString();
    throw new Exception($"TextMe {status}: {message}");
}

Console.WriteLine(result);
```

```ruby [Ruby]
require "net/http"
require "json"

uri = URI("https://my.textme.co.il/api")

request = Net::HTTP::Post.new(uri)
request["Authorization"] = "Bearer #{ENV.fetch('TEXTME_API_TOKEN')}"
request["Content-Type"] = "application/json"
request.body = JSON.dump({
  "bulk" => {
    "user" => {
      "username" => "Leeroy",
    },
    "messages" => {
      "sms" => [
        {
          "source" => "DemoAPI",
          "destinations" => {
            "phone" => [
              {
                "$" => {
                  "id" => "external id1",
                },
                "_" => "5xxxxxxxx",
              },
              {
                "$" => {
                  "id" => "external id2",
                },
                "_" => "5xxxxxxxx",
              },
              {
                "_" => "5xxxxxxxx",
              },
              {
                "$" => {
                  "id" => "",
                },
                "_" => "5xxxxxxxx",
              },
            ],
          },
          "message" => "This is a sample message",
        },
        {
          "source" => "DemoAPI",
          "destinations" => {
            "phone" => {
              "$" => {
                "id" => "",
              },
              "_" => "5xxxxxxxx",
            },
          },
          "message" => "This is a different message sent. [link-a1]",
          "links" => {
            "link" => [
              {
                "$" => {
                  "id" => "a1",
                },
                "_" => "https://www.example.com/path/to/resource",
              },
            ],
          },
        },
      ],
    },
    "timing" => "10/10/17 10:10",
    "temp_bl" => "2",
    "includes_international" => "1",
    "campaign_name" => "Sample Bulk Campaign",
  },
})

response = Net::HTTP.start(uri.hostname, uri.port, use_ssl: true) do |http|
  http.request(request)
end

result = JSON.parse(response.body)

# גם שגיאה חוזרת כ-HTTP 200, לכן הסטטוס שבגוף התשובה הוא הקובע
raise "TextMe #{result['status']}: #{result['message']}" unless result["status"].to_i.zero?

pp result
```

```rust [Rust]
// [dependencies]
// reqwest = { version = "0.12", features = ["json"] }
// tokio = { version = "1", features = ["full"] }
// serde_json = "1"
use serde_json::{json, Value};

#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
    let result: Value = reqwest::Client::new()
        .post("https://my.textme.co.il/api")
        .bearer_auth(std::env::var("TEXTME_API_TOKEN")?)
        .json(&json!({
          "bulk": {
            "user": {
              "username": "Leeroy"
            },
            "messages": {
              "sms": [
                {
                  "source": "DemoAPI",
                  "destinations": {
                    "phone": [
                      {
                        "$": {
                          "id": "external id1"
                        },
                        "_": "5xxxxxxxx"
                      },
                      {
                        "$": {
                          "id": "external id2"
                        },
                        "_": "5xxxxxxxx"
                      },
                      {
                        "_": "5xxxxxxxx"
                      },
                      {
                        "$": {
                          "id": ""
                        },
                        "_": "5xxxxxxxx"
                      }
                    ]
                  },
                  "message": "This is a sample message"
                },
                {
                  "source": "DemoAPI",
                  "destinations": {
                    "phone": {
                      "$": {
                        "id": ""
                      },
                      "_": "5xxxxxxxx"
                    }
                  },
                  "message": "This is a different message sent. [link-a1]",
                  "links": {
                    "link": [
                      {
                        "$": {
                          "id": "a1"
                        },
                        "_": "https://www.example.com/path/to/resource"
                      }
                    ]
                  }
                }
              ]
            },
            "timing": "10/10/17 10:10",
            "temp_bl": "2",
            "includes_international": "1",
            "campaign_name": "Sample Bulk Campaign"
          }
        }))
        .send()
        .await?
        .json()
        .await?;

    // גם שגיאה חוזרת כ-HTTP 200, לכן הסטטוס שבגוף התשובה הוא הקובע
    if result["status"] != 0 {
        return Err(format!("TextMe {}: {}", result["status"], result["message"]).into());
    }

    println!("{result}");
    Ok(())
}
```

:::

### תשובה

::: code-group

```xml [XML]
<?xml version="1.0" encoding="UTF-8"?>
<sms>
    <status>0</status>
    <message>SMS bulk will be sent</message>
    <shipment_id>xxxxxxx</shipment_id>
</sms>
```

```json [JSON]
{
  "status": 0,
  "message": "SMS bulk will be sent",
  "shipment_id": "XXXXXXX"
}
```

:::

| שדה | סוג | תיאור |
|---|---|---|
| `status` | int | `0`, האצווה נתקבלה. |
| `message` | string | `SMS bulk will be sent`. |
| `shipment_id` | string | מזהה את הקמפיין שנוצר עבור האצווה כולה. |

::: warning מזהה אחד לאצווה כולה
`shipment_id` מזהה את האצווה, לא את ההודעות הבודדות שבתוכה. כדי להתאים נתונים לכל יעד בנפרד, הגדירו תכונת `id` על כל `phone` ושלפו [דוחות מסירה](./reports.md) לפי מזהה חיצוני.
:::

### שגיאות

| Status | מתי |
|---|---|
| `2` | חסר אלמנט חובה; ה-`message` מציין איזה. |
| `4` | אין מספיק יתרה לאצווה. |
| `5` | מחוץ לשעות השליחה המותרות לחשבון. |
| `8` | כל היעדים באצווה ברשימת החסימה. |
| `9` | יעד קצר או ארוך מדי. |
| `515` | אחד ה-`source` אינו שולח מאומת. |
| `714` | `temp_bl` מחוץ לטווח 1 עד 14. |
| `715` | כל היעדים סוננו על ידי `temp_bl`. |
| `989` | גוף הודעה ריק או עובר 1005 תווים, או ש-`campaign_name` עובר 50. |

## הערות על השדות

### מגבלות האצווה

התקרה הקשיחה היא **2,500 אובייקטי `sms` לכל קריאה**: אובייקטים, לא נמענים. אובייקט בודד שמופנה ל-400 מספרים נחשב כאחד. פיצול ריצה גדולה לכמה קריאות הוא בסדר; כל אחת מחזירה `shipment_id` משלה, ומתן אותו `campaign_name` לכולן מאפשר [לבטל את כל הריצה](./campaigns.md) בבקשה אחת.

### הגדרות ברמת ההודעה מול הגדרות ברמת האצווה

זו החלוקה שמבלבלת:

| הגדרה | איפה היא יושבת |
|---|---|
| `source`, `message`, `destinations`, `links` | בתוך כל אובייקט `sms` |
| `timing`, `temp_bl`, `includes_international`, `campaign_name`, `add_unsubscribe` | על שורש ה-`bulk` |

אי אפשר לתזמן הודעות בודדות בתוך אצווה לשעות שונות. שעות שונות פירושן קריאות שונות.

::: tip ממשק ה-SOAP מתנהג אחרת כאן
`sendBulkSms` דרך [SOAP](../reference/soap.md) מתעלם מ-`timing` לחלוטין. פעולת `bulk` המתועדת בעמוד הזה מכבדת אותו ברמת האצווה.
:::

### פרסונליזציה

`bulk` מבצעת פרסונליזציה מעצם המבנה: אתם בונים את הטקסט המדויק לכל נמען. זה הכלי הנכון כשהחלק המשתנה מגיע ממסד הנתונים שלכם. מספר הזמנה, חלון מסירה, קוד חד-פעמי.

כשהחלק המשתנה כבר שמור ב-TextMe, [`sms` עם `add_dynamic`](./send.md#mixing-phones-and-contact-lists) דורשת פחות עבודה: שמרו את ערכי המיזוג כשדות דינמיים ב[רשימת תפוצה](./contact-lists.md) ושלחו הודעה אחת עם תבנית. ראו [שליחה מרובה ופרסונליזציה](../use-cases/bulk-and-personalisation.md) כדי לבחור.
