verifyUser Web Service API

verifyUser.hbx

This document is still in draft status

The URL to invoke the verifyUser web service is: http://your.host.addr:hbjs-port-number/hbscript/verifyUser

The service user id and password are required and must be supplied in a standard Basic Authentication Header.


The HTTP Content-Type header determines input style and the HTTP Accept header determines output style.

Method

Content-Type Header

Accept Header

Input Style

Output Style

GET

N/A

application/xml

URL Query String

XML

GET

N/A

application/json

URL Query String

JSON

POST

application/xml

application/xml

XML

XML

POST

application/xml

application/json

XML

JSON

POST

application/json

application/json

JSON

JSON


Note: If Accept header is not specified application/json is assumed.  If Content-Type header is not specified and is applicable then application/json is assumed.

HTTP Status Codes

401 - Invalid Service user ID or password supplied

200 - Valid Service user ID and password supplied

Example Input

Request TypeJSONXMLQuery String
Verify
{
 "funct" : "verify",
 "user" : "bob",
 "password" : "bobspass"
}
<verifyUser>
 <funct>verify</funct>
 <user>bob</user>
 <password>bobspass</password>
</verifyUser>
funct=verify&user=bob&password=bobspass
Change Password


{
 "funct" : "changepass",
 "user" : "bob",
 "password" : "bobspass",
 "newpassword" : "bobsnpwd"
}


<verifyUser>
 <funct>changepass</funct>
 <user>bob</user>
 <password>bobspass</password>
 <newpassword>bobsnpwd</newpassword>
</verifyUser>

funct=changepass&user=bob&password=bobspass&newpassword=bobsnpwd

Example Responses

RequestTypeJSONXML
VerifyValid User ID & Password
{
 "type": "json",
 "id": {
 "attrib": {
 "invalidAttempts": 0,
 "daysLeft": 165,
 "expireTime": 1552802400000,
 "lastUsed": 1538604060220
 },
 "esm": {
 "resp": 0,
 "resp2": 0,
 "message": "OK"
 }
 },
 "request": {
 "method": "GET",
 "contentType": "URL Query String",
 "funct": "verify",
 "user": "demo",
 "password": "N/A",
 "newpassword": "N/A",
 "accept": "*/*"
 },
 "status": {
 "success": true
 }
}


<?xml version="1.0" encoding="UTF-8"?>
<verifyUser type="xml">
 <id>
 <attrib invalidAttempts="0" daysLeft="165" expireTime="1552802400000" lastUsed="1538606100280"/>
 <esm resp="0" resp2="0" message="OK"/>
 </id>
 <request method="POST" contentType="application/xml" funct="verify" user="demo" password="N/A" newpassword="N/A" accept="application/xml"/>
 <status success="true"/>
</verifyUser>

Invalid User ID
{
 "type": "json",
 "id": {
 "esm": {
 "resp": 69,
 "resp2": 8,
 "message": "Invalid user id"
 }
 },
 "request": {
 "method": "POST",
 "contentType": "application/json",
 "funct": "verify",
 "user": "bobby",
 "password": "N/A",
 "newpassword": "N/A",
 "accept": "*/*"
 },
 "status": {
 "success": true
 }
}
<?xml version="1.0" encoding="UTF-8"?>
<verifyUser type="xml">
 <id>
 <esm resp="69" resp2="8" message="Invalid user id"/>
 </id>
 <request method="POST" contentType="application/xml" funct="verify" user="bobby" password="N/A" newpassword="N/A" accept="application/xml"/>
 <status success="true"/>
</verifyUser>
Invalid Password


{
 "type": "json",
 "id": {
 "esm": {
 "resp": 70,
 "resp2": 2,
 "message": "Invalid password"
 }
 },
 "request": {
 "method": "POST",
 "contentType": "application/json",
 "funct": "verify",
 "user": "demo",
 "password": "N/A",
 "newpassword": "N/A",
 "accept": "*/*"
 },
 "status": {
 "success": true
 }
}

<?xml version="1.0" encoding="UTF-8"?>
<verifyUser type="xml">
 <id>
 <esm resp="70" resp2="2" message="Invalid password"/>
 </id>
 <request method="POST" contentType="application/xml" funct="verify" user="demo" password="N/A" newpassword="N/A" accept="application/xml"/>
 <status success="true"/>
</verifyUser>
Revoked User ID


{
 "type": "json",
 "id": {
 "esm": {
 "resp": 70,
 "resp2": 19,
 "message": "Revoked user id"
 }
 },
 "request": {
 "method": "POST",
 "contentType": "application/json",
 "funct": "verify",
 "user": "test2",
 "password": "N/A",
 "newpassword": "N/A",
 "accept": "*/*"
 },
 "status": {
 "success": true
 }
}

<?xml version="1.0" encoding="UTF-8"?>
<verifyUser type="xml">
 <id>
 <esm resp="70" resp2="19" message="Revoked user id"/>
 </id>
 <request method="POST" contentType="application/xml" funct="verify" user="test2" password="N/A" newpassword="N/A" accept="application/xml"/>
 <status success="true"/>
</verifyUser>
Expired Password


{
 "type": "json",
 "id": {
 "esm": {
 "resp": 70,
 "resp2": 3,
 "message": "Expired password"
 }
 },
 "request": {
 "method": "POST",
 "contentType": "application/json",
 "funct": "verify",
 "user": "test1",
 "password": "N/A",
 "newpassword": "N/A",
 "accept": "*/*"
 },
 "status": {
 "success": true
 }
}

<?xml version="1.0" encoding="UTF-8"?>
<verifyUser type="xml">
 <id>
 <esm resp="70" resp2="3" message="Expired password"/>
 </id>
 <request method="POST" contentType="application/xml" funct="verify" user="test1" password="N/A" newpassword="N/A" accept="application/xml"/>
 <status success="true"/>
</verifyUser>
Change PasswordSuccess
{
 "type": "json",
 "id": {
 "esm": {
 "resp": 0,
 "resp2": 0,
 "message": "Password changed"
 }
 },
 "request": {
 "method": "POST",
 "contentType": "application/json",
 "funct": "changepass",
 "user": "test3",
 "password": "N/A",
 "newpassword": "N/A",
 "accept": "*/*"
 },
 "status": {
 "success": true
 }
}


<?xml version="1.0" encoding="UTF-8"?>
<verifyUser type="xml">
 <id>
 <esm resp="0" resp2="0" message="Password changed"/>
 </id>
 <request method="POST" contentType="application/xml" funct="changepass" user="test3" password="N/A" newpassword="N/A" accept="application/xml"/>
 <status success="true"/>
</verifyUser>


Bad New Password
{
 "type": "json",
 "id": {
 "esm": {
 "resp": 70,
 "resp2": 4,
 "message": "Invalid new password"
 }
 },
 "request": {
 "method": "GET",
 "contentType": "URL Query String",
 "funct": "changepass",
 "user": "test3",
 "password": "N/A",
 "newpassword": "N/A",
 "accept": "*/*"
 },
 "status": {
 "success": true
 }
}
<?xml version="1.0" encoding="UTF-8"?>
<verifyUser type="xml">
    <id>
        <esm resp="70" resp2="4" message="Invalid new password"/>
    </id>
    <request method="GET" contentType="URL Query String" funct="changepass" user="test3" password="N/A" newpassword="N/A" accept="application/xml"/>
    <status success="true"/>
</verifyUser>