Reporting Limits:
1 connection per 15 minutes
No connections from 12:00AM to 2:00AM Central Time
Overview
Returns the archived messages received. Note: Only top level org codes are to be passed in the API call.)
Syntax
[OperationContractAttribute()] SBT.API.DataContracts.Common.WSReportArchiveInboundMessageResponse ArchiveInboundMessages( string securityToken, string orgCode, string fromDate, string toDate )
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
securityToken
-String[1000] (Required) – SecurityToken to authenticate the user
orgCode
– String[50] (Required) – Default Organization Code for company, organization, division or group.
fromDate
– String[20] (Required) – Start date for report of messages received. Date format is [mm/dd/yyyy hh:mm:ss].
toDate
– String[20] (Required) – End date for report of messages received. Date format is [mm/dd/yyyy hh:mm:ss].
Note: This service is capable of returning the inbound messages of past one year. data range starts from beyond previous month. In From and To date range, pass only 15 days. Previous one year data can be accessed as 15 days data chunks.
Return Value
WSReportArchiveInboundMessageResponse
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 they will be displayed. |
Additional Validation
Error Codes | Description | Example |
---|---|---|
1485 |
Current and previous month’s data are not available. |
For example, Current month date is 7/28/2015 then API will not allow fetching any date in current month and previous month |
1484 |
Date range should not be more than 15 calendar days. |
For example, fromDate is 6/1/2015 and toDate is 6/16/2015, the date difference between fromDate and toDate is more than 15 and it will not be allowed |
1486 |
Sorry! You cannot access the data beyond 1 year old. |
For example, current month is August 2015, it will allow fetching data from 1 July 2014 to 30 June 2015 |
Examples
C#
lblError.Text = ""; ReportClient reportService = new ReportClient("ReportWSServiceHttpEndpoint"); string securityToken = txtToken.Text; ; string orgCode = txtOrgCode.Text; string fromDate = dtFromDate.Text; string toDate = dtToDate.Text; WSReportArchiveInboundMessageResponse wSReportArchiveInboundMessagesResponse = reportService.ArchiveInboundMessages(securityToken, orgCode, fromDate, toDate); if (!wSReportArchiveInboundMessagesResponse.Result) { //handle error lblError.Text = wSReportArchiveInboundMessagesResponse.Message; } else { //handle success lblError.Text = wSReportArchiveInboundMessagesResponse.Message; }
SOAP
Soap Request <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ser="http://SBTService/ServiceContracts/"> <soapenv:Header/> <soapenv:Body> <ser:ArchiveInboundMessages> <!--Required:--> <ser:securityToken>Security Token</ser:securityToken> <!--Required:--> <ser:orgCode>Org code</ser:orgCode> <!--Required:--> <ser:fromDate>From Date</ser:fromDate> <!--Required:--> <ser:toDate>To Date</ser:toDate> </ser:ArchiveInboundMessages> </soapenv:Body> </soapenv:Envelope> Soap Response <s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/"> <s:Body> <ArchiveInboundMessagesResponse xmlns="http://SBTService/ServiceContracts/"> <ArchiveInboundMessagesResult 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>1440</a:ErrorCode> <a:Message>Successfully retrieved Archive inbound messages report</a:Message> <a:Response z:Id="i2"> <a:WSReportArchiveInboundMessageRow z:Id="i2"> <a:Group>Org1->Division->Group1</a:Group> <a:Code>10958</a:Code> <a:ModeOfCommunication>SMS</a:ModeOfCommunication> <a:Message>Message</a:Message> <a:MessageCategory>Keyword</a:MessageCategory> <a:MessageSubCategory>UI</a:MessageSubCategory> <a:Phone>MobilePhone</a:Phone> <a:TimeStamp>9/3/2013 7:16:29 PM</a:TimeStamp> <a:UniqueID>Unique ID of subscriber PM</a:UniqueID> </a:WSReportArchiveInboundMessageRow> </a:Response> </ArchiveInboundMessagesResult> </ArchiveInboundMessagesResponse> </s:Body> </s:Envelope>
JAVA
ReportWSService srv = new ReportWSService(); IReport iReport = srv.getReportWSServiceHttpEndpoint1(); WSReportArchiveInboundMessageResponse res = null; String securityToken = "SecurityToken"; String orgCode = "orgCode"; String fromDate = "08/22/2013"; String toDate = "09/22/2013"; try { res = iReport.ArchiveInboundMessages(securityToken, orgCode, fromDate, toDate); } catch (Throwable e) { e.printStackTrace(); } if(res == null ){ System.out.println("::Erron::"); return; } if (res.isResult() == null || !res.isResult()) { //handle error System.out.println("ErrorCode::"+res.getErrorCode()); System.out.println("ErrorMessage::"+res.getMessage().getValue()); } else { //handle success System.out.println("ID::"+res.getId()); System.out.println("Message::"+res.getMessage().getValue()); }
PHP
<?php $client = new SoapClient("https://ui.solutionsbytext.com/Sbt.App.SetUp/WSServices/ReportWSService.svc?wsdl"); $param = array( 'securityToken' =--> 'securityToken', 'orgCode' => 'orgCode', 'fromDate' => '08/22/2013', 'toDate' => '10/22/2013' ); $response = $client->__soapCall('ArchiveInboundMessages', array($param)); echo '<pre?>'; print_r($response); if($response->ArchiveInboundMessagesResult->Result){ echo 'Message: '.$response->ArchiveInboundMessagesResult->Message; } else { echo 'Message: '.$response->ArchiveInboundMessagesResult->Message; } ?>
REST
Method: GET
URL: https://ui.solutionsbytext.com/SBT.App.SetUp/RSServices/ReportRSService.svc/ArchiveInboundMessages?securityToken=safdsfs&orgCode=dfsf&fromDate=01/31/2015 00:00:00&toDate=01/30/2016 00:00:00
Response:
The response will be in JSON format like below: {" ArchiveInboundMessagesResult": { "Result": true, "ErrorCode": 1440, "Message": " Successfully retrieved inbound messages report", "Response": { "List<WSReportArchiveInboundMessageRow> response – Archive Inbound Message details like Code,Group,Message etc. Information will display" } }}