Overview

Using this service, user can create Short URL using a custom keyword.

 

Syntax

C#

public WSGeneralResponse CreateShortURLusingCustomKeyword(string securityToken, string orgCode, string domain, string CustomKeyword, string targetLongURL, bool overwrite)

 

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 or organization.

Domain
– String[20] (Optional) – Domain name. If not mentioned default domain set will be used.

CustomKeyword
– String[20] (Required) – Custom Keyword to create short URL. Only ‘_’, ‘-‘and alphanumeric is allowed.

targetLongURL
– String[1100] (Required) – Correspond Long URL of Short URL.

overwrite
– Boolean[1] (Optional) – If this value is 1, then Custom Keyword ShortURL is created even though keyword is used by other client. By default if not value given it is considered as ‘0’

Return Value

CreateShortURLusingCustomKeywordResponse

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.

 

Example

C#

lblError.Text = "";
SmartClickClient smartClickResult = new SmartClickClient("SmartClickWSServiceHttpEndpoint");
string securityToken = txtToken.Text;
string orgCode = txtOrgCode.Text;
string domain = txtDomain.Text;
string CustomKeyword = txtKeyword.Text;
string targetLongURL = txtLongURL.Text;

WSGeneralResponse wSGeneralResponse = smartClickResult.CreateShortURLusingCustomKeyword(securityToken, orgCode, domain, CustomKeyword, targetLongURL, false);

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:CreateShortURLusingCustomKeyword>
<!--Required:-->
<ser:securityToken>Security Token</ser:securityToken>
<!--Required:-->
<ser:orgCode>Organization Code</ser:orgCode>
<!--Optional:-->
<ser:domain>Branded Short Domain</ser:domain>
<!--Required:-->
<ser:CustomKeyword>Custom Keyword</ser:CustomKeyword>
<!--Required:-->
<ser:targetLongURL>Corresponding target</ser:targetLongURL>
<!--Optional:-->
<ser:overwrite>1/0</ser:overwrite>
</ser:CreateShortURLusingCustomKeyword>
</soapenv:Body>
</soapenv:Envelope> 

Soap Response 
<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">
<s:Body>
<CreateShortURLusingCustomKeywordResponse xmlns="http://SBTService/ServiceContracts/">
<CreateShortURLusingCustomKeywordResult xmlns:a="http://SBTAPIService/DataContract/" xmlns:i="http://www.w3.org/2001/XMLSchema-instance">
<a:ErrorCode>1528</a:ErrorCode>
<a:Message>Successfully generated the shortURL.</a:Message>
</CreateShortURLusingCustomKeywordResult>
</CreateShortURLusingCustomKeywordResponse>
</s:Body>
</s:Envelope>

REST

Method: GET
URL: https://ui.solutionsbytext.com/SBT.App.SetUp/RSServices/SmartClickRSService.svc/CreateShortURLusingCustomKeyword?securityToken=Security_Token&orgCode=Organization_Code&domain=sclk.me&CustomKeyword=Custom_Keyword&targetLongURL=Corresponding_Target_Long_URL&overwrite=true

Response:

The response will be in JSON format like below:
{
"CreateShortURLusingCustomKeywordResult": {
"ErrorCode": 1528,
"Message": "Successfully generated the shortURL."
}
}

 

Send Feedback