MessageHistoryReportAPI Methods
Method: MessageHistoryReportAPI
Overview
This method is used to get message history from either the WebApp history data table or the message history from MC5. The method setups a background task to extract the data into a csv file and email to the recipients defined in the api call. If the method is called using reseller credentials message data can be fetch for the reseller as whole or narrowed down by specifying a Customer name and AppSender name
Address: api/MessageHistoryReportAPI
Method: POST
Body Data: x-www-form-urlencoded or JSON
Body Properties
parameter Name | Meaning | Notes |
---|---|---|
username | messaging username | required |
password | messaging password | required |
recipients | Email recipients for return data file to be sent to; separate multiple addresses with a “,” |
|
Source | Local, MC5 | Required - This is the data source from which the records are obtained |
Direction | Out, In | use exact string - Default Out if not specified, or specified incorrectly |
zoneOffset | from UTC expressed as HH:mm eg “10:00” or “-10:-30” |
|
CustomerName | Search for messages related to the customer only | For use only if calling the method with Reseller Credentials. If left Blank data will be for All Customers of the Reseller |
AppSenderName | Search for records related to this AppSender only | For use only if calling the method with Reseller Credentials. If left blank data will be for all AppSenders of the Reseller |
DateFrom | Message Received or Sent Date | Allowable date formats "dd/MM/yyyy HH:mm:ss", "d/M/yyyy", "d/M/yy", "dd/MM/yyyy", "dd/MM/yy", "yyyy-MM-dd", "dd/MM/yyyy HH:mm:ss zzz", "yyyy-MM-ddTHH:mm:ss", "yyyy-MM-ddTHH:mm:sszzz", "dd.MM.yyyy HH:mm:ss" |
DateTo | Message Received or Sent Date | Allowable date formats "dd/MM/yyyy HH:mm:ss", "d/M/yyyy", "d/M/yy", "dd/MM/yyyy", "dd/MM/yy", "yyyy-MM-dd", "dd/MM/yyyy HH:mm:ss zzz", "yyyy-MM-ddTHH:mm:ss", "yyyy-MM-ddTHH:mm:sszzz", "dd.MM.yyyy HH:mm:ss" |
Filename | Name for generated fileName attached to the email |
|
pageNumber | Do not use - for Method GetMessages |
|
Response
body JSON
{
"status":"0",
"description":"success"
}
not that a csv file containing the message data will be email to the recipient once the data file is build.
Max 10,000 records return.
Method: MessageHistoryReportAPI/GetMessages
Overview
This method is user to get message history from either the WebApp history data table or the message history from MC5. The method return message data in the response. 100 record at a time can be fetched using paging. page size is set by the system to 100 records.
Address: api/MessageHistoryReportAPI/GetMessages
Method: POST
Data: x-www-form-urlencoded or JSON
Body Properties
parameter Name | Meaning | Notes |
---|---|---|
username | messaging username | required |
password | messaging password | required |
recipients | NA - do not use |
|
Source | Local, MC5 | Required - This is the data source from which the records are obtained |
Direction | Out, In, Both | use exact string - Default Out if not specified, or specified incorrectly |
zoneOffset | from UTC expressed as HH:mm eg “10:00” or “-10:-30” |
|
CustomerName | Search for messages related to the customer only | For use only if calling the method with Reseller Credentials |
AppSenderName | Search for records related to this AppSender only | For use only if calling the method with Reseller Credentials |
DateFrom | Message Received or Sent Date | Allowable date formats "dd/MM/yyyy HH:mm:ss", "d/M/yyyy", "d/M/yy", "dd/MM/yyyy", "dd/MM/yy", "yyyy-MM-dd", "dd/MM/yyyy HH:mm:ss zzz", "yyyy-MM-ddTHH:mm:ss", "yyyy-MM-ddTHH:mm:sszzz", "dd.MM.yyyy HH:mm:ss" |
DateTo | Message Received or Sent Date | Allowable date formats "dd/MM/yyyy HH:mm:ss", "d/M/yyyy", "d/M/yy", "dd/MM/yyyy", "dd/MM/yy", "yyyy-MM-dd", "dd/MM/yyyy HH:mm:ss zzz", "yyyy-MM-ddTHH:mm:ss", "yyyy-MM-ddTHH:mm:sszzz", "dd.MM.yyyy HH:mm:ss" |
Filename | NA do not use |
|
pageNumber | Page Number for data | note page size is 100 message. iterate the method to retrieve all records within data set. |
Response
{
"pageNumber": 1,
"status": "0",
"description": "success",
"numberOfRecords": 5,
"pageSize": 100,
"itemsReturned": 5,
"numberOfPages": 1,
"Messages": [
{
"MessageId": "ef8ee563-9b05-4f65-8b2d-f49442fba447",
"Received": "2022-11-17T14:02:04.557",
"ResellerName": null,
"CustomerName": null,
"SendeName": "peterdemo2",
"To": "61401001001",
"From": "61401002003",
"Message": "test campaign 17-10-22",
"Charge": 1.00,
"Outbound": true,
"Status": "DELIVRD",
"CampaignId": "836cd5d3-8554-46da-9dab-1cb9e71ed3dc",
"CampaignName": "",
"Validity": 0,
"Encoding": "gsm",
"NumberOfParts": 1,
"DocumentId": null,
"Keyword": null,
"FileLocation": null
},
{
"MessageId": "abd849dd-79f4-4f8c-a35a-f4f731f83825",
"Received": "2022-11-17T14:02:04.557",
"ResellerName": null,
"CustomerName": null,
"SendeName": "peterdemo2",
"To": "61401002007",
"From": "61401002003",
"Message": "test campaign 17-10-22",
"Charge": 1.00,
"Outbound": true,
"Status": "DELIVRD",
"CampaignId": "836cd5d3-8554-46da-9dab-1cb9e71ed3dc",
"CampaignName": "",
"Validity": 0,
"Encoding": "gsm",
"NumberOfParts": 1,
"DocumentId": null,
"Keyword": null,
"FileLocation": null
},
{
"MessageId": "43ca58a4-0125-4609-8118-39995f472d56",
"Received": "2022-11-17T14:02:04.557",
"ResellerName": null,
"CustomerName": null,
"SendeName": "peterdemo2",
"To": "61401000003",
"From": "61401002003",
"Message": "test campaign 17-10-22",
"Charge": 1.00,
"Outbound": true,
"Status": "DELIVRD",
"CampaignId": "836cd5d3-8554-46da-9dab-1cb9e71ed3dc",
"CampaignName": "",
"Validity": 0,
"Encoding": "gsm",
"NumberOfParts": 1,
"DocumentId": null,
"Keyword": null,
"FileLocation": null
},
{
"MessageId": "a47baeb7-3ead-4091-8143-825372d7b0fc",
"Received": "2022-11-17T14:02:04.557",
"ResellerName": null,
"CustomerName": null,
"SendeName": "peterdemo2",
"To": "61404857746",
"From": "61401002003",
"Message": "test campaign 17-10-22",
"Charge": 1.00,
"Outbound": true,
"Status": "DELIVRD",
"CampaignId": "836cd5d3-8554-46da-9dab-1cb9e71ed3dc",
"CampaignName": "",
"Validity": 0,
"Encoding": "gsm",
"NumberOfParts": 1,
"DocumentId": null,
"Keyword": null,
"FileLocation": null
},
{
"MessageId": "8ee7e25b-0464-44bd-a9e2-671b337dc800",
"Received": "2022-11-17T14:02:04.557",
"ResellerName": null,
"CustomerName": null,
"SendeName": "peterdemo2",
"To": "61401328025",
"From": "61401002003",
"Message": "test campaign 17-10-22",
"Charge": 1.00,
"Outbound": true,
"Status": "DELIVRD",
"CampaignId": "836cd5d3-8554-46da-9dab-1cb9e71ed3dc",
"CampaignName": "",
"Validity": 0,
"Encoding": "gsm",
"NumberOfParts": 1,
"DocumentId": null,
"Keyword": null,
"FileLocation": null
}
]
}
Message Volume Report
Overview
This method is user to get message history from either the WebApp history data table or the message history from MC5. The method return message data in the response. 100 record at a time can be fetched using paging. page size is set by the system to 100 records.
Address: api/MessageHistoryReportAPI/GetMessageVolumes
Method: POST
Data: x-www-form-urlencoded or JSON
Body Properties
parameter Name | Meaning | Notes |
---|---|---|
username | MC5 Reseller username | required |
password | MC5 Reseller password | required |
Source | Local, MC5 | Required - This is the data source from which the records are obtained |
CustomerName | Search for messages related to the customer only | Must be an exact match the WebApp Organisation Name |
DateFrom | Message Received or Sent Date Volume records include records for this date | Allowable date formats "dd/MM/yyyy HH:mm:ss", "d/M/yyyy", "d/M/yy", "dd/MM/yyyy", "dd/MM/yy", "yyyy-MM-dd", "dd/MM/yyyy HH:mm:ss zzz", "yyyy-MM-ddTHH:mm:ss", "yyyy-MM-ddTHH:mm:sszzz", "dd.MM.yyyy HH:mm:ss" |
DateTo | Message Received or Sent Date Volume records include records for this date | Allowable date formats "dd/MM/yyyy HH:mm:ss", "d/M/yyyy", "d/M/yy", "dd/MM/yyyy", "dd/MM/yy", "yyyy-MM-dd", "dd/MM/yyyy HH:mm:ss zzz", "yyyy-MM-ddTHH:mm:ss", "yyyy-MM-ddTHH:mm:sszzz", "dd.MM.yyyy HH:mm:ss" |
pageNumber | Page Number for data | note page size is 1000 message. iterate the method to retrieve all records within data set. |
country | use either the 2 character code or country name - safer to use the code so a match is found, eg Australia or AU | returns records for just one country - leave blank or set to null to retrieve volume for all countries |
Response
{
"volumeReport": {
"incoming": [
{
"reseller": "resellerA",
"customer": "customerA",
"country": "Australia",
"integrationId": "",
"charged": 485.0,
"countTotal": 430,
"messageType": "SMS"
}
],
"outgoing": [
{
"reseller": "resellerA",
"customer": "customerA",
"country": "Australia",
"integrationId": "",
"charged": 139098.0,
"countTotal": 139116,
"countDelivered": 134115,
"countRejected": 21,
"countExpired": 3352,
"countUndeliverable": 1610,
"countNotRoutable": 18,
"messageType": "SMS"
}
]
},
"status": "0",
"description": "success"
}