Reporting Limits:
1 connection per 15 minutes
No connections from 12:00AM to 2:00AM Central Time
Overview
Returns archived messages sent from various levels of the platform. (Only top level orgcodes are to be used)
Syntax
C#
[OperationContractAttribute()] SBT.API.DataContracts.Common.WSReportArchiveSentMessagesResponse ArchiveMessagesSent( string securityToken, string orgCode, string fromDate, string toDate, string note )
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 the company, organization, division or group.
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].
note
– String[200] (Optional) – This is an optional parameter to pass to narrow the search to only return messages sent with a particular note.
Note: This service is capable of returning the out boundmessages 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
WSReportArchiveSentMessagesResponse
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 <WSReportArchiveSentMessageRow> | If there are transaction details, then they will be displayed. Group – Org name to which message was sent. Code – Communication code from which message was sent. Phone – Phone number message was sent to. ModeOfCommunication – SMS/MMS – based on message type. Message – content of message that was sent. MessageCategory – Category of sent message. e.g. Outbound, Template, VBT, compliance, keyword etc. MessageSubCategory – Sub Category of sent message. e.g. UI, API, HELP, STOP, STOPALL, VBT, Keyword etc… TimeStamp – DateTime that the message was sent. * Note – Custom note added while sending the message DeliveryStatus – Delivery Status of the message, for more info see the status code page. DeliveryStatusID – Delivery Status ID of message, for more info see the status code page. UniqueID – UniqueID of the Subscriber |
Additional Validation
Error Codes | Description | Example |
---|---|---|
1485 | Current and previous month’s data are not available. | For example, if current month date is 7/28/2015, it will not allow fetching any date of the current month or previous month |
1484 | Date range should not be more than 15 calendar days. | For example, if fromDate is 6/1/2015 and toDate is 6/16/2015, the date difference between fromDate and toDate is more than 15 days and API call will not return results |
1486 | Sorry! You cannot access the data beyond 1 year old. | For example, if current month is August 2015, the API will allow fetching data from 1 July 2014 to 30 June 2015 |
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 note = txtNote.Text; WSReportArchiveSentMessagesResponse wSReportArchiveSentMessagesResponse = reportService.ArchiveMessagesSent(securityToken, orgCode, fromDate, toDate, note); if (!wSReportArchiveSentMessagesResponse.Result) { //handle error lblError.Text = wSReportArchiveSentMessagesResponse.Message; } else { //handle success lblError.Text = wSReportArchiveSentMessagesResponse.Message; }
SOAP
Soap Request <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ser="http://SBTService/ServiceContracts/"> <soapenv:Header/> <soapenv:Body> <ser:ArchiveMessagesSent> <!--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> <!--Optional:--> <ser:note>Search with Note. If it is blank all messages returned in the date range</ser:note> </ser:ArchiveMessagesSent> </soapenv:Body> </soapenv:Envelope> Soap Response <s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/"> <s:Body> <ArchiveMessagesSentResponse xmlns="http://SBTService/ServiceContracts/"> <ArchiveMessagesSentResult 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 Archive messages sent report</a:Message> <a:Response z:Id="i2"> <a:WSReportArchiveSentMessageRow z:Id="i2"> <a:Group>Org1->Div2->Grp01</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>Phone</a:Phone> <a:TimeStamp>8/30/2013 2:49:37 PM</a:TimeStamp> <a:Note>NoteID</a:Note> <a:DeliveryStatus>Delivered</a:DeliveryStatus> <a:DeliveryStatusID>100</a:DeliveryStatusID> <a:UniqueID>UniqueID of Subscriber</a:UniqueID> </a:WSReportArchiveSentMessageRow> </a:Response> </ArchiveMessagesSentResult> </ArchiveMessagesSentResponse> </s:Body> </s:Envelope>
JAVA
ReportWSService srv = new ReportWSService(); IReport iReport = srv.getReportWSServiceHttpEndpoint1(); WSReportArchiveSentMessagesResponse res = null; String securityToken = "securityToken"; String orgCode = "OrgCode"; String fromDate = "08/22/2013"; String toDate = "09/22/2013"; String note = "test"; try { res = iReport.ArchiveMessagesSent(securityToken, orgCode, fromDate, toDate, note); } 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', 'note' => 'note' ); $response = $client->__soapCall('ArchiveMessagesSent', array($param)); echo '<pre?>'; print_r($response); if($response->ArchiveMessagesSentResult->Result){ echo 'Message: '.$response->ArchiveMessagesSentResult->Message; } else { echo 'Message: '.$response->ArchiveMessagesSentResult->Message; } ?>
REST
Method: GET
URL: https://ui.solutionsbytext.com/SBT.App.SetUp/RSServices/ReportRSService.svc/ArchiveMessagesSent?securityToken=safdsfs&orgCode=dfsf&fromDate=01/31/2015 00:00:00&toDate=01/30/2016 00:00:00¬e=sampleNote
Response:
The response will be in JSON format like below: {" ArchiveMessagesSentResult": { "Result": true, "ErrorCode": 1441, "Message": " Successfully retrieved messages sent report", "Response": { "List<WSReportArchiveSentMessageRow> response – Archive Sent Message details like Code,Group,Message etc. Information will display" } }}