Overview
Returns the Long URL and other statistics based on input Short URL and Org Code.
Syntax
[OperationContractAttribute()] SBT.API.DataContracts.Admin.WSShortURLExpandResponse GetShortURLDetails( String securityToken, string orgCode, string shortURL );
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
shortURL
-String[50] (Required) – Short URL of which information to be generated.
orgCode
-String[20] (Required) - Organization Code for the group, division, organization or Tenant where the Short URL is generated. OrgCode is a required field for software partner but not for Tenant customer type.
Return Value
WSGetShortURLResponse
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 | Response |
List of Response parameters, |
Example
C#
lblError.Text = ""; SmartClickClient smartClickResult = new SmartClickClient("SmartClickWSServiceHttpEndpoint"); string securityToken = txtToken.Text; string orgCode = txtOrgCode.Text; string shortURL = txtShortURL.Text; WSShortURLExpandResponse wSShortURLExpandResponse = smartClickResult.GetShortURLDetails(securityToken, orgCode, shortURL); if (!wSShortURLExpandResponse.Result) { //handle error lblError.Text = wSShortURLExpandResponse.Message; } else { //handle success lblError.Text = wSShortURLExpandResponse.Message; }
SOAP
Soap Request <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ser="http://SBTService/ServiceContracts/"> <soapenv:Header/> <soapenv:Body> <ser:GetShortURLDetails> <!--Required:--> <ser:securityToken>Security Token</ser:securityToken> <!--Required:--> <ser:orgCode>Org Code</ser:orgCode> <!--Required:--> <ser:shortURL>Sclk.me/2A754u7</ser:shortURL> </ser:GetShortURLDetails> </soapenv:Body> </soapenv:Envelope> Soap Response <s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/"> <s:Body> <GetShortURLDetailsResponse xmlns="http://SBTService/ServiceContracts/"> <GetShortURLDetailsResult xmlns:a="http://SBTAPIService/DataContract/" xmlns:i="http://www.w3.org/2001/XMLSchema-instance"> <a:Result>true</a:Result> <a:ErrorCode>1531</a:ErrorCode> <a:Message>Successfully retrieve the information.</a:Message> <a:Response xmlns:b="http://schemas.datacontract.org/2004/07/SBT.API.DataContracts.Admin"> <b:CompanyName>Tenant Name</b:CompanyName> <b:OrganizationName>Org01</b:OrganizationName> <b:CreatedOn>11/23/2017 1:43:25 AM</b:CreatedOn> <b:LongURL>Long URL from which Short URL Generated</b:LongURL> <b:ShortURL>sclk.me/2A754u7</b:ShortURL> <b:TotalRequest>2</b:TotalRequest> <b:TotalClicks>5</b:TotalClicks> </a:Response> </GetShortURLDetailsResult> </GetShortURLDetailsResponse> </s:Body> </s:Envelope>
PHP
REST
Method: GET
Response:
The response will be in JSON format like below: { "GetShortURLDetailsResult": { "Result": true, "ErrorCode": 1531, "Message": "Successfully retrieve the information.", "Response": { "CompanyName": "Tenant Name", "OrganizationName": "Org02", "CreatedOn": "11/23/2017 1:43:25 AM", "LongURL": "http://www.test.com", "ShortURL": "sclk.me/2A754u7", "TotalRequest": 2, "TotalClicks": 5 } } }