GetShortURLReport
Overview
Returns the Short URLs generated based on the input Date and Time Range.
Syntax
C#
[OperationContractAttribute()] SBT.API.DataContracts.Admin.WSReportShortUrlDetailsResponse GetShortUrlReport(string securityToken, string orgCode, string fromDate, string toDate);
WSDL
Production: https://ui.solutionsbytext.com/SBT.App.SetUp/wsservices/SmartclickWSService.svc?singlewsdl
Staging: https://test.solutionsbytext.com/SBT.App.SetUp/wsservices/SmartclickWSService.svc?singlewsdl
Parameters
securityToken
- String[1000] (Required) - Security Token to authenticate the user
orgCode
- String[20] (Required) - Organization Code for the group, division, organization.
fromDate
- String[20] (Required) - Start date for report of Short URLs generated. Date format is [mm/dd/yyyy hh:mm:ss].
toDate
- String[20] (Required) - End date for report of Short URLs generated. Date format is [mm/dd/yyyy hh:mm:ss].
Return Value
WSGetShortUrlReportResponse
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 the Error code. |
Response |
<a:WSReportShortUrlDetailsRow> |
List of Response parameters, LongURL- Long URL passed in request to get Short URL. CreatedOn – Short URL Created Date. AccessOn – Short URL latest updated date. TotalRequest – Count of number of times same Short URL is requested.
|
Example
C#
lblError.Text = ""; SmartClickClient smartClickResult = new SmartClickClient("SmartClickWSServiceHttpEndpoint"); string securityToken = txtToken.Text; string orgCode = txtOrgCode.Text; string fromDate = txtFromDate.Text; string toDate = txtToDate.Text; WSReportShortUrlDetailsResponse wSResponse = smartClickResult.GetShortUrlReport(securityToken, orgCode, fromDate, toDate); if (!wSResponse.Result) { //handle error lblError.Text = wSResponse.Message; } else { //handle success lblError.Text = wSResponse.Message; }
SOAP
Soap Request <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ser="http://SBTService/ServiceContracts/"> <soapenv:Header/> <soapenv:Body> <ser:GetShortUrlReport> <!--Required:--> <ser:securityToken>Security Token</ser:securityToken> <!--Required:--> <ser:orgCode>Organization Code</ser:orgCode> <!--Required:--> <ser:fromDate>05/07/2017 02:00:00</ser:fromDate> <!--Required:--> <ser:toDate>05/07/2018 03:00:00</ser:toDate> </ser:GetShortUrlReport> </soapenv:Body> </soapenv:Envelope> Soap Response <s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/"> <s:Body> <GetShortUrlReportResponse xmlns="http://SBTService/ServiceContracts/"> <GetShortUrlReportResult xmlns:a="http://SBTAPIService/DataContract/" xmlns:i="http://www.w3.org/2001/XMLSchema-instance"> <a:Result>true</a:Result> <a:ErrorCode>1553</a:ErrorCode> <a:Message>Successfully retrieved short URL.</a:Message> <a:Response> <a:WSReportShortUrlDetailsRow> <a:ShortURL>sclk.me/2ddwAWT</a:ShortURL> <a:LongURL>http://www.LongURL.com</a:LongURL> <a:CreatedOn>5/7/2018 2:45:34 AM</a:CreatedOn> <a:AccessOn>5/7/2018 2:45:34 AM</a:AccessOn> <a:TotalRequest>1</a:TotalRequest> </a:WSReportShortUrlDetailsRow> </a:Response> </GetShortUrlReportResult> </GetShortUrlReportResponse> </s:Body> </s:Envelope>
REST
Response:
The response will be in JSON format as below: { "GetShortUrlReportResult": { "Result": true, "ErrorCode": 1553, "Message": "Successfully retrieved short URL.", "Response": [ { "ShortURL": "sclk.me/2I2B4Ty", "LongURL": "http://www.LongURL.com", "CreatedOn": "5/7/2018 2:44:46 AM", "AccessOn": "5/7/2018 2:44:46 AM", "TotalRequest": 1 } ] } }