How inbound delivery works
- A user sends an SMS to your mycpaas phone number.
- mycpaas sends an HTTP POST to your configured webhook URL with the message details as form-encoded body parameters.
- Your server responds with LaML XML. mycpaas executes the instructions in the XML (e.g. sends a reply message).
You configure your webhook URL in the Dashboard. Navigate to your phone number’s settings and enter the URL under Messaging webhook.
Inbound webhook payload
mycpaas sends the following parameters in the POST body:The phone number that sent the message, in E.164 format (e.g.
+491234567890).Your mycpaas phone number that received the message, in E.164 format (e.g.
+491098765432).The text content of the inbound message.
A unique identifier for the inbound message, prefixed with
SM.Replying with LaML XML
To send a reply, return a LaML XML document in your HTTP response. Set theContent-Type header to application/xml (or text/xml). mycpaas reads the XML and executes the instructions before continuing.
Webhook handler example
The following Node.js example uses Express to receive an inbound SMS and send back an automatic reply:https://abc123.ngrok.io) and enter it as your webhook URL in the Dashboard.
Content-Type requirement
Your response must include theContent-Type: application/xml header. Without it, mycpaas may not parse the LaML correctly and will not execute the instructions in your response.
| Accepted values | Notes |
|---|---|
application/xml | Recommended |
text/xml | Also accepted |

