Knowledgebase:
Login
Posted by Mohammad Rahhal, Last modified by Angham Al-Banawien on 18 July 2018 11:58 AM

Syntax 

Login (username As String, password As String)

Description

The Login operation should be called before any other operation. Since any requesting operation have to be authenticated
before.

Request Parameters

Name Description  Required

Username

  • The username given by the company.
  • Type: String.
  • Default: None.
Yes
Password
  • The password given by the company.
  • Type: String.
  • Default: None.
Yes


Response Elements

Name Description 
Result

This operation returns a Composite JSON object of type ClientLoginInfo. In case of success.
The following are the ClientLoginInfo's Data member:

  • sessionid:  The session number

  • VersionInfo: Array which contains:
    1- Rel: Release number.
    2- Ver: Version number.
    3- Patch: Patch number.
    4- ForceUpdate.
    5- UpdateType.
    6- Globals.
  • SystemLockInfo, Which contains:
    1- MinutesRemaining.
    2- HoursRemaining.
    3- DaysRemaining.
    4- Maintenance.
    5- WillBeLocked.

  • FirstWhiteLabel: First White label name.
  • WLID: white label ID.
  • CheckWhiteLabel,  If the value = true, then the logged in client is white label.
  • Password: Client logged in password.
  • Username: Client logged in username.
  • LastTickTime: Last tick time value.
  • SelectedAccount: Selected Account number.
  • SelectedAccountObject.
  • Name: Selected account name.
  • GWSessionID: Getaway session ID.
  • IP: IP address.
  • SessionDateStart: Session date Start.
  • CompanyName: Company name.
  • UserType:
    If the value = 1 then the user type is DealerUser.
    If the value = 2 then the user type is  ClientUser.
    If the value = 3 then the user type is DemoClientUser.
  • UserId: If the value < 0 then, see error code to get Error description.
  • DemoClient:
    If the value = 0, then the Client type is a real Client.
    If the value =1, then the client type is a demo Client.
  • FName: First name.
  • SName: Second Name.
  • TName: Third Name.
  • LName: Last Name.
  • Sms: Enable SMS, if its value = 1 then the SMS is Enabled.
  • IsReadOnly: If its value = 1 then the client is read only.
  • AlertSms: Enable Alert by SMS, if its value = 1 then it is Enabled.
  • GMTOffset: GMT Offset value.
  • SvrGMT: Server GMT value.
  • ClientType:
    If the value = 1 then Client Type  is Client. 
    If the value = 2 then client type is OFFICE.
    If the value = 3 then client type is Group.
  • EnableNews: If its value = 1 then the news is Enabled.
  • PublicSlideNews: Public news value.
  • PrivateSlideNews: Private news value.
  • CommCalcType: Commission calculation type. 
     If value = 1 then commCalcType is OPEN_TYPE.
     If value = 2 then commCalcType is CLOSE_TYPE.
  • DealerTreePriv: Dealer tree privilege.
  • DepID : Detected department number that the logged in client is under its privilege

In case of login failure, please refer to the error code.

Type: JSON Object as ClientLoginInfo.

Sample

Download sample as text file.

 

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Login</title>
<script src="http://code.jquery.com/jquery-latest.js"></script>
</head>
<script >
$(document).ready(function () {
var urlStr = "http://5.10.64.199/vertexweb10/WebService.svc";
jQuery.support.cors = true;
$("#progress").ajaxStart(function () { $(this).css("display", "block"); });
$("#progress").ajaxComplete(function () { $(this).css("display", "none"); });
function onSuccessResult(response) {
response = eval('(' + response + ')')
if (response.UserId == -1 || response.UserId == -207) {
$("#resultData").html("Invalid username or password");
}
else if (response.UserId == -231) {
$("#resultData").html("You must have at least one account");
}
else if (response == null || response == "" || response.UserId < 0) {
$("#resultData").html("Error while login.Please try later");
}
else {
var resultStr = "SuccessResult ... UserId is :" + response.UserId + "<br/>";
resultStr += "DemoClient :" + response.DemoClient +"<br/>"
resultStr += "IsReadOnly :" + response.isReadOnly + "<br/>"
resultStr += "First Name :" + response.FName + "<br/>"
resultStr += "Username:" + response.Username + "<br/>"
resultStr += "Password:" + response.Password + "<br/>"
$("#resultData").html(resultStr);
}
}

$("#btnLogin").click(function () {
$.getJSON(urlStr + "/Login?username=" + $("#txtusername").val() + "&password=" + $("#txtpassword").val() + "&callback=?", onSuccessResult);
});
});
</script>
<body >
<table border="1px">
<tbody>
<tr>
<td>
Username: <input type="text" id="txtusername" value=""/>
Password: <input type="text" id="txtpassword" value=""/>
<button id="btnLogin"> Login </button>
</td>
</tr>
</tbody>
</table>
<div id="resultData"> </div>
<div id="resultAction"> </div>
<div style="display:none" id="progress">Loading ... </div>
</body>
</html>

 

 


See Also


VertexFX WCF Service Index

(2 vote(s))
Helpful
Not helpful

Comments (2)
Abdelhadi Mohamed
12 February 2018 07:47 PM
how if i want to login with test account
Baha'aldeen Momani
07 May 2018 06:50 PM
Hello Abdelhadi Mohamed,

Please post your inquiry as a thread over our forum (http://forum.hybrid-solutions.com/) to meet our development team and they will assist you.
Post a new comment
 
 
Full Name:
Email:
Comments:
CAPTCHA Verification 
 
Please enter the text you see in the image into the textbox below (we use this to prevent automated submissions).

Help Desk Software by Hybrid Solutions