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.
- Free 14 days trial
- No credit card required
- Cancel Anytime
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_KEYwith your actual key GETwith the recipient’s numberThis%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
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#
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
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
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#
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:
{
"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:
{
"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
- URL:
https://app.smsdojo.io/services/get-msgs.php - Method:
GET
Request Parameters
- key: Your unique API key (required).
- status: Filter messages by status. Options include:
ReceivedPendingSentFailedQueuedDeliveredScheduled
Example Request:
GET https://app.smsdojo.io/services/get-msgs.php?key=dcf65ee699fe13eec2baaf06d1cfb6826e150a0d&status=Received
Example Code Snippets:
cURL
curlA "https://app.smsdojo.io/services/get-msgs.php?key=dcf65ee699fe13eec2baaf06d1cfb6826e150a0d&status=Received"
PHP:
$url = "https://app.smsdojo.io/services/get-msgs.php?key=dcf65ee699fe13eec2baaf06d1cfb6826e150a0d&status=Received";
$response = file_get_contents($url);
echo $response;
JavaScript (Fetch):
fetch("https://app.smsdojo.io/services/get-msgs.php?key=dcf65ee699fe13eec2baaf06d1cfb6826e150a0d&status=Received")
.then(response => response.json())
.then(data => console.log(data));
Python
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#
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
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.
{
"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_KEYfor hashing signatures. This key will authenticate incoming requests to ensure security.
Prerequisites
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.
<?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
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
- Log in to the SMSdojo Webhook Management.
- Enter your webhook URL, where SMSdojo will send requests.
- Select the types of events (e.g., SMS, USSD) you want to receive at this endpoint.
- 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!
- Email:
support@smsdojo.io
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.
Key Features
Powerful Tools for SMS Automation
Unlock the full potential of n8n and SMSDojo with these essential features.
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.
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.
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.