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

Get the cellular carrier ID and Name for a specific phone number.

Carrier Lookup Limit:

Carrier lookups can be done up to 10 parallel requests with 10 numbers in each request.

 

Syntax

C#

[OperationContractAttribute()]
SBT.API.DataContracts.Common.WSCarrierLookupResponse GetCarrierLookup(
    string securityToken,
    List<string> phone
    string orgCode
)

 

WSDL

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

Staging: https://test.solutionsbytext.com/Sbt.App.SetUp/WSServices/GeneralWSService.svc?singleWsdl

 

 

Parameters

securityToken

- String[1000] (Required) - SecurityToken to authenticate the user

phone

- List<string> (Required) - List of phone numbers to be checked for Carrier Code (with country code).

orgCode

- String[20] (Required) - Organization Code for the group, division, organization or company.

Note: Upto 10 phone numbers can be looked for carriers in a single request.


Return Value

WSCarrierPhoneResponse
NameTypeDescription
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 List<WSCarrierPhoneRow> List of carrier phone.
Carrier - Carrier Name of cellular phone number.
CarrierCode - Carrier Code of cellular phone number.
International - True-It is an international number, False = It is not international.
Invalid - True = It is an Invalid number, False = It is valid. 
Landline - True = It is a Landline number, False = It is not Landline number.
Phone - The phone number that was checked.


Example

C#

lblError.Text = "";
GroupClient generalService = new GroupClient("ReportWSServiceHttpEndpoint2");
    string securityToken = txtToken.Text;
    string orgCode = txtOrgCode.Text;
    string[] phone = txtPhone.Text.Trim().Split(',');

WSCarrierLookupResponse wSCarrierLookupResponse = generalService.GetCarrierLookup(securityToken, phone, orgCode);

        if (!wSCarrierLookupResponse.Result)
            {
                //handle error
                lblError.Text = wSCarrierLookupResponse.Message;
            }
        else
            {
                //handle success
                lblError.Text = wSCarrierLookupResponse.Message;
            }

SOAP

Soap Request 

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ser="http://SBTService/ServiceContracts/" xmlns:arr="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
   <soapenv:Header/>
   <soapenv:Body>
      <ser:GetCarrierLookup>
         <!--Required:-->
         <ser:securityToken>Security Token</ser:securityToken>
         <!--Required:-->
         <ser:phone>
            <!--Zero or more repetitions:-->
            <arr:string>Phone Number</arr:string>
         </ser:phone>
         <!--Required:-->
         <ser:orgCode>Org Code</ser:orgCode>
      </ser:GetCarrierLookup>
   </soapenv:Body>
</soapenv:Envelope>

            
Soap Response

<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">
   <s:Body>
      <GetCarrierLookupResponse xmlns="http://SBTService/ServiceContracts/">
         <GetCarrierLookupResult 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>1436</a:ErrorCode>
            <a:Message>Resolve carrier executed successfully</a:Message>
            <a:Response>
               <a:WSCarrierPhoneRow z:Id="i2">
                  <a:CarrierCode>79</a:CarrierCode>
                  <a:Carrier>T-Mobile</a:Carrier>
                  <a:International>false</a:International>
                  <a:Invalid>false</a:Invalid>
                  <a:Landline>false</a:Landline>
                  <a:Phone>1234567890</a:Phone>
               </a:WSCarrierPhoneRow>
            </a:Response>
         </GetCarrierLookupResult>
      </GetCarrierLookupResponse>
   </s:Body>
</s:Envelope>

PHP (GET CARRIER FOR SINGLE NUMBER)

<?php
    $client = new SoapClient("<< GeneralWSService WSDL URL >>");
    $param = array(
		'securityToken' => 'securityToken',
		'phone' => array ('string'=>'12312312345'),
		'orgCode' => 'orgCode'
	);

	
		
$response = $client->__soapCall('GetCarrierLookup', array($param));
echo '
';
print_r($response);
if($response->GetCarrierLookupResult->Result){
	echo 'Message: '.$response->GetCarrierLookupResult->Message;
}
else {
	echo 'Message: '.$response->GetCarrierLookupResult->Message;
}
?>

 


EXAMPLE 2: GET CARRIER FOR MULTIPLE NUMBERS

<?php
    $client = new SoapClient("<< GeneralWSService WSDL URL >>");
    $param = array(
		'securityToken' => 'securityToken',
		'phone' => array ('string'=>array('12312312345','12341234123')),
		'orgCode' => 'orgCode'
	);

	
		
$response = $client->__soapCall('GetCarrierLookup', array($param));
echo '
';
print_r($response);
if($response->GetCarrierLookupResult->Result){
	echo 'Message: '.$response->GetCarrierLookupResult->Message;
}
else {
	echo 'Message: '.$response->GetCarrierLookupResult->Message;
}
?>

REST

Method: GET

URL for singlenumber lookup:

https://ui.solutionsbytext.com/SBT.App.SetUp/RSServices/GeneralRSService.svc/GetCarrierLookup?securityToken=securityToken&phone=[PhoneNumber]&orgCode=orgCode

URL for multiple number lookup:

URL: https://ui.solutionsbytext.com/SBT.App.SetUp/RSServices/GeneralRSService.svc/GetCarrierLookup?securityToken=SecurityToken&phone=[12223334444,12223334445,12223334446]&orgCode=OrgCode

Note: The "phone" parameter in the request with List<String> should pass these parameters as a list per the sample C# code shown below.

Sample C# Code:

var listOfPhones = new string[] { "test", "test123", "test456" };
                var ArrlistOfPhones = JsonConvert.SerializeObject(listOfPhones).ToString();                

                System.Net.WebClient webClientGet = new System.Net.WebClient();

                Uri getURi = new Uri("https://ui.solutionsbytext.com/SBT.App.SetUp/RSServices/GeneralRSService.svc/GetCarrierLookup?securityToken=" + "safdsfs" + "&phone=" + ArrlistOfPhones + "&orgCode=" + "dfsf" + "");

var GetCarrierLookupResponse = webClientGet.DownloadString(getURi);

Note: “GetCarrierLookupResponse” will be in JSON format.

Response:

The response will be in JSON format like below:

{" GetCarrierLookupResult": {
   "Result": true,
   "ErrorCode": 1436,
   "Message": " Resolve carrier executed successfully",
   "Response": { "List<WSCarrierPhoneRow> response – List of carrier Phone in JSON format" }
}}






 Send Feedback