How to Integrate Burst SMS with Zoho CRM Using Deluge Scripting

How to Integrate Burst SMS with Zoho CRM Using Deluge Scripting

Why Integrate Burst SMS with Zoho CRM?

SMS is one of the most powerful communication channels available to businesses today. Unlike email, which can sit unread for hours or days, text messages are almost always opened within the first few minutes of delivery — with open rates consistently reported above 90%.

When you pair that reach with the rich contact data and workflow automation inside Zoho CRM, you gain the ability to reach customers at exactly the right moment: right after a sales call is logged, when a deal advances to a new stage, or when a support ticket is created.

Burst SMS (which operates through the Transmit SMS API) provides a clean, REST-based interface that Zoho’s built-in Deluge scripting language can call natively using the invokeurl function. This means:

  • No third-party middleware required
  • No Zapier subscription needed
  • No additional monthly costs beyond your SMS plan
  • Full control over message content, timing, and logic

What You Need Before You Start

Before writing a single line of code, make sure you have the following in place:

  • ✅ An active Burst SMS / Transmit SMS account with valid API credentials
  • ✅ Your Base64-encoded API key and secret (instructions below)
  • ✅ A Zoho CRM account with permission to create custom functions
  • ✅ At least one Contact record with a mobile number in the Mobile field
  • ✅ A Call record linked to a Contact via the Who_Id field

ℹ️ About the Authorization Header

The Transmit SMS API uses HTTP Basic Authentication. Encode your credentials as Base64(api_key:api_secret). Generate this on any Base64 encoding site, or in a terminal with:

echo -n "your_key:your_secret" | base64

Always ensure there is a single space between “Basic” and the encoded string.

How the Integration Works

The script is triggered from a Zoho CRM workflow when a Call record is saved or updated. Here is the complete flow from trigger to delivered SMS:

1

Fetch the Call Record

The script receives the Call ID from the workflow and pulls the full Call record from Zoho CRM to find the associated contact.

2

Look Up the Contact

Using the Who_Id field, the script fetches the linked Contact’s details including their mobile phone number.

3

Build the SMS Payload

The message text and recipient’s phone number are packaged into a Deluge map (key-value pairs) ready to be sent.

4

Make the API Call

Using Deluge’s native invokeurl block, the script sends a POST request to the Transmit SMS endpoint with the correct authentication headers.

5

Log the Response

The API response is captured using info and viewable inside Zoho CRM’s function execution logs for debugging.

The Complete Deluge Script

Below is the full, production-ready Deluge script. Paste it into your Zoho CRM custom function editor and replace the placeholder with your real Base64-encoded credentials.

Deluge — Zoho CRM Custom Function
// Step 1: Fetch the Call record using the passed-in Call ID
getrecords = zoho.crm.getRecordById("Calls", CallID);

// Step 2: Check if the Call is linked to a Contact (Who_Id)
if (getrecords.getJSON("Who_Id").size() > 0)
{
    // Step 3: Retrieve the associated Contact record
    contact = zoho.crm.getRecordById(
        "Contacts",
        getrecords.getJSON("Who_Id").getJSON("id")
    );

    // Step 4: Build the SMS payload
    mape = Map();
    msg  = "Hey, Powerpal here — we've set you up to claim your "
           + "Solar Victoria rebate to upgrade your hot water system. "
           + "Please complete this ASAP so we can get your heat pump installed.";

    mape.put("message", msg);
    mape.put("to", contact.get("Mobile"));

    // Step 5: Set authentication headers
    headers = Map();
    headers.put("Content-Type", "application/x-www-form-urlencoded");
    headers.put("Authorization", "Basic YOUR_BASE64_ENCODED_CREDENTIALS");

    // Step 6: Send the SMS via Transmit SMS API
    response = invokeurl
    [
        url        : "https://api.transmitsms.com/send-sms.json"
        type       : POST
        parameters : mape
        headers    : headers
    ];

    // Step 7: Log the response for debugging
    info response;
}

⚠️ Security Warning

Never hard-code real API credentials in a shared function environment. Store your Base64 string as a Zoho CRM Custom Variable so it can be updated centrally without touching your function code.

Output

Breaking Down the Script Step by Step

Fetching the Call Record

The custom function receives a CallID parameter passed automatically by the Zoho CRM workflow. The built-in function zoho.crm.getRecordById("Calls", CallID) returns the full Call record as a map, which you query field by field using getJSON().

Checking the Who_Id Field

Not every Call record is linked to a Contact — some may link to a Lead instead. The Who_Id field stores this association. The .size() > 0 check ensures the script only proceeds when a valid Contact link exists, preventing null-pointer errors and accidental API calls with empty recipient data.

Building the Message Payload

The Transmit SMS API accepts a form-encoded POST body with two required fields: to (international format, e.g. 61412345678) and message (your SMS text). Optional parameters include from, schedule, and list_id.

Making the API Call with invokeurl

Deluge’s built-in invokeurl block handles the HTTP request. Setting type : POST and passing the parameters map sends data as form-encoded — exactly what the Transmit SMS endpoint expects. No JSON serialization needed.

Tips, Troubleshooting & Best Practices

1. Format Phone Numbers Correctly

The API requires numbers in international format without the + sign — e.g. 61412345678 for an Australian mobile. Use this snippet to clean numbers automatically:

Deluge — Phone Number Formatting
mobile = contact.get("Mobile");
mobile = mobile.replaceAll(" ", "").replaceAll("-", "");
if (mobile.startsWith("+")) { mobile = mobile.subString(1); }
if (mobile.startsWith("0"))  { mobile = "61" + mobile.subString(1); }
mape.put("to", mobile);

2. Add a Null Check for Missing Mobile Numbers

Not every Contact has a mobile number on file. Add this guard before calling the API to avoid errors:

Deluge — Null Check
if (contact.get("Mobile") != null)
{
    mape.put("to", contact.get("Mobile"));
    // ... proceed with API call
}
else
{
    info "No mobile number found. SMS skipped.";
}

3. Personalise the Message with CRM Data

Pull fields like First_Name from the Contact record to improve engagement:

Deluge — Personalised Message
firstName = contact.get("First_Name");
msg = "Hi " + firstName + ", Powerpal here — your Solar Victoria rebate is ready to claim.";

✅ Pro Tip

Always test using Zoho CRM’s built-in function tester with a known Call ID and your own mobile number before deploying to real contacts. Check the execution log for the info response output. A successful call returns a JSON response containing a message_id and a send_at timestamp.

Conclusion

Integrating Burst SMS with Zoho CRM using Deluge scripting is one of the most cost-effective ways to add real-time SMS automation to your CRM workflows — without any external tools or subscription platforms.

With just a handful of lines of Deluge code, you can automatically send personalised SMS messages the moment a call is logged, a deal stage changes, or any other CRM event fires. This kind of timely communication consistently outperforms email for time-sensitive actions like appointment reminders, rebate claims, or follow-up nudges.

To recap what we covered:

  • How to set up Burst SMS / Transmit SMS API credentials
  • The complete, production-ready Deluge script
  • A step-by-step breakdown of every line of code
  • Best practices for phone number formatting, null checks, and personalisation
  • How to test safely before deploying to real contacts

Have questions or run into an issue? Drop a comment below — we read every one.

Post a Comment