Reporting Limits:
1 connection per 15 minutes
No connections from 12:00AM to 2:00AM Central Time
Overview
Returns messages history details (Inbound and Outbound) based on the mobile number from various levels of the platform. User can get the data for one year back from current date.
Syntax
C#
[OperationContractAttribute()] SBT.API.DataContracts.Common.WSReportMessageHistoryDetails MessagesHistoryDetails( string orgCode, string mobileno, string fromDate, string toDate, string securityToken )
WSDL
Production: https://ui.solutionsbytext.com/Sbt.App.SetUp/WSServices/ReportWSService.svc?singlewsdl
Staging: https://test.solutionsbytext.com/Sbt.App.SetUp/WSServices/ReportWSService.svc?singlewsdl
Parameters
orgCode
- String[50] (Required) - Default Organization Code for the company, organization, division or group.
mobileno
- String[20] (Required) - Mobile phone number with/without country code.
fromDate
- String[20] (Required) - Start date for report of messages sent. Date format is [mm/dd/yyyy hh:mm:ss].
toDate
- String[20] (Required) - End date for report of messages sent.Date format is [mm/dd/yyyy hh:mm:ss].
securityToken
- String[1000] (Required) - SecurityToken to authenticate the user
Return Value
WSReportMessageHistoryDetails
Name | Type | Description |
---|---|---|
Result | bool | True/False whether the call was successful or not. |
ErrorCode | int | For Success/Failure it returns an error number. |
Message | string | Message related to error code. |
Response | List | If there are transaction details, then these will be displayed: Group - Group that the message was sent to. CommCode - Shortcode or Longcode that the message was sent to. Message - Message that was sent. Remarks - Text entered in Remarks field in UI compose, when sending message. SenderReceiver - For MO messages, the mobile number is displayed and for MT messages, the type is displayed MessageCategory - Type of message. e.g. Template Message. MessageSubCategory - Sub category of message. e.g. API, HELP, STOP, STOPALL. DeliveryStatus - Status of the message, for more info see the Status Codes page. TimeStamp - Date and Time of message delivery details. |
Example
C#
lblError.Text = ""; ReportClient reportService = new ReportClient("ReportWSServiceHttpEndpoint"); string securityToken = txtToken.Text; ; string orgCode = txtOrgCode.Text; string fromDate = dtFromDate.Text; string toDate = dtToDate.Text; string content_type = txtMobileNo.Text; string mobileno = txtMobileNo.Text; var wSReportMessageHistoryDetails = reportService.MessageHistoryDetails(orgCode,mobileno, fromDate, toDate,securityToken); if (!wSReportMessageHistoryDetails.Result) { //handle error lblError.Text = wSReportMessageHistoryDetails.Message; } else { //handle success lblError.Text = wSReportMessageHistoryDetails.Message; }
SOAP
Soap Request <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ser="http://SBTService/ServiceContracts/"> <soapenv:Header/> <soapenv:Body> <ser:MessageHistoryDetails> <!--Required:--> <ser:orgCode>Org Code</ser:orgCode> <!--Required:--> <ser:mobileno>Mobile Number</ser:mobileno> <!--Required:--> <ser:fromDate>From Date</ser:fromDate> <!--Required:--> <ser:toDate>To Date</ser:toDate> <!--Required:--> <ser:securityToken>Security Token</ser:securityToken> </ser:MessageHistoryDetails> </soapenv:Body> </soapenv:Envelope> Soap Response <s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/"> <s:Body> <MessageHistoryDetailsResponse xmlns="http://SBTService/ServiceContracts/"> <MessageHistoryDetailsResult z:Id="i1" xmlns:a=http://SBTAPIService/DataContract/ xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns:z="http://schemas.microsoft.com/2003/10/Serialization/"> <a:Result>true</a:Result> <a:ErrorCode>1441</a:ErrorCode> <a:Message>Successfully retrieved messages sent history</a:Message> <a:Response z:Id="i2"> <a:WSReportMessageHistoryRow z:Id="i2"> <a:Group>Test Group</a:Group> <a:CommCode>communication code (Long code or Short Code)</a:CommCode> <a:SenderReceiver>Template Message</a:SenderReceiver> <a:Message>Test message</a:Message> <a:MessageCategory>Template Message</a:MessageCategory> <a:Remarks/> <a:MessageSubCategory>API</a:MessageSubCategory> <a:ProcessDateTime>3/16/2014 5:44:37 AM</a:ProcessDateTime> <a:Status>Delivered</a:Status> </a:WSReportMessageHistoryRow> </a:Response> </MessageHistoryDetailsResult> </MessageHistoryDetailsResponse> </s:Body> </s:Envelope>
REST
Method: GET
URL: https://ui.solutionsbytext.com/SBT.App.SetUp/RSServices/ReportRSService.svc/MessageHistoryDetails?orgCode=dfsf&mobileno=12345678910&fromDate=01/31/2015 00:00:00&toDate=01/30/2016 00:00:00& securityToken=safdsfs
Response:
The response will be in JSON format like below: {" MessageHistoryDetailsResult": { "Result": true, "ErrorCode": 1472, "Message": " Successfully Retrieved Message sent History", "Response": { "List<WSReportMessageHistoryDetails> response – Subscribers details like Comm Code,Group,Message etc. Information will display" } }}