Skip to content

Authentication API for Web Integration

The document explains authentication using BSA API. Below is the list of API calls

  1. Authentication Request
  2. Check Authentication Request
  3. Check Authentication Result
  4. Cancel Authentication Request
  5. Get User Information

Important:

Please note that listed API above a~c is the order of authentication API calls. The sequence is the same except for the Authentication Request as it has 4 types. Client Key as per provide in the registration email.

Below are the 4 types of BSA Authentication method

  1. Authentication using User ID
  2. Authenctication using QR
  3. Authentication using OTP
  4. Authentication using TOTP

Important:

Kindly note that there will be slightly different on the API calls for OTP and TOTP authentication method.

1. Authentication using user ID

a. Authentication Request

To request authentication API

POST

https://api.fnsbsa.com/api/v3/auth

Header

FieldDescription
Content-TypeApplication/json

Parameter

FieldTypeDescription
clientKeyStringClient Key
userKeyStringUsername/ user ID
isOtpAuthBooleanFalse (normal authentication)
authPlatformStringCMMAPF001 (Default)

Example

js
{
    "clientKey":"Insert your clientKey",
    "userKey":"User ID",
    "isOtpAuth": false,
    "authPlatform":"CMMAPF001"
}

Return

FieldTypeDescription
rtCodeIntegerSuccessful Return Code 0
channelKeyStringChannel Key
userKeyStringUser ID
connectIPStringConnected IP address user
authTimeRemainingStringAuthentication Time
iconBaseValueStringAuthentication Type
fingerBaseValueStringAuthentication Type

Sample Response

js
{
  "rtCode": 0,
  "data": {
    "userKey": "User ID",
    "channelKey": "zVAzb {Omit long characters} JnqI6+==",
    "connectIp": "0:0:0:0:0:0:0:1",
    "authTimeRemaining": 30000,
    "iconBaseValue": 2,
    "fingerBaseValue": 3
  }
}

b. Check Authentication Status

To check Authentication Status

Get

https://api.fnsbsa.com/api/v3/app/websocket

Header

FieldDescription
Content-TypeApplication/json

Parameter

FieldTypeDescription
channelKeyStringChannel Key
clientKeyStringClient Key
userKeyStringUser ID

Example

wss://api.fnsbsa.com/ws/v3/app/websocket?clientKey={Insert your clientKey}&userKey={User ID}&channelKey=zVAzb {Omit long characters} JnqI6+==

Return

FieldTypeDescription
rtCodeIntegerSuccessful Return Code 0
messageStringResult Message
userStatusStringAuthentication Status Code

Sample Response

js
{
  "rtCode": 0,
  "data": {
    "message": "success code",
    "userStatus": "AuthCompleted"
  }

}

c. Get Authentication Result

To get Authentication Result

GET

https://api.fnsbsa.com/api/v3/auth

Header

FieldDescription
Content-TypeApplication/json

Parameter

FieldTypeDescription
channelKeyStringChannel Key (Encoded)
clientKeyStringClient Key
userKeyStringUser ID

example

https://api.fnsbsa.com/api/v3/auth?clientKey={Insert your clientKey}&userKey={User ID}&channelKey=zVAzb {Omit long characters} JnqI6+==

Sample Response

js
{
  "rtCode": 0,
  "data": "eyJhbGciOiJI {Token} AUkA5g"
}

Return

FieldTypeDescription
rtCodeIntegerSuccessful Return Code 0
dataStringBSA Success Token Value

Sample response

js
{
  "rtCode": 0,
  "data": "eyJhbGciOiJI {Token} AUkA5g"

}

2. Authentication using QR

a. Authentication Request

To request Authentication API.

POST

https://api.fnsbsa.com/api/v3/qr/generate?clientKey={Insert your clientKey}&authPlatform=CMMAPF001

Header

FieldDescription
Content-TypeApplication/json

Parameter

FieldTypeDescription
clientKeyStringClient Key
authPlatformStringCMMAPF001 (default)

example

js
{
    "clientKey":"Insert your clientKey",
    "authPlatform":"CMMAPF001",
}

Return

FieldTypeDescription
rtCodeIntegerSuccessful Return Code 0
dataStringBSA Success Token Value
qrIdStringQR unique ID
qrUrlStringQR URL

Sample response

js
{
  "rtCode": 0,
  "data": {
    "qrId": "0f75a8f2-{Omit long characters}",
    "qrUrl": "otpauth://totp/{Insert your clientKey}&platform=CMMAPF001{Omit long characters}",
  }
}

b. Check Authentication Status

To check Authentication Status

GET

https://api.fnsbsa.com/api/v3/app/qr/websocket?qrId={Insert your qrId}

Parameter

FieldTypeDescription
qrIdStringQR unique ID

Example

wss://api.fnsbsa.com/ws/v3/app/qr/websocket?qrId={Insert your qrId}

Return

FieldTypeDescription
rtCodeIntegerSuccessful Return Code 0
messageStringResult Message
userStatusStringAuthentication Status Code

Sample Response

js
{
  "rtCode": 0,
  "data": {
    "message": "success code",
    "userStatus": "AuthCompleted"
  }
}

c. Get Authentication Result

To get Authentication Result

GET

https://api.fnsbsa.com/api/v3/auth

Header

FieldDescription
Content-TypeApplication/json

Parameter

FieldTypeDescription
channelKeyStringChannel Key
clientKeyStringClient Key
userKeyStringUser ID

Example

https://api.fnsbsa.com/api/v3/auth?clientKey={Insert your clientKey}&userKey={User ID}&channelKey=zVAzb {Omit long characters} JnqI6+==

Return

FieldTypeDescription
rtCodeIntegerSuccessful Return Code 0
dataStringBSA Token Value

Sample Response

js
{
  "rtCode": 0,
  "data": "eyJhbGciOiJI {Token} AUkA5g"
}

3. Authentication Using OTP

a. Authentication Request

To get Authentication Result

POST

https://api.fnsbsa.com/api/v3/qr/generate?clientKey={Insert your clientKey}&authPlatform=CMMAPF001

Header

FieldDescription
Content-TypeApplication/json

Parameter

FieldTypeDescription
clientKeyStringClient Key
userKeyStringUser ID
isOtpAuthBooleanTrue
authPlatformStringCMMAPF001 (default)

example

js
{
    "clientKey":"Insert your clientKey",
    "userKey":"User ID",
    "isOtpAuth": true,
    "authPlatform":"CMMAPF001",
}

Return

FieldTypeDescription
rtCodeIntegerSuccessful Return Code 0
channelKeyStringChannel Key
userKeyStringuserID
connectIPStringConnected IP Address user
authTimeRemainingStringAuthentcation Time
iconBaseValueStringAuthentication Type
fingerBaseValueStringAuthentication Type

Sample response

js
{
  "rtCode": 0,
  "data": {
    "userKey": "User ID",
    "channelKey": "zVAzb {Omit long characters} JnqI6+==",
    "connectIp": "0:0:0:0:0:0:0:1",
    "authTimeRemaining": 30000,
    "iconBaseValue": 2,
    "fingerBaseValue": 3
  }
}

b. Check Authentication Status

To Check Authentication Status

GET

https://api.fnsbsa.com/api/v3/app/websocket

Parameter

FieldTypeDescription
channelKeyStringChannel Key
clientKeyStringClient Key
userKeyStringUser ID

Example

wss://api.fnsbsa.com/ws/v3/app/websocket?clientKey={Insert your clientKey}&userKey={Insert you userkey}&channelKey=zVAzb {Omit long characters} JnqI6+==

Return

FieldTypeDescription
rtCodeIntegerSuccessful Return Code 0
messageStringResult Message
userStatusStringAuthentication Status Code

Sample Response

js
{
  "rtCode": 0,
  "data": {
    "message": "success code",
    "userStatus": "AuthCompleted"
  }
}

c. Verify the OTP

To verify the OTP

POST

https://api.fnsbsa.com/api/v3/otp/user/verify

Parameter

FieldTypeDescription
clientKeyStringClient Key
userKeyStringUser ID
otpCodeString6-digit OTP Code
authPlatformStringCMMAPF001 (default)

Example

js
{
    "clientKey":"Request your clientkey from admin",
    "otpCode":"898448",
    "userKey":"User ID ",
    "authPlatform":"CMMAPF001"
}

Return

FieldTypeDescription
rtCodeIntegerSuccessful Return Code 0
dataStringBSA Token Value

Sample Response

js
{
  "rtCode": 0,
  "data": "eyJhbGciOiJI {Token} AUkA5g"
}

4. Authentication using TOTP

a.Authentication Request

To request Authentication API

POST

https://api.fnsbsa.com/api/v3/totp/user/verify

Header

FieldDescription
Content-TypeApplication/json

Parameter

FieldTypeDescription
clientKeyStringClient Key
userKeyStringUser ID
otpCodeString6-digit OTP Code
authPlatformStringCMMAPF001 (Default)

Example

js
{
    "clientKey":"Insert your clientKey",
    "userKey":"User ID ",
    "otpCode": 134625,
    "authPlatform":"CMMAPF001"
}

Return

FieldTypeDescription
rtCodeIntegerSuccessful Return Code 0
dataStringBSA Success Token Value

Sample Response

js
{
  "rtCode": 0,
  "data": "eyJhbGciOiJI {Token} AUkA5g"
}

d. Cancel Authentication

DELETE

https://api.fnsbsa.com/api/v3/auth

Header

FieldDescription
Content-TypeApplication/json

Parameter

FieldTypeDescription
clientKeyStringClient Key
userKeyStringUser ID

Example

js
{
    "clientKey": “{Insert your clientKey}”,
    "userKey": "User ID"
}

Return

FieldTypeDescription
rtCodeStringSuccessful Return Code 0

Sample Response

js
{
  "rtCode":0
}

e. View User BSA Information

This API is to get user information. This API may be called once successful and completed.

GET

https://api.fnsbsa.com/api/v3/me

Header

FieldDescription
AuthorizationToken, Access Token Value

Return

FieldTypeDescription
rtCodeStringSuccessful Return Code 0
dataStringuserKey, clientKey, clientName, userType, userStatus, email, registerDate

Sample Response

js
{
  "rtCode": 0,
  "data": {
    "userKey": "User ID",
    "clientKey":"d05a73e73acb43b888c9554b90675c63",
    "clientName": "exampleClient",
    "userStatus": "CMMMST001",
    "userType": "CMMMCL001",
    "name": "your-name",
    "email": "developer@exampleClient.com",
    "authType": 1,
    "regDt": "20230201 10:45:02.00 +0000"
  }
}