Receive SMS

Use our APIs to automatically process incoming SMS messages via SMTP or HTTP.

Incoming SMS and delivery reports

You have two options for processing incoming messages with our API:

  • Forwarding incoming messages to an email address

  • Access to an HTTP URL using the HTTP POST method - a separate URL can be configured exclusively for each user

Please note: When using HTTP URL, you must acknowledge receipt of the notification with the response body.

Request body

Element: Notification

PropertyTypeDescriptionExample
messageTypeString"text", "binary", "deliveryReport" – defines the contenttype of your notificationtext
notificationIdString20 digit long identification of your notification. Eg: "050f9005180a2a212469" messageTypes: text, binary, deliveryReport050f9005180a2a212469
transferIdStringUnique transfer-id to connect the deliveryReport to the initial message. messageTypes: deliveryReport0051949fe700053c4615
messageFlashSmsBooleantrue | false – indicates whether you received message is a SMS or a flash-SMS messageTypes: text, binarytrue
senderAddressStringOriginator of the sender, eg:4366012345678 messageTypes: text, binary, deliveryReport4366012345678
senderAddressTypeStringinternational – defines the number format of the mobile originated senderAddress. International numbers always includes the country prefix. messageTypes: text, binaryinternational
recipientAddressStringSenders address, can either be international (4366012345678), national (066012345678) or a shortcode (1234) messageTypes: text, binary, deliveryReportnational
recipientAddressTypeString"international"|"national"|"shortcode" – defines the number format of the mobile originated message messageTypes: text, binaryinternational
textMessageContentStringText body of the message encoded in UTF-8. In the case of concatenated SMS it will contain the complete content of all segments. messageTypes: textHello World!
userDataHeaderPresentBooleantrue | false – indicates whether a user-data-header is included within a Base64 encoded byte segment. messageTypes: binarytrue
binaryMessageContentArray of StringsContent of a binary SMS in an Array of Byte64 Strings (URL safe). messageTypes: binary
deliveryReportMessageStatusString"delivered", "undelivered", "expired", "deleted", "accepted", "rejected" messageTypes: deliveryReportdelivered
sentOnStringISO 8601 timestamp, eg: "2013-05-27T13:36:00.000+02:00". Point of time sending the message to recipients address. messageTypes: deliveryReport2013-05-27T13:36:00.000+02:00
deliveredOnStringISO 8601 timestamp, eg: "2013-05-27T13:36:00.000+02:00". Point of time of submitting the message to the mobile operators network. messageTypes: deliveryReport2013-05-27T13:36:00.000+02:00
deliveredAsString"sms", "push", "failover-sms", "voice" messageTypes: deliveryReportsms
clientMessageIdStringIn the case of a delivery report, the clientMessageId contains the optional submitted message id. messageTypes: deliveryReport

Response body

You must confirm the notification with statusCode 2000 in your response body. Otherwise, we will retry the delivery of your notification for the duration of the lifetime of your message element.

AttributeDescription
statusCodestatus code after processed request
statusMessageDescription of the response status

Example: JSON

Incoming SMS as JSON

{
"messageType": "text",
"notificationId": "02c1d0051949fe70cbfa",
"senderAddress": "4367612345678",
"senderAddressType": "international",
"recipientAddress": "08282709900001",
"recipientAddressType": "national",
"textMessageContent": "Das ist eine Antwort SMS mit Sonderzeichen, Umlauten \u003c\"Ümläuten\"\u003e und €urozeichen."
}

Response body JSON

{
"statusCode" : "...",
"statusMessage" : "...",
}

Example: XML

Incoming SMS as XML

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<notification>
<messageType>text</messageType>
<notificationId>02c1d0051949fe70cbfa</notificationId>
<senderAddress>4367612345678</senderAddress>
<senderAddressType>international</senderAddressType>
<recipientAddress>08282709900001</recipientAddress>
<recipientAddressType>national</recipientAddressType>
<textMessageContent>Das ist eine Antwort SMS mit Sonderzeichen, Umlauten &lt;&quot;Ümläuten&quot;&gt; und €urozeichen</textMessageContent>
</notification>

Response body XML

<notificationResponse>
<statusMessage>...</statusMessage>
<statusCode>...</statusCode>
</notificationResponse>

Example: PHP

<?php

# 1) get the sms from the received notification
$sms = json_decode(file_get_contents("php://input"));

# 2) do something with $sms
...
...

# 3) respond to the notification
header('Content-Type: application/json; charset=UTF-8');
echo '{"statusCode" : 2000, "statusMessage" : "ok"}';
?>