REST messages management
The primary reason for using the Wire2Air API is to list sent and received SMS & MMS messages.
Endpoint
To retrieve all incoming messages using Wire2Air Rest API, send a GET request to the messages URL:
GET https://msgapi.wire2air.com/rest/v1/messages/inbox
Request Parameters
Name | Required? | Examples | Description |
---|---|---|---|
datefrom | optional | e.g 1/1/2017 | Default: Today. The date search range can’t exceed 31 days. |
dateto | optional | Eg:1/2/2017 | Default: Today. The date search range can’t exceed 31 days. |
TextNumber | optional | Example: 27126 | One of your assigned shortcode/textnumber |
PageNo | Optional | Example: 3 | Fetch the specified results page. The default is 1. |
PageSize | Optional | For example 100 | The number of results per page. The default is 10. |
Response
HTTP Status Codes
200 | Success – |
401 | Unauthorized – Authentication credentials are missing or incorrect |
400 | Bad Request– Request is not valid. An accompanying error message explains what’s missing. |
500 | Internal Server Error – Contact support |
Sample Error Response
{ "StatusCode": 708, "StatusMessage": "Please select 31 or less days range." }
Response format
Name | Required? | Examples | Description |
---|---|---|---|
ID | 234553234 | Default: Today. The date search range can’t exceed 31 days. | |
to | 27126 | Text Number: A shortcode, local, land-line or Toll-free number | |
from | 12129201000 | Sender’s Mobile Number | |
receiveddatetime | 2017-12-22T18:42:09Z | Received date time in UTC format | |
subscribername | Subscriber Name as per your subscriber’s data, if available | ||
MessageType | MMS | MMS or SMS | |
MMSURL | v1/message/inbox/mms/4986616 | A link MMS resources |
Successful Response Sample
{ "PageNo": 1, "PageSize": 10, "TotalPages": 1.0, "TotalRecords": 1, "RowStart": 1, "RowEnd": 1, "ListItems": [ { "to": "27126", "from": "12129201000", "deliverydatetime": "", "text": "", "batchname": "", "replypath": "", "campaignid": "16654", "concatenate": "", "subscribername": "Sam", "username": "demo5", "submitteddatetime": "", "status": "", "receiveddatetime": "2017-12-22T18:42:09Z", "MessageType": "MMS", "Direction": "In", "URI": "v1/message/inbox/4986616", "ID": "4986616", "MMSURL": "v1/message/inbox/mms/4986616", "baseurl": "", "attachments": "", "subject": "", "bulkmode": "", "Media": null } ] }
Successful Response Sample
{ "subject": "", "textcontent": "", "files": [ { "name": "http://mms.wire2air.com/mmsdata/mmsinbox/29a8d4e9-0be9-4c10-9ac6-3388f0b4a15d/0.jpg", "type": "Image" } ] }