Boost Elevate Maximize Streamline SMS with n8n and SMSDojo effortlessly today!

Supercharge your SMS sending with n8n’s automation. Connect SMSDojo, streamline campaigns, and manage replies—all from one platform.

How It Works

The Smsdojo API allows you to send SMS messages through your Android device as a gateway. To use this API, you must:

  • Connect your phone to SMSDojo:
    Install the SMSDojo Android app and get your API Key from Dashboard
  • Create a Workflow in n8n:
    Use the HTTP Request node to send a GET request to the SMSDojo API.
  • Use this API format:
🎨
https://app.smsdojo.io/services/send.php?key=YOUR_API_KEY&number=0608918217&message=This+message&devices=%5B%22182%7C0%22%2C%22182%7C1%22%5D&type=sms&prioritize=0

Replace:

  •  YOUR_API_KEY with your actual key
  • GETwith the recipient’s number
  • This%20messagewith your SMS content (URL encoded)
  • deviceswith your Device ID from SMSDojo

Example Use Cases

  • E-commerce: Send SMS when orders are confirmed or shipped.
  • CRM: Notify your sales team when leads come in.
  • Support:Alert customers when support tickets are updated.
  • Marketing: Send promotional SMS in bulk with personalized messages.

Start Sending SMS from n8n in 3 Minutes

✅ No SMS API costs
✅ Unlimited messages from your SIM
✅ Full control and flexibility
✅ Just your phone + SMSDojo + n8n

🐘
<?php
$response = file_get_contents("https://app.smsDojoy=YOUR_API_KEY&number=0608918217&message=This+message&devices=%5B%22182%7C0%22%2C%22182%7C1%22%5D&type=sms&prioritize=0");
$data = json_decode($response, true);
print_r($data);
?>

React

⚛️
cURL.jsx
import React, { useEffect, useState } from 'react';

function App() {
  const [data, setData] = useState(null);

  useEffect(() => {
    fetch('https://app.smsdojo.io/services/send.php?key=YOUR_API_KEY&number=0608918217&message=This%20message&devices=%5B%22182%7C0%22%2C%22182%7C1%22%5D&type=sms&prioritize=0')
      .then(response => response.json())
      .then(data => setData(data))
      .catch(error => console.error('Error:', error));
  }, []);

  return <div>{data && JSON.stringify(data)}</div>;
}

export default App;

C#

🐘
cURL.php
using System;
using System.Net.Http;
using System.Threading.Tasks;

class Program {
    static async Task Main(string[] args) {
        using HttpClient client = new HttpClient();
        string url = "https://app.smsdojo.io/services/send.php?key=YOUR_API_KEY&number=0608918217&message=This+message&devices=%5B%22182%7C0%22%2C%22182%7C1%22%5D&type=sms&prioritize=0";
        HttpResponseMessage response = await client.GetAsync(url);
        string result = await response.Content.ReadAsStringAsync();
        Console.WriteLine(result);
    }
}

Python

📄
JavaScript (Fetch):.js
import requests

url = "https://app.smsdojo.io/services/send.php"
params = {
    "key": "YOUR_API_KEY",
    "number": "0608918217",
    "message": "This message",
    "devices": '["182|0","182|1"]',
    "type": "sms",
    "prioritize": 0
}

response = requests.get(url, params=params)
print(response.json())

Java

🐍
React.py
import requests

url = "https://app.smsdojo.io/services/get-msgs.php"
params = {
    "key": "dcf65ee699fe13eec2baaf06d1cfb6826e150a0d",
    "status": "Received"
}
response = requests.get(url, params=params)
print(response.json())

C#

🔷
C#.cs
import java.io.*;
import java.net.*;

public class Smsdojo {
    public static void main(String[] args) throws Exception {
        String urlStr = "https://app.smsdojo.io/services/send.php?key=YOUR_API_KEY&number=0608918217&message=This+message&devices=%5B%22182%7C0%22%2C%22182%7C1%22%5D&type=sms&prioritize=0";
        URL url = new URL(urlStr);
        HttpURLConnection connection = (HttpURLConnection) url.openConnection();
        connection.setRequestMethod("GET");

        BufferedReader in = new BufferedReader(new InputStreamReader(connection.getInputStream()));
        String inputLine;
        StringBuffer content = new StringBuffer();
        while ((inputLine = in.readLine()) != null) {
            content.append(inputLine);
        }
        in.close();
        System.out.println(content.toString());
    }
}

Response Format

Success Response

A successful request returns a JSON object with detailed message information:

📄
{
  "success": true,
  "data": {
    "messages": [
      {
        "ID": 296180,
        "number": "0608918217",
        "message": "This message",
        "deviceID": 182,
        "simSlot": 0,
        "schedule": null,
        "userID": 1,
        "groupID": "DEGxMhxJiQUpU9F6nY671d682d63d9e2.96844762",
        "status": "Pending",
        "resultCode": null,
        "errorCode": null,
        "type": "sms",
        "attachments": null,
        "prioritize": false,
        "retries": null,
        "sentDate": "2024-10-26T23:07:41+0100",
        "deliveredDate": null,
        "expiryDate": null
      }
    ]
  },
  "error": null
}

Error Response

In case of an error, the API returns a JSON object with an error code and message:

📄
Respond.js
{
  "success": false,
  "data": null,
  "error": {
    "code": 401,
    "message": "This API key is invalid."
  }
}

Balance Query Response

If querying for credits, the response may look like this:

📄
Respond.js
{
  "success": true,
  "data": {
    "credits": null
  },
  "error": null
}

Status Codes

  • 200: Request was successful.
  • 400: Bad request (missing parameters, invalid format).
  • 401: Unauthorized (invalid API key).
  • 500: Internal server error.

Endpoint: Get Message Status

Request Parameters

  • key: Your unique API key (required).
  • status: Filter messages by status. Options include:
  • Received
  • Pending
  • Sent
  • Failed
  • Queued
  • Delivered
  • Scheduled

Example Request:

🎨
GET https://app.smsdojo.io/services/get-msgs.php?key=dcf65ee699fe13eec2baaf06d1cfb6826e150a0d&status=Received

Example Code Snippets:

cURL

📄
cURL.js
curlA "https://app.smsdojo.io/services/get-msgs.php?key=dcf65ee699fe13eec2baaf06d1cfb6826e150a0d&status=Received"

PHP:

🐘
cURL.php
$url = "https://app.smsdojo.io/services/get-msgs.php?key=dcf65ee699fe13eec2baaf06d1cfb6826e150a0d&status=Received";
$response = file_get_contents($url);
echo $response;

JavaScript (Fetch):

📄
JavaScript (Fetch):.js
fetch("https://app.smsdojo.io/services/get-msgs.php?key=dcf65ee699fe13eec2baaf06d1cfb6826e150a0d&status=Received")
  .then(response => response.json())
  .then(data => console.log(data));

Python

🐍
React.py
import requests

url = "https://app.smsdojo.io/services/get-msgs.php"
params = {
    "key": "dcf65ee699fe13eec2baaf06d1cfb6826e150a0d",
    "status": "Received"
}
response = requests.get(url, params=params)
print(response.json())

C#

🔷
C#.cs
using System;
using System.Net.Http;
using System.Threading.Tasks;

class Program {
    static async Task Main(string[] args) {
        using HttpClient client = new HttpClient();
        string url = "https://app.smsdojo.io/services/send.php?key=YOUR_API_KEY&number=0608918217&message=This+message&devices=%5B%22182%7C0%22%2C%22182%7C1%22%5D&type=sms&prioritize=0";
        HttpResponseMessage response = await client.GetAsync(url);
        string result = await response.Content.ReadAsStringAsync();
        Console.WriteLine(result);
    }
}

Java

Java.java
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.net.HttpURLConnection;
import java.net.URL;

public class GetMessageStatus {
    public static void main(String[] args) throws Exception {
        String url = "https://app.smsdojo.io/services/get-msgs.php?key=dcf65ee699fe13eec2baaf06d1cfb6826e150a0d&status=Received";
        URL obj = new URL(url);
        HttpURLConnection con = (HttpURLConnection) obj.openConnection();
        con.setRequestMethod("GET");
        BufferedReader in = new BufferedReader(new InputStreamReader(con.getInputStream()));
        String inputLine;
        StringBuffer content = new StringBuffer();
        while ((inputLine = in.readLine()) != null) {
            content.append(inputLine);
        }
        in.close();
        System.out.println(content.toString());
    }
}

Possible Response Format

  • Success Response: Message status details

Java

📄
{
  "success": true,
  "data": {
    "messages": [
      {
        "ID": 296180,
        "number": "0608918217",
        "message": "This message",
        "deviceID": 182,
        "status": "Delivered",
        // Additional fields...
      }
    ]
  },
  "error": null
}

Error Response

Example of an invalid API key error.

📄
Respond.js
{
  "success": false,
  "data": null,
  "error": {
    "code": 401,
    "message": "This API key is invalid."
  }
}

SMSdojo Webhook

This documentation provides an overview of setting up and handling webhooks for SMSDojo, allowing developers to receive and respond to events like incoming messages or USSD requests. Webhooks can be configured and managed in the SMSDojo Webhook Management.

Introduction

Webhooks in SMSDojo let you automatically trigger specific actions when events occur, like receiving an SMS message or a USSD request on your connected Android device. You can set up a URL endpoint on your server that SMSDojo can call, delivering event data in real-time. This integration makes it easy to automate responses or trigger workflows based on the incoming data.

Prerequisites

  • Webhook URL:: You’ll need an endpoint on your server to receive SMSDojo webhook requests.
  • API Key: Define your unique API_KEY for hashing signatures. This key will authenticate incoming requests to ensure security.

Prerequisites

Each webhook request contains a signature in the HTTP_X_SG_SIGNATURE header to verify the request authenticity. Use your API_KEY to hash the message content and compare it against this signature.

Example Code

Here is a PHP example to help developers get started with SMSDojo Webhooks. This script listens for incoming SMS messages and USSD requests, verifies the signature, and processes the data.

🐘
cURL.php
<?php
// Replace with your API Key
define("API_KEY", "dcf65ee699fe13eec2baaf06d1cfb6826e150a0d");

try {
    if (isset($_SERVER["HTTP_X_SG_SIGNATURE"])) {
        // Handling incoming SMS messages
        if (isset($_POST["messages"])) {
            $hash = base64_encode(hash_hmac('sha256', $_POST["messages"], API_KEY, true));
            if ($hash === $_SERVER["HTTP_X_SG_SIGNATURE"]) {
                $messages = json_decode($_POST["messages"], true);

                foreach ($messages as $message) {
                    // Check if message content is "hi" and respond
                    if (strtolower($message["message"]) === "hi") {
                        // You can respond using an API call here, for example:
                        // sendReply($message["number"], "Hello! How can I help you?");
                    }
                }
            } else {
                throw new Exception("Signature doesn't match!");
            }
        }
        // Handling USSD requests
        else if (isset($_POST["ussdRequest"])) {
            $hash = base64_encode(hash_hmac('sha256', $_POST["ussdRequest"], API_KEY, true));
            if ($hash === $_SERVER["HTTP_X_SG_SIGNATURE"]) {
                $ussdRequest = json_decode($_POST["ussdRequest"]);
                $deviceID = $ussdRequest->deviceID;
                $simSlot = $ussdRequest->simSlot;
                $request = $ussdRequest->request;
                $response = $ussdRequest->response;

                // Perform actions based on USSD data
            } else {
                throw new Exception("Signature doesn't match!");
            }
        }
    } else {
        http_response_code(400);
        error_log("Signature not found!");
    }
} catch (Exception $e) {
    http_response_code(401);
    error_log($e->getMessage());
}
?>

Explanation of Fields

Incoming SMS Messages

The webhook receives SMS messages in the messages array, where each message has the following structure:
  • ID: Unique identifier of the message.
  • number: The sender’s phone number.
  • message: The content of the SMS.
  • deviceID: The ID of the device that received the message.
  • simSlot: The SIM slot that received the message.
  • userID: User ID associated with the message.
  • status: Current status of the message (e.g., “Received”).
  • sentDate: Date and time the message was received on the device.
  • deliveredDate: Date and time the message was received by the server.
  • groupID: If the message is part of a group, it contains the group ID; otherwise, it’s null.

Incoming USSD Requests

USSD requests have the following fields:

  • deviceID: The ID of the device that received the USSD request.
  • simSlot: The SIM slot from which the request was received.
  • request: The USSD code entered.
  • response: Response text associated with the USSD request.

Setting Up Webhooks on SMSDojo

  1. Log in to the SMSdojo Webhook Management.
  2. Enter your webhook URL, where SMSdojo will send requests.
  3. Select the types of events (e.g., SMS, USSD) you want to receive at this endpoint.
  4. Save your settings.

This concludes the SMSDojo Webhook documentation, providing developers with the necessary information to set up and handle SMSDojo webhooks.

Contact information

For any additional questions, technical support, or feature requests, please don’t hesitate to reach out. We’re here to assist you in making the most of your SMSDojo experience!

Thank you for choosing SMSdojo for your SMS solutions!

Supercharge Campaign

Why Choose n8n with SMSDojo?

Integrate n8n with SMSDojo to streamline your SMS campaigns. Automate sending, track performance, and boost customer engagement effortlessly.

  • Unlimited SMS Automation Send bulk messages using n8n workflows with your phone.
  • Real-Time Insights Monitor delivery and responses instantly with SMSdojo.
  • Custom Workflows Create tailored automation for notifications and replies.
Key Features

Powerful Tools for SMS Automation

Unlock the full potential of n8n and SMSDojo with these essential features.

  • Two-Way Messaging Receive and reply to SMS via your phone or n8n platform.
  • Bulk SMS Upload Import contacts from Excel for mass messaging with ease.
  • Automated Campaigns Set up scheduled or triggered SMS sends with n8n.
How It Works

Simple Steps to Automate SMS

Get started with n8n and SMSDojo in minutes and unlock a seamless automation experience. Transform your SMS strategy with an easy-to-follow process designed to save time and boost efficiency.

  • Connect Your Phone Link your Android device to SMSDojo for sending.
  • Set Up n8n Workflows Configure automation rules in n8n.
  • Send and Automate Launch campaigns and manage replies seamlessly.
Benefits

Experience the key advantages of n8n with SMSdojo, enhancing your SMS strategy efficiently.

  • Cost-Effective Use your own phone number to save on costs.
  • Scalable Solutions Handle growing SMS needs with n8n automation.
  • Enhanced Engagement Deliver instant, personalized messages effortlessly.
Unique Features

What Sets Our n8n-SMSdojo Integration Apart

Explore the unique features that set n8n with SMSdojo apart, enhancing SMS automation with efficient, flexible tools.

Customer Engagement

Your Guide to n8n with SMSdojo Integration

Find answers to common queries about automating SMS with n8n and SMSdojo.

It’s an integration that automates SMS sending using n8n workflows and SMSdojo’s gateway.
No, just use your Android phone to send SMS through SMSdojo.
Yes, import contacts and automate mass sends with n8n workflows.
Enable two-way communication via n8n or your phone with SMSdojo.
Start with 100 free messages and scale as needed with n8n.
Add to a blocklist in n8n or let users opt-out with "STOP" via SMSdojo. 6.1s
Flexible Pricing

Free Trial Get 100 free messages to test the integration.

Join now and transform your SMS strategy with n8n and SMSdojo.

Start free trial

We bring together everything that’s required to build websites. Reach more customers, save time and money, and boost sales.

Edit Content
Click on the Edit Content button to edit/add the content.