Overview
Using this service user can update the Target LongURL for custom Short URL .
Syntax
C#
public WSGeneralResponse UpdateTargetForCustomURL(string securityToken, string customShortURL, string targetLongURL, string orgCode)
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
customShortURL
- String[20] (Required) – CustomShortURL to which long URL needs to be updated.
targetLongURL
- String[1100] (Required) – New long URL to be associated to Custom Short url.
orgCode
- String[20] (Required) - Organization Code for the group, division or organization.
Return Value
UpdateTargetForCustomURLResponse
Name | Type | Description |
---|---|---|
Result | bool | True/False wether the cell was successful or not. |
ErrorCode | int | For Success/Failure it returns an error number. |
Message | string | Message related to error code. |
Example
C#
lblError.Text = ""; SmartClickClient smartClickResult = new SmartClickClient("SmartClickWSServiceHttpEndpoint"); string securityToken = txtToken.Text; string customShortURL = txtShortURL.Text; string targetLongURL = txtLongURL.Text; string orgCode = txtOrgCode.Text; WSGeneralResponse wSGeneralResponse = smartClickResult.UpdateTargetForCustomURL(securityToken, customShortURL, targetLongURL, orgCode); if (!wSGeneralResponse.Result) { //handle error lblError.Text = wSGeneralResponse.Message; } else { //handle success lblError.Text = wSGeneralResponse.Message; }
SOAP
Soap Request <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ser="http://SBTService/ServiceContracts/"> <soapenv:Header/> <soapenv:Body> <ser:UpdateTargetForCustomURL> <!--Required:--> <ser:securityToken>Security Token</ser:securityToken> <!--Required:--> <ser:customShortURL>Custom Short URL</ser:customShortURL> <!--Required:--> <ser:targetLongURL>Target Long URL</ser:targetLongURL> <!--Required:--> <ser:orgCode>Organization Code</ser:orgCode> </ser:UpdateTargetForCustomURL> </soapenv:Body> </soapenv:Envelope> Soap Response <s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/"> <s:Body> <UpdateTargetForCustomURLResponse xmlns="http://SBTService/ServiceContracts/"> <UpdateTargetForCustomURLResult xmlns:a="http://SBTAPIService/DataContract/" xmlns:i="http://www.w3.org/2001/XMLSchema-instance"> <a:ErrorCode>1545</a:ErrorCode> <a:Message>Successfully updated the target URL.</a:Message> </UpdateTargetForCustomURLResult> </UpdateTargetForCustomURLResponse> </s:Body> </s:Envelope>
REST
Method: PUT
URL: https://ui.solutionsbytext.com/SBT.App.SetUp/RSServices/SmartClickRSService.svc/UpdateTargetForCustomURL
Request: { "securityToken": "Security Token", "customShortURL": "Custom URL", "targetLongURL": "Target Long URL", "orgCode": "Organization Code" } Response: The response will be in JSON format like below: { "UpdateTargetForCustomURLResult": { "ErrorCode": 1545, "Message": "Successfully updated the target URL." } }