Business at the Speed of Text

Take a few minutes to watch how Solutions by Text can provide you with a compliant solution to enhance the customer experience and increase your bottom line through the power of texting.

Watch Videos

Two-Way Texting Changes the Game

Put real-time text responses in your customers’ pockets and real-time access at your staff’s fingertips.

Find Out More

Two-Way Texting Changes the Game

Put real-time text responses in your customers’ pockets and real-time access at your staff’s fingertips.

Find Out More

Business at the Speed of Text

Take a few minutes to watch how Solutions by Text can provide you with a compliant solution to enhance the customer experience and increase your bottom line through the power of texting.

Watch Videos

We're here for you.

Solutions by Text offers 24 hour support - both online and offline.

Give us a Call

Two-Way Texting Changes the Game

Put real-time text responses in your customers’ pockets and real-time access at your staff’s fingertips.

Find Out More

See What's New

Solutions by Text continues to evolve and develop its suite of products and features. Take a look at what's new in our world.

Read more

We Work With the Best

From retail to financial solutions, we’re constantly working with our clients to push the boundaries and find new ways to leverage SMS for business.

See Our Success Stories

Overview

This method returns the security token, which is used in all methods for authentication.

 

Syntax

[OperationContractAttribute()] 
SBT.API.DataContracts.Common.WSLoginResponse AuthenticateAPIKey( 
   SBT.API.DataContracts.Common.LoginRequestDetails loginRequest 
)


WSDL

Production: https://ui.solutionsbytext.com/Sbt.App.SetUp/WSServices/LoginAPIService.svc?singleWsdl

Staging: https://test.solutionsbytext.com/Sbt.App.SetUp/WSServices/LoginAPIService.svc?singlewsdl

 

Parameters

loginRequest

- LoginRequestDetails - LoginRequestDetails contains login details

* APIKey - string (Required); APIKey generated at Tenant, Organization or Division level.

 

Return Value

WSLoginResponse
NameTypeDescription

Result

bool

True/False whether the call was successful or not.

ErrorCode

int

For Success/Failure it will generate error number

Message

string

Message related to the error code

SecurityToken

string

SecurityToken returned from the APIKey for API authentication purpose.

 

Examples

C#

LoginAPIClient login = new LoginAPIClient("LoginAPIServiceHttpEndpoint");

  // Create loginRequestDetails
            LoginRequestDetails loginRequestDetails = new LoginRequestDetails();
            loginRequestDetails.APIKey = txtAPI.Text;

            WSLoginResponse wSLoginResponse = login.AuthenticateAPIKey(loginRequestDetails);
            txtToken.Text ="";
            //process response
            if (!wSLoginResponse.Result)
            {
                //handle error
               txtToken.Text = wSLoginResponse.Message;
            }
            else
            {
                //handle success
                txtToken.Text = wSLoginResponse.SecurityToken;
            }

 

SOAP

SOAP Request:
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ser="http://SBTService/ServiceContracts/" xmlns:ser1="http://schemas.microsoft.com/2003/10/Serialization/" xmlns:dat="http://SBTAPIService/DataContract/">
   <soapenv:Header/>
   <soapenv:Body>
      <ser:AuthenticateAPIKey>
         <ser:loginRequest>
             <!--Required:-->
            <dat:APIKey>API Key</dat:APIKey>
            <!--Optional:-->
            <dat:UserName>?</dat:UserName>
            <!--Optional:-->
            <dat:Password>?</dat:Password>
         </ser:loginRequest>
      </ser:AuthenticateAPIKey>
   </soapenv:Body>
</soapenv:Envelope>

SOAP Response:
<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">
   <s:Body>
      <AuthenticateAPIKeyResponse xmlns="http://SBTService/ServiceContracts/">
         <AuthenticateAPIKeyResult 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>1400</a:ErrorCode>
            <a:Message>Successfully generated securitytoken</a:Message>
            <a:SecurityToken>Security token</a:SecurityToken>
         </AuthenticateAPIKeyResult>
      </AuthenticateAPIKeyResponse>
   </s:Body>
</s:Envelope>

 

JAVA

LoginWSService srv = new LoginWSService();		
ILoginAPI iLoginAPI = srv.getLoginAPIServiceHttpEndpoint1();
LoginRequestDetails loginRequest = newLoginRequestDetails();
JAXBElement apikey =  newJAXBElement(new QName("http://SBTAPIService/DataContract/", "APIKey"),
				new String("").getClass(),"APIKey-Text");
loginRequest.setAPIKey(apikey);
WSLoginResponse wsLoginResponse = null;
try 
{
    wsLoginResponse = iLoginAPI.authenticateAPIKey(loginRequest);
} 
catch (Throwable e) 
{			
	e.printStackTrace();
}
if(wsLoginResponse == null)
{
System.out.println("Erron while authenticating APIKey::");
return;
}             
// Process Response
if(wsLoginResponse.isResult()) 
{
	//handle success
	System.out.println("Success authenticating APIKey::"+wsLoginResponse.getMessage().getValue());
	System.out.println("Security token::"+wsLoginResponse.getSecurityToken().getValue());
} 
else
{
	//handle error
	System.out.println("Erron while authenticating APIKey::"+wsLoginResponse.getMessage());

}

 

PHP

<?php
    $client = new SoapClient("https://ui.solutionsbytext.com/Sbt.App.SetUp/WSServices/LoginAPIService.svc?wsdl");
    $param = array(
    'loginRequest' =>  array(
			'APIKey' => 'APIKey-Text'
							)
		          );
	$response = $client->__soapCall('AuthenticateAPIKey', array($param));

	if($response->AuthenticateAPIKeyResult->Result){
		echo $response->AuthenticateAPIKeyResult->Message;
		echo $response->AuthenticateAPIKeyResult->SecurityToken;
	}
	else {
		echo $response->AuthenticateAPIKeyResult->Message;
		}

?>

 

REST

Method: GET

URL: https://ui.solutionsbytext.com/SBT.App.SetUp/RSServices/LoginAPIService.svc/AuthenticateAPIKey?APIKey={APIKey}

Note: Here {APIKey} is the parameter which has to be passed to authenticate and get the security token.

Response:

The response will be in JSON format like below:

{"AuthenticateAPIKeyResult": {
   "Result": true,
   "ErrorCode": 1400,
   "Message": "Successfully generated securitytoken",
   "SecurityToken": "Some Security Token"
}}

 

Send Feedback