Reporting Limits:
1 connection per 15 minutes
No connections from 12:00AM to 2:00AM Central Time
Overview
Report of subscribers existing in a group with details on their susbcription method across the company.
Syntax
C#
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 Subscription. Date format is [mm/dd/yyyy].
- toDate
-
– String[20] (Required) – End date for Subscription. Date format is [mm/dd/yyyy].
- all
-
– bool (Optional) – True = Returns all subscribers no matter the date range provided, False = Returns subscribers subscribed based on the from_date and to_date supplied (Company, Organization, Division or Group). If left blank the default is false.
- unique
-
– bool (Optional) – True = Returns the subscriber once. Status and Optout Date fields return as NULL. False = Returns the subscriber as many times as they have subscriptions within the organization (Company, Organization, Division or Group). If left blank the default is false.
-
Note : If ‘all’ and ‘unique’ = True ,then it returns all the unique subscribers no matter the date range provided,If ‘all’ and ‘unique’ = False, then it returns subscribers subscribed based on the from_date and to_date provided (Company, Organization, Division or Group). If left blank the default is false.
Return Value
WSReportSubscribersResponse
| 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. CarrierID – The wireless provider ID for the subscriber carrier. Carrier – The wireless provider name for the subscriber carrier. Phone – Phone number of the subscriber. FirstName – First name of subscriber. LastName – Last name of subscriber. Landline – Landline phone number if set. Email – Email address of subscriber if set. Group – Group to subscription is made. Status – Status of subscriber(Returns list of active,Inactive,Underverification, Blocked subscribers if ‘Unique’ set as false). OptinMethod – Method the susbcriber was opted into the system. OptinDate – Date the subscriber was opted into the company, organization, division or group. OptOutDate – Date of the subscriber was opted out of the company, organization, division or group (This will not be displayed if ‘Unique’ set as true). CustomField1 – CustomField1 of Subscriber. CustomField2 – CustomField2 of Subscriber. CustomField3 – CustomField3 of Subscriber. PrivateCode – UniqueID of Subscriber. While updating subscriber use PrivateCode or UniqueID UniqueID – UniqueID of Subscriber. It is recommended to use this field for UniqueID instead of Private code |
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;
bool all = chkAll.Checked;
bool unique = chkUnique.Checked;
WSReportSubscribersResponse wSReportSubscribersResponse = reportService.Subscribers(securityToken, orgCode, fromDate, toDate, all, unique);
if (!wSReportSubscribersResponse.Result)
{
//handle error
lblError.Text = wSReportSubscribersResponse.Message;
}
else
{
//handle success
lblError.Text = wSReportSubscribersResponse.Message;
}SOAP
Soap Request
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ser="http://SBTService/ServiceContracts/">
<soapenv:Header/>
<soapenv:Body>
<ser:Subscribers>
<!--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:all>0/1</ser:all>
<!--Optional:-->
<ser:unique>0/1</ser:unique>
</ser:Subscribers>
</soapenv:Body>
</soapenv:Envelope>
Soap Response
<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">
<s:Body>
<SubscribersResponse xmlns="http://SBTService/ServiceContracts/">
<SubscribersResult 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>1438</a:ErrorCode>
<a:Message>Successfully retrieved subscriber report</a:Message>
<a:Response z:Id="i2">
<a:WSReportSubscriberRow z:Id="i2">
<a:Carrier>Carrier</a:Carrier>
<a:CarrierID>CarrierID</a:CarrierID>
<a:Email_x0020_>Email</a:Email_x0020_>
<a:FirstName_x0020_>FirstName</a:FirstName_x0020_>
<a:Group>Org1->Div2->Grp01</a:Group>
<a:LastName>LastName</a:LastName>
<a:OptinDate>8/30/2013 2:49:36 PM</a:OptinDate>
<a:OptinMethod>UI</a:OptinMethod>
<a:OptOutDate>8/30/2013 2:49:36 PM</a:OptOutDate>
<a:Phone>MobilePhone</a:Phone>
<a:Status>Active</a:Status>
<a:CustomField1>CustomField1</a:CustomField1>
<a:CustomField2>CustomField2</a:CustomField2>
<a:CustomField3>CustomField3</a:CustomField3>
<a:PrivateCode>PrivateCode</a:PrivateCode>
<a:UniqueID>UniqueID of Subscriber</a:UniqueID>
</a:WSReportSubscriberRow>
</a:Response>
</SubscribersResult>
</SubscribersResponse>
</s:Body>
</s:Envelope>
JAVA
ReportWSService srv = new ReportWSService();
IReport iReport = srv.getReportWSServiceHttpEndpoint1();
WSReportSubscribersResponse res = null;
String securityToken = "securityToken";
String orgCode = "OrgCode";
String fromDate = "08/22/2013";
String toDate = "09/22/2013";
String note = "test";
Boolean all = true;
Boolean unique = true;
try {
res = iReport.subscribers(securityToken, orgCode, fromDate, toDate, all, unique);
} 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',
'all' => '0',
'unique' => '0'
);
$response = $client->__soapCall('Subscribers', array($param));
echo '<pre/>';
print_r($response);
if($response->SubscribersResult->Result){
echo 'Message: '.$response->SubscribersResult->Message;
}
else {
echo 'Message: '.$response->SubscribersResult->Message;
}
?>
The response will be in JSON format like below:
{" SubscribersResult": {
"Result": true,
"ErrorCode": 1438,
"Message": " Successfully retrieved subscriber report",
"Response": { "List<WSReportSubscriberRow> response –
Subscribers details like Carreir,CarrierID,Group,Email etc. Information will display" }
}}