Inbounds, or Mobile Originated (MO) messages, are incoming messages. Inbound messages can be listed and retrieved like batch messages and they can also be delivered by callback requests like delivery reports.
The REST API handles MO media messages by uploading them to specified s3 storage location and providing the URL to download the attachment.
On a successful upload, the code will be 0
. If the upload fails, the code will be a value other than 0
.
Status Code | Name | Status | Description |
---|---|---|---|
0 | Uploaded | Uploaded |
Attachment successfully uploaded to storage. |
1 | Internal failure | Failed |
Internal exception happened during upload. |
2 | Bucket not found | Failed |
Provisioned bucket doesn't exist. |
With the list operation, you can list all inbound messages that you have received. This operation supports pagination. Inbounds are returned in reverse chronological order.
service_plan_id required | string Your service plan ID. You can find this on your Dashboard. Example: jd63jf88477ll123ab4567cd89012ef3 |
page | integer >= 0 Default: 0 The page number starting from 0. Example: page=2 |
page_size | integer <= 100 Default: 30 Determines the size of a page |
to | string Only list messages sent to this destination. Multiple phone numbers formatted as either E.164 or short codes can be comma separated. Example: to=+14155553421, +13435552671, +14325552677 |
start_date | string <ISO-8601> Default: "Now-24" Only list messages received at or after this date/time. Formatted as ISO-8601: Default: Now-24 |
end_date | string <ISO-8601> Only list messages received before this date/time. Formatted as ISO-8601: Example: end_date=2016-10-02T09:34:18.542Z |
client_reference | string [ 0 .. 2048 ] characters Using a client reference in inbound messages requires additional setup on your account. Contact your account manager to enable this feature. Only list inbound messages that are in response to messages with a previously provided client reference. Example: client_reference=myReference |
OK. A successful response , or an Error.
{- "count": 1,
- "page": 0,
- "inbounds": [
- {
- "client_reference": "string",
- "from": "+11203494390",
- "id": "01FC66621XXXXX119Z8PMV1QPA",
- "operator_id": "35000",
- "received_at": "2019-08-24T14:15:22Z",
- "sent_at": "2019-08-24T14:15:22Z",
- "to": "11203453453",
- "type": "mo_text",
- "body": "string"
}
], - "page_size": 50
}
This operation retrieves a specific inbound message with the provided inbound ID.
service_plan_id required | string Your service plan ID. You can find this on your Dashboard. Example: jd63jf88477ll123ab4567cd89012ef3 |
inbound_id required | string The inbound ID found when listing inbound messages. Example: 01FC66621XXXXX119Z8PMV1QPA |
OK. A successful response , or an Error.
The page of inbounds matching the given filters.
body required | string [ 0 .. 2000 ] characters |
from required | string The phone number that sent the message. More info |
id required | string The ID of this inbound message. |
received_at required | string <date-time> When the system received the message. Formatted as ISO-8601: |
to required | string The Sinch phone number or short code to which the message was sent. |
type required | string Regular SMS |
client_reference | string If this inbound message is in response to a previously sent message that contained a client reference, then this field contains that client reference. Utilizing this feature requires additional setup on your account. Contact your account manager to enable this feature. |
operator_id | string The MCC/MNC of the sender's operator if known. |
sent_at | string <date-time> When the message left the originating device. Only available if provided by operator. Formatted as ISO-8601: |
{- "body": "Test message",
- "client_reference": "ABC123",
- "from": "+11203494390",
- "id": "01FC66621XXXXX119Z8PMV1QPA",
- "operator_id": "35000",
- "received_at": "2019-08-24T14:15:22Z",
- "sent_at": "2019-08-24T14:15:22Z",
- "to": "11203453453",
- "type": "mo_text"
}
An inbound message is a message sent to one of your short codes or long numbers from a mobile phone. To receive inbound message callbacks, a URL needs to be added to your REST API. This URL can be specified in your Dashboard.
The incoming message to your sinch number
The page of inbounds matching the given filters.
body required | string [ 0 .. 2000 ] characters |
from required | string The phone number that sent the message. More info |
id required | string The ID of this inbound message. |
received_at required | string <date-time> When the system received the message. Formatted as ISO-8601: |
to required | string The Sinch phone number or short code to which the message was sent. |
type required | string Regular SMS |
client_reference | string If this inbound message is in response to a previously sent message that contained a client reference, then this field contains that client reference. Utilizing this feature requires additional setup on your account. Contact your account manager to enable this feature. |
operator_id | string The MCC/MNC of the sender's operator if known. |
sent_at | string <date-time> When the message left the originating device. Only available if provided by operator. Formatted as ISO-8601: |
A 2xx
status code indicates that the data was received successfully.
A 4xx
status counts as a permanent failure and will not trigger any retries, except for 429
.
The callback will be retried and the callback throughput will be lowered.
A 5xx
status code will trigger a retry.
{- "body": "This is a test message.",
- "from": "16051234567",
- "id": "01XXXXX21XXXXX119Z8P1XXXXX",
- "operator_id": "string",
- "received_at": "2022-08-24T14:15:22Z",
- "sent_at": "2022-08-24T14:15:22Z",
- "to": "13185551234",
- "type": "mo_text"
}