Callback URLs
The callback URL must be a web resource with a public IP address configured to handle JSON, as shown in the example below.
1. Set the callback URL
Set a callback URL in the SMS CallBack field in the Preferences > API Control section of the Flowroute portal:
2. Receive an inbound message
When an SMS is sent to a Flowroute number, Flowroute will send a POST HTTP request to your callback URL containing the following information:
Key | Value |
---|---|
to | The Flowroute phone number that received the message. This must be in E.164 format; e.g.,1NPANXXXXXX. |
from | The phone number from which the message was sent. This must be in E.164 format; e.g.,1NPANXXXXXX. |
body | The body content of the message. Messages are encoded in UTF-8. |
id | The Message Detail Record (MDR) identifier of the received message. |
Example of an inbound message request:
HTTP
POST /runpost HTTP/1.1Content-Length: 72
Host: 54.68.158.17:11111
Content-Type: application/json
Accept-Encoding: gzip
{"to": "12066418000", "body": "Hello there from Flowroute!", "from": "18553569768", "id": "mdr1-febb118b9b034338adfc662a8c02fd88"}
Message Auto-Concatenation
Auto-concatenation rules apply to any inbound message. See Message Length & Concatenation for more information.
3. Respond to the HTTP request
When you receive an inbound message, you must respond with a 200 OK response. If you do not send a 200 OK, an attempt is made to resend the message a total of four (4) times at 30-second intervals.
Even if you don't respond to the request, you will still be billed for that message. However, you can still retrieve the message by looking up the MDR date. See Look up a Set of Messages for more information.
Note:
Code | Description |
---|---|
200 | Send back a 200 OK to acknowledge the receipt of a message. Anything else (or no response) will trigger a retransmission of the message to your callback URL. |
Protect your callback URL
You can protect your callback URL by only accepting inbound connections from Flowroute’s API endpoints. The IP addresses are:
- 52.88.246.140
- 52.10.220.50
- 54.190.46.191
- 52.43.82.110