Send Bulk SMS

Use this endpoint to send one, or many SMS to one, or many contacts with 1 request. This is great for mailshots, or where you want to vary the message per contact without sending 1 request per contact

Endpoint

[POST] https://usenotifier.com/api/sms/bulk

Example Request

$response = Http::withToken('YOUR_API_KEY')
               ->post('https://usenotifier.com/api/sms', [
                  [
                     "to" => "+447700900389",
                     "body" => "Message One"
                  ],
                  [
                     "to" => "+447700900077",
                     "body" => "Message Two"
                  ],
                ]);

Read the Authentication docs to get your API KEY

to: required

The recipient's phone number in international format. This must start with a + and the country code. For example the UK phone number 07700900389 should be sent as +447700900389

body: required

The contents of the message. The maximum length of this field is 1024 characters.

Please note that the length of 1 message is 160 characters. Anything above this will be split into multiple messages of 153 characters and cost multiple credits.

uuid: optional

You may pass an optional UUID if you want to know the id of the message in advance. This is optional and we will create a UUID per message. The response of your request will give you this UUID.

If you want generate your own you can do so programmatically or use a tool like https://www.uuidgenerator.net/version1

sender: optional

You can pass over the name of an approved sender. If you have more than one approved sender you can switch between them by passing over this key, with the name of the sender as its value. If you do not pass the sender we will use the default sender set up in your Settings area.

shortenLinks: optional

By default Notifier will replace your URLs with short links using the ntfy.app domain. This saves you characters and lets you have more text to your messages. If you want to turn this off, and use the full length URL that you sent over, pass over boolean false as the value.

scheduled_at: optional

You can tell Notifier to hold off sending your message until a date/time in the future. This field expects a datetime in the following format: YYYY-MM-DD HH:MM:SS for the UTC timezone. Alternatively you can send over a unix timestamp e.g. 1665600109. Your message will be sent automatically at the time you have set in this field.

campaign: optional

You can group your messages by a campaign, by sending over the name of the campaign. For example you may want to run a campaign for Black Friday. To do this send a field called campaign with the value Black Friday and we will group them all together.

campaignTracking: optional

You can add a customer tracking parameter to your shortened links. This will be added to the query string of the redirected URL of the short link. The key will be ntfy_campaign and the value will be whatever you pass via this parameter.

Note that this requires shortenLinks so you cannot turn this off.

Example Response

All dates and times are UTC

{
    "data": [
        {
            "uuid": "b2b14b1d-95d5-4751-9e53-41f6a3629950",
            "to": "+447700900389",
            "sender": "NTFY",
            "body": "Message One",
            "campaign": "Black Friday",
            "credits_used": 1,
            "status": "pending",
            "failure_reason": null,
            "created_at": "2022-09-26T08:47:16.000000Z",
            "sent_at": null,
            "delivered_at": null,
            "contact": {
                "uuid": "0338181e-358c-41f4-b914-8533df524aae",
                "firstname": "John",
                "lastname": "Smith",
                "created_at": "2022-09-01T16:45:32.000000Z",
                "contact_methods": [
                    {
                        "uuid": "6e7b6c86-4d24-41e4-9328-ec55ac088e9a",
                        "type": "phone",
                        "address": "+447700900389",
                        "created_at": "2022-09-06T16:45:32.000000Z",
                        "updated_at": "2022-09-06T16:45:32.000000Z"
                    }
                ]
            }
        },
        {
            "uuid": "efacb5a0-7d68-49ad-b6c0-e985db70a92f",
            "to": "+447700900077",
            "body": "Message Two",
            "status": "pending",
            "failure_reason": null,
            "created_at": "2022-09-26T08:47:16.000000Z",
            "scheduled_at":  "2022-09-25T22:00:00.000000Z",
            "sent_at": null,
            "delivered_at": null,
            "contact": {
                "uuid": "c7588eb0-aa97-4d6a-b6cc-86c7209005b0",
                "firstname": null,
                "lastname": null,
                "created_at": "2022-09-25T20:25:02.000000Z",
                "contact_methods": [
                    {
                        "uuid": "ed59b6f9-3b0c-4eaf-a380-a321eb98e195",
                        "type": "phone",
                        "address": "+447700900077",
                        "created_at": "2022-09-25T20:25:02.000000Z",
                        "updated_at": "2022-09-25T20:25:02.000000Z"
                    }
                ]
            }
        }
    ]
}

Webhook

coming soon

Last updated

Was this helpful?