Overview
This method is used to initiate the VBT process. If VBT type set as PIN, then PIN will be sent along with Verify message. For other VBT types, preset verify message will be sent.
Below is the functionality:
For Active Subscribers
Status will not be changed and no verify message will be sent. User will get an error message "Subscriber information already exists"
For Inactive Subscribers
Status of the subscriber will be changed to 'Under Verification' and verify message will be sent to process VBT.
For New Subscribers
Status of the subscriber will be set to 'Under Verification' and verify message will be sent to process VBT.
Syntax
[OperationContractAttribute()] SBT.API.DataContracts.Admin.WSVerificationResponse RequestVBT( string securityToken, string orgCode, string phone )
WSDL
Production: https://ui.solutionsbytext.com/Sbt.App.SetUp/WSServices/MessageWSService.svc?singlewsdl
Staging: https://test.solutionsbytext.com/Sbt.App.SetUp/WSServices/MessageWSService.svc?singlewsdl
Parameters
securityToken
- String[1000] (Required) - SecurityToken to authenticate the user.
orgCode
- String[20] (Required) - Default Organization Code of group for which subscription is made. (For Org and Division codes, the subscription is made to all the groups)
phone
- String[20] (Required) - Phone number with/without country code.
Return Value
WSLoginResponse
Name | Type | Description |
---|---|---|
Result | bool | True/False whether the call was successful or not. |
ErrorCode | int | For Success/Failure it will return an error number. |
Message | string | Message related to the error code |
Pin | string | Unique PIN generated for VBT. (PIN is generated only when VBT type is set as PIN) |
Examples
C#
lblError.Text = ""; MessageClient messageResult = new MessageClient("MessageWSServiceHttpEndpoint"); string securityToken = txtToken.Text; ; string orgCode = txtOrgCode.Text; string phoneNo = txtMobileNo.Text; WSVerificationResponse wSVerificationResponse = messageResult.RequestVBT(securityToken, orgCode, phoneNo); if (!wSVerificationResponse.Result) { //handle error lblError.Text = wSVerificationResponse.Message; } else { //handle success lblError.Text = wSVerificationResponse.Message; }
SOAP
Soap Request <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ser="http://SBTService/ServiceContracts/"> <soapenv:Header/> <soapenv:Body> <ser:RequestVBT> <!--Required:--> <ser:securityToken>Security Token</ser:securityToken> <!--Required:--> <ser:orgCode>Org Code</ser:orgCode> <!--Required:--> <ser:phone>phone number</ser:phone> </ser:RequestVBT> </soapenv:Body> </soapenv:Envelope> Soap Response <s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/"> <s:Body> <RequestVBTResponse xmlns="http://SBTService/ServiceContracts/"> <RequestVBTResult 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>1287</a:ErrorCode> <a:Message>Subscriber and Verification Details Inserted Successfully</a:Message> <a:Pin>PIN</a:Pin> </RequestVBTResult> </RequestVBTResponse> </s:Body> </s:Envelope>
JAVA
MessageWSService srv = new MessageWSService(); IMessage iMessage = srv.getMessageWSServiceHttpEndpoint1(); WSVerificationResponse res = null; String securityToken = "securityToken"; String orgCode = "orgcode"; String phoneNo = "12345678901"; try { res = iMessage.requestVBT(securityToken, orgCode, phoneNo); } catch (Throwable e) { e.printStackTrace(); } if(res == null ){ System.out.println("Erron::"); return; } if (!res.isResult()) { //handle error System.out.println("ErrorCode::"+res.getErrorCode()); System.out.println("ErrorMessage::"+res.getMessage()); } else { //handle success System.out.println("ID::"+res.getId()); System.out.println("Message::"+res.getMessage().getValue()); }
PHP
<?php $client = new SoapClient("https://ui.solutionsbytext.com/Sbt.App.SetUp/wsservices/MessageWSService.svc?wsdl"); $param = array( 'securityToken' =--> 'securityToken', 'orgCode' => 'orgCode', 'phone' => '12345678999', ); $response = $client->__soapCall('RequestVBT', array($param)); echo '<pre?>'; print_r($response); if($response->RequestVBTResult->Result){ echo $response->RequestVBTResult->Message; echo $response->RequestVBTResult->Id; } else { echo $response->RequestVBTResult->Message; } ?>
REST
Method: POST
URL: https://ui.solutionsbytext.com/SBT.App.SetUp/RSServices/MessageRSService.svc/RequestVBT
Sample C# Code:
var requestdata = new { securityToken = "validsecurityToken", orgCode = "orgCode", phone = "1234567891" }; string data2 = JsonConvert.SerializeObject(requestdata).ToString(); System.Net.WebClient webClient = new System.Net.WebClient(); webClient.Headers["Content-type"] = "application/json"; webClient.Encoding = Encoding.UTF8; var strRequestVBTResponse = webClient.UploadString("https://ui.solutionsbytext.com/SBT.App.SetUp/RSServices/MessageRSService.svc/RequestVBT", "POST", data2); Note:“strRequestVBTResponse” contains the output response as return values
Response:
The response will be in JSON format like below: {" RequestVBTResult": { "Result": true, "ErrorCode": 1287, "Message": " Subscriber and Verification Details Inserted Successfully", “PIN”: " 1567981" }}