WSDL / SOAP Web Service Integration
The SMSDESK SOAP Web Service provides a standards-compliant WSDL 1.1 / SOAP 1.1 interface for sending SMS messages and retrieving account information. It is compatible with legacy systems, enterprise service buses (ESBs), and any platform that consumes WSDL definitions.
Service Endpoint
Service URL:
https://{host}/api/wsdl/main.asmx
WSDL Definition:
https://{host}/api/wsdl/main.asmx?WSDL
https://desk.sms.com.na (SaaS),
https://sms.yourcompany.com (Enterprise OnSite)
Namespace
http://www.sms.com.na
Protocol Details
| Property | Value |
|---|---|
| Protocol | SOAP 1.1 |
| WSDL Version | WSDL 1.1 |
| Binding | mainSoap |
| Conformance | WS-I Basic Profile 1.1 |
| Transport | HTTP (POST) |
Available Methods
| Method | Parameters | Returns | Description |
|---|---|---|---|
about |
(none) | string | Returns service version information |
sendsms |
key, to, msg, msg_ref |
string | Send SMS to one or more recipients |
get_api_key |
email_address, password, clientid |
string | Retrieve API key for a user |
get_user |
api_key |
array of objects | Get user and client info by API key |
phonebook_size |
key |
string | Get phonebook contact count for a client |
sendsms
Sends SMS message(s) to one or more recipients. The API key authenticates the request and determines the sender's client account and default SMS channel.
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
key |
string | Yes | Your SMSDESK API key |
to |
string | Yes | Recipient phone number(s). Comma-separated for multiple recipients. |
msg |
string | Yes | Message text to send |
msg_ref |
string | No | Optional reference label for tracking (defaults to empty string) |
Response
Returns a comma-separated list of results in plain text:
{sms_id}:{recipient}:{status},{sms_id}:{recipient}:{status},...
Example: 12345:264811234567:PENDING,12346:264812345678:PENDING
A sms_id of 0 with status ERROR indicates that recipient
failed.
get_api_key
Retrieves the API key for a user given their email, password, and client ID. Useful for automated systems that need to authenticate before sending.
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
email_address |
string | Yes | User's email address |
password |
string | Yes | User's password |
clientid |
int | Yes | Client/account ID |
Response
Returns the API key as a string, or an error message if authentication fails.
get_user
Retrieves user and client information associated with an API key.
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
api_key |
string | Yes | The API key to look up |
Response
Returns an array of objects containing user and client details such as
clientid, client_name, userid,
user_email, and channel.
phonebook_size
Returns the total number of contacts in the client's phonebook.
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
key |
string | Yes | Your SMSDESK API key |
Response
Returns the phonebook contact count as a string.
Code Examples
C# (Add Service Reference)
In Visual Studio, right-click your project → Add → Service Reference, and enter the WSDL URL:
https://{host}/api/wsdl/main.asmx?WSDL
using SmsdeskWebService; // namespace from service reference
var client = new mainSoapClient();
// Send SMS
string result = client.sendsms("your-api-key", "264811234567", "Hello from SOAP!", "ref-001");
Console.WriteLine(result);
// Output: 12345:264811234567:PENDING
// Get user info
var userInfo = client.get_user("your-api-key");
foreach (var row in userInfo)
{
Console.WriteLine($"Client: {row["client_name"]}, Email: {row["user_email"]}");
}
// Get phonebook size
string size = client.phonebook_size("your-api-key");
Console.WriteLine($"Phonebook contacts: {size}");
Python (zeep)
from zeep import Client
client = Client("https://{host}/api/wsdl/main.asmx?WSDL")
# Send SMS
result = client.service.sendsms(
key="your-api-key",
to="264811234567",
msg="Hello from Python SOAP!",
msg_ref="PY-001"
)
print(result)
# Output: 12345:264811234567:PENDING
# Get user info
user_info = client.service.get_user(api_key="your-api-key")
for row in user_info:
print(f"Client: {row['client_name']}, Email: {row['user_email']}")
PHP (SoapClient)
<?php
$client = new SoapClient("https://{host}/api/wsdl/main.asmx?WSDL");
// Send SMS
$result = $client->sendsms([
'key' => 'your-api-key',
'to' => '264811234567',
'msg' => 'Hello from PHP SOAP!',
'msg_ref' => 'PHP-001'
]);
echo $result->sendsmsResult;
// Output: 12345:264811234567:PENDING
// Get phonebook size
$size = $client->phonebook_size(['key' => 'your-api-key']);
echo "Phonebook contacts: " . $size->phonebook_sizeResult;
?>
Raw SOAP Request (sendsms)
POST https://{host}/api/wsdl/main.asmx HTTP/1.1
Content-Type: text/xml; charset=utf-8
SOAPAction: "http://www.sms.com.na/sendsms"
<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
<soap:Body>
<sendsms xmlns="http://www.sms.com.na">
<key>your-api-key</key>
<to>264811234567</to>
<msg>Hello from SOAP!</msg>
<msg_ref>ref-001</msg_ref>
</sendsms>
</soap:Body>
</soap:Envelope>
Raw SOAP Response (sendsms)
HTTP/1.1 200 OK
Content-Type: text/xml; charset=utf-8
<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
<soap:Body>
<sendsmsResponse xmlns="http://www.sms.com.na">
<sendsmsResult>12345:264811234567:PENDING</sendsmsResult>
</sendsmsResponse>
</soap:Body>
</soap:Envelope>
Troubleshooting
| Issue | Cause | Solution |
|---|---|---|
| WSDL cannot be imported | Incorrect URL or network/firewall blocking | Verify the WSDL URL is accessible in a browser. Check firewall rules allow HTTPS traffic to the SMSDESK server. |
0:{recipient}:ERROR |
Invalid API key, insufficient credits, or invalid recipient | Verify the API key in the key parameter. Ensure recipient numbers
are in international format without + prefix. |
| SOAP fault on get_api_key | Wrong email/password/clientid combination | Verify credentials match the SMSDESK Portal account. |
| Empty get_user response | API key not found or inactive | Generate a new API key from the SMSDESK Portal. |
| SSL/TLS errors | Client using outdated TLS version | Ensure your SOAP client supports TLS 1.2 or higher. |
