Reporting Limits:

1 connection per 15 minutes

No connections from 12:00AM to 2:00AM Central Time

Overview

Returns messages sent from various levels of the platform. 

Syntax

C#

[OperationContractAttribute()] 
SBT.API.DataContracts.Common.WSReportSentMessagesResponse MessagesSent( 
   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 the particular note.

 Note: Date range should include only current and previous month. For beyond previous month data please use ArchiveMessagesSent service.

Return Value

WSReportSentMessagesResponse
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 <WSReportSentMessageRow>

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 – Unique ID of Subscriber. (Note:recommend not to use this field. Instead use UniqueID field)
Message – content of Message that was sent.
MessageCategory – Category of sent message. e.g. Outbound, Template, VBT, Two Way, 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 UserName – User, who sent the message.
TransactionTicket – Transaction Ticket of the message.
TemplateID – Template ID of the template message (Displayed only for the Template Messages),
OrgCode – Default organization code, from where message sent.
Remarks – Remarks of the message, which is added while sending the message.  

 

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;
    string note = txtNote.Text;

    WSReportSentMessagesResponse wSReportSentMessagesResponse = reportService.MessagesSent(securityToken, orgCode, fromDate, toDate, note);
        if (!wSReportSentMessagesResponse.Result)
            {
                //handle error
                lblError.Text = wSReportSentMessagesResponse.Message;
            }
        else
            {
                //handle success
                lblError.Text = wSReportSentMessagesResponse.Message;
            }

SOAP

Soap Request 
 
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ser="http://SBTService/ServiceContracts/">
   <soapenv:Header/>
   <soapenv:Body>
      <ser:MessagesSent>
         <!--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:MessagesSent>
   </soapenv:Body>
</soapenv:Envelope>

            
 Soap Response
             
<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">
     <s:Body>
        <MessagesSentResponse xmlns="http://SBTService/ServiceContracts/">
           <MessagesSentResult 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 report</a:Message>
             <a:Response z:Id="i2">
		  <a:WSReportSentMessageRow 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:UserName>User name who sent this message</a:UniqueID>
                 <a:TransactionTicket>Transaction Ticket ID</a:TransactionTicket>
                  <a:TemplateID>Template ID</a:TemplateID>
                  <a:OrgCode>Org Code</a:OrgCode>
                  <a:Remarks>Test Remarks</a:Remarks>
              </a:WSReportSentMessageRow>
	     </a:Response> 
           </MessagesSentResult>
        </MessagesSentResponse>
     </s:Body>
  </s:Envelope>

JAVA

 ReportWSService srv = new ReportWSService();
 IReport iReport = srv.getReportWSServiceHttpEndpoint1();
 WSReportSentMessagesResponse res = null;

 String securityToken = "securityToken";
 String orgCode = "OrgCode";
 String fromDate = "08/22/2013";
 String toDate = "09/22/2013";
 String note = "test";

 try {
    	 res = iReport.messagesSent(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('MessagesSent', array($param));
echo '<pre/>';
print_r($response);
if($response->MessagesSentResult->Result){
	echo 'Message: '.$response->MessagesSentResult->Message;
}
else {
	echo 'Message: '.$response->MessagesSentResult->Message;
}

?>

REST

Method: GET

URL: https://ui.solutionsbytext.com/SBT.App.SetUp/RSServices/ReportRSService.svc/MessagesSent?securityToken=safdsfs&orgCode=dfsf&fromDate=01/31/2015 00:00:00&toDate=01/30/2016 00:00:00&note=sampleNote

Response:

The response will be in JSON format like below:

{" MessagesSentResult": {
   "Result": true,
   "ErrorCode": 1441,
   "Message": " Successfully retrieved messages sent report",
   "Response": { "List<WSReportSentMessageRow> response –
                        Sent Messages details like Code,Group,Message etc. Information will display" }
   }}

 

 

Send Feedback