SAP SAP Connect API Documentation

Base URL: https://{host}/api/http/SAPConnect.ashx

Example deployments: https://desk.sms.com.na (SaaS), https://sms.yourcompany.com (Enterprise OnSite)
SAP-Specific API: This endpoint is designed specifically for SAP Business One / SAP ERP integration using SAP Connect framework. It uses SAP's standard parameter naming conventions.

The SAP Connect API provides a simple HTTP GET endpoint for sending SMS messages directly from SAP systems using the SAP Connect messaging framework.

Authentication

Authentication is done via query string parameters using your API credentials:

Required Parameters

Parameter Type Description
password string Your API key (acts as password)
account string Your account identifier (required but value not validated)
Security Note: While this API uses GET requests for SAP compatibility, ensure your SAP system is configured to use HTTPS to protect your API key in transit.

Send SMS Messages

Send SMS messages using SAP Connect standard parameters.

Endpoint

GET /api/http/SAPConnect.ashx

Query Parameters

Parameter Type Required Description
password string Yes Your API key
account string Yes Account identifier (any value)
recipient_addr string Yes Recipient phone number (single number only)
message string Yes Message text to send
ref string No Your custom reference ID for tracking

Important Notes

Response Format

The API returns a comma-separated response in plain text format:

Success Response

{sms_id}:{recipient}:{status}

Example

12345:264811234567:PENDING

Response Fields

Error Response

Errors are returned as plain text messages:

ERROR! [field_name] description

Example

ERROR! [recipient_addr] List of recipients (mobile numbers) NOT GIVEN

Error Messages

Error Message Cause Solution
ERROR! [PASSWORD] and or [ACCOUNT] NOT PROVIDED Missing authentication parameters Include both password and account parameters
ERROR! [recipient_addr] List of recipients (mobile numbers) NOT GIVEN Missing recipient parameter Include recipient_addr parameter with phone number
ERROR! [message] Message not provided Missing message text Include message parameter with SMS text
0:{recipient}:ERROR Message failed to queue Check API key validity and account status

Examples

Basic Request

GET https://{host}/api/http/SAPConnect.ashx?password=your-api-key&account=SAP001&recipient_addr=264811234567&message=Hello%20from%20SAP

With Reference ID

GET https://{host}/api/http/SAPConnect.ashx?password=your-api-key&account=SAP001&recipient_addr=264811234567&message=Order%20confirmation&ref=ORDER-12345

cURL Example

curl -X GET "https://{host}/api/http/SAPConnect.ashx?password=your-api-key&account=SAP001&recipient_addr=264811234567&message=Hello%20from%20SAP"

Response Example

12345:264811234567:PENDING

SAP Configuration

Setting Up SAP Connect

To integrate SMSDESK with SAP Business One or SAP ERP:

1. Create External Send Process

  1. Transaction: SCOT (SAPconnect - Administration)
  2. Create new node for SMS
  3. Select "External Send Process"
  4. Configure HTTP destination

2. Configure HTTP Destination (SM59)

Setting Value
RFC Destination SMSDESK_HTTP
Connection Type G (HTTP Connection to External Server)
Target Host {host} (your SMSDESK deployment domain)
Port 443
Path Prefix /api/http/SAPConnect.ashx
SSL Active (HTTPS)

3. Configure Send Parameters

In your SAP program or workflow, pass these parameters:

DATA: lv_url TYPE string.

lv_url = 'https://{host}/api/http/SAPConnect.ashx'.
lv_url = lv_url && '?password=your-api-key'.
lv_url = lv_url && '&account=SAP001'.
lv_url = lv_url && '&recipient_addr=' && lv_mobile.
lv_url = lv_url && '&message=' && lv_message.
lv_url = lv_url && '&ref=' && lv_reference.

CALL METHOD cl_http_client=>create_by_url
  EXPORTING
    url    = lv_url
  IMPORTING
    client = lo_http_client.

4. Test Connection

  1. Use transaction SM59
  2. Select your HTTP destination
  3. Click "Connection Test"
  4. Verify successful connection

ABAP Code Example

*&---------------------------------------------------------------------*
*& Send SMS via SMSDESK
*&---------------------------------------------------------------------*
REPORT zsmsdesk_send_sms.

DATA: lv_url      TYPE string,
      lv_mobile   TYPE string VALUE '264811234567',
      lv_message  TYPE string VALUE 'Test from SAP',
      lv_api_key  TYPE string VALUE 'your-api-key',
      lv_response TYPE string.

* Build URL with parameters
CONCATENATE 'https://{host}/api/http/SAPConnect.ashx'
            '?password=' lv_api_key
            '&account=SAP001'
            '&recipient_addr=' lv_mobile
            '&message=' lv_message
       INTO lv_url.

* Call HTTP client
DATA: lo_http_client TYPE REF TO if_http_client.

cl_http_client=>create_by_url(
  EXPORTING
    url    = lv_url
  IMPORTING
    client = lo_http_client ).

lo_http_client->send( ).
lo_http_client->receive( ).

lv_response = lo_http_client->response->get_cdata( ).

WRITE: / 'Response:', lv_response.
Integration Complete! Your SAP system can now send SMS messages through SMSDESK using the standard SAP Connect framework.

Best Practices

⚠️ Migration Note: If you need more advanced features like bulk sending, scheduled messages, or delivery reports, consider using the modern SMS API v2 instead.

References & Official Documentation