Before you start

You need a Base44 app on a plan that includes backend functions, and a BulkSMS account with credits.

Base44 doesn't have a built-in BulkSMS integration, so this guide adds a small backend function to your app that calls the BulkSMS API. Your API token is stored as a Base44 secret and is never sent to the browser.

Create a BulkSMS API token

Log in to your BulkSMS account and go to Settings > Developers.

Click Create API Token and give it a name, for example Base44. Copy the Token ID and Token Secret. The secret is only shown once.

Add the token to your app's secrets

Open your app in the Base44 editor and go to Dashboard > Secrets.

Click Add Secret and add two secrets:

Name Value
BULKSMS_TOKEN_ID Your Token ID
BULKSMS_TOKEN_SECRET Your Token Secret

If the Base44 AI chat asks for these values while it builds the function, you can enter them there instead.

Create the sendSms backend function

The easiest way is to ask the Base44 AI chat to build it. Paste this prompt and adjust the last sentence to suit your app:

Create a backend function called sendSms that sends a text message with the BulkSMS API.
- POST to https://api.bulksms.com/v1/messages?auto-unicode=true
- Use HTTP Basic authentication with the secrets BULKSMS_TOKEN_ID (username) and BULKSMS_TOKEN_SECRET (password).
- Send a JSON body with "to" (the phone number in international format, e.g. +447700900123) and "body" (the message text). Add "from" only if a sender ID is passed in.
- Return the BulkSMS response and status code.
- Only allow signed-in users to call it.
Call sendSms when a booking is confirmed, to text the customer their booking details.

Prefer to write it yourself? Go to Dashboard > Code > Functions, create a function called sendSms and use this code:

Deno.serve(async (req) => {
    const { to, body, from } = await req.json();
    const auth = btoa(Deno.env.get("BULKSMS_TOKEN_ID") + ":" + Deno.env.get("BULKSMS_TOKEN_SECRET"));

    const response = await fetch("https://api.bulksms.com/v1/messages?auto-unicode=true", {
        method: "POST",
        headers: { "Authorization": "Basic " + auth, "Content-Type": "application/json" },
        body: JSON.stringify(from ? { to, body, from } : { to, body })
    });

    return new Response(await response.text(), {
        status: response.status,
        headers: { "Content-Type": "application/json" }
    });
});

Anyone who can call the function can spend your BulkSMS credits, so limit it to signed-in users (or admins) before you publish your app. The AI chat can add this for you.

Send an SMS from your app

Ask the AI chat to call sendSms wherever you need it, for example when a form is submitted, an order is placed or a status changes. In your app's code, the call looks like this:

await base44.functions.invoke("sendSms", {
    to: "+447700900123",
    body: "Hi Sam, your booking for Tuesday at 10am is confirmed."
});

Add from: "YourSenderID" to send from a registered Sender ID. Numbers should be in international format, for example +447700900123.

Test it

Trigger a send in your app to your own number. A successful send returns status 201.

If nothing arrives, open Dashboard > Code > Functions, select sendSms and check its logs for the BulkSMS response.

Receive replies and delivery reports (optional)

Ask the AI chat to create a backend function called receiveSms that accepts a POST from BulkSMS and saves each message, for example to a Messages entity.

Its public address is https://your-app.base44.app/functions/receiveSms, using your app's own domain.

In BulkSMS, go to Settings > Advanced > Webhooks, create a webhook for received messages (or for delivery reports), and paste the address.

Replies only come back to messages sent from a repliable sender, such as a BulkSMS number, not from a text Sender ID.

Troubleshooting

Backend functions aren't available: check your Base44 plan includes them.

401 Unauthorized: check the secret names match exactly and hold the Token ID and Token Secret.

400 Bad Request: check the number is in international format and the message isn't empty.

403 Forbidden: check your BulkSMS account has credits.

All setup and ready to go!

If you have any questions, please contact our support team. Include your account name and put Base44 in the subject line, and we'll be happy to help.

For all API options, see the BulkSMS JSON API documentation and Base44's backend functions documentation.

Struggling with one or more steps? Our support team can help you get set up.