0% found this document useful (0 votes)
129 views16 pages

Smart Office APIDocumentation

Uploaded by

Mohit Bhandari
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
129 views16 pages

Smart Office APIDocumentation

Uploaded by

Mohit Bhandari
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

SMARTOFFICE 1.0.

Smart Office API Documentation


Version 1.0.2
SMARTOFFICE 1.0.1

OCT, 20 2021

CONTENTS

1. Overview
a. Prerequisites
b. Support
2. Interface Specifications
a. API Request
b. API Response
c. API Exception
3. Web API’s
a. Add Biometric Device
b. Delete Biometric Device
c. Fetch Biometric Logs
d. Upload Users in Biometric
e. Delete User in Biometric
f. Fetch Live Users from Biometric
g. Set User Expiration
h. Fetch Biometric Commands
i. Photo Registration
j. Block/ unblock Users
SMARTOFFICE 1.0.1

OVERVIEW
a) Prerequisites
Below are the following details required to access Smart Office API’s.
• Smart Office Web Application.
• Smart Office database.

This can be used in variety of Languages to access REST API’s like .Net, JAVA etc.

b) Support
In case for any clarifications, Please get in touch with the API Support
with Time Sheet team
SMARTOFFICE 1.0.1

SPECIFICATIONS
The API uses Http Requests to receive data and send responses in JSON format.

a) API Request:
An API request lets you contact a server with API endpoints that you want to
reach and perform some action. Those actions are HTTP methods.

b) API Response:
An API response consists of the body, headers, and the status code.

c) API Exception:
if there is an exception during the processing of the request then the
application will send the response in the following
SMARTOFFICE 1.0.1

WEB API’S
This Section describes various web service methods available for Biometric communication

a) Add Biometric Device

POST /api/v2/WebAPI/AddBiometric
Add new Biometric Device to Smart Office

Request JSON Object


• APIKey (String): Authentication -token key.
• DeviceName (String): Name of the device.
• SerialNumber (String): A unique identity Id of the biometric.

Response:

• Message: “Device Saved Successfully.”

Other Response Messages:

• Biometric already exists : Device with the Serial Number given is already exists in
the database
SMARTOFFICE 1.0.1

b) Delete Biometric Device

GET /api/ v2/WebAPI/DeleteBiometric


To Delete Biometric Device from Smart Office

Request JSON Object


• APIKey (String): Authentication-token key.
• SerialNumber (String): A unique identity Id of the biometric.

Response:

• Message: “Biometric Deleted Successfully.”


SMARTOFFICE 1.0.1

c) Fetch Biometric Logs Data

GET /api/v2/WebAPI/ GetDeviceLogs


To get Biometric log data from Smart Office database.

Request JSON Object


• APIKey (String): Authentication-token key.
• FromDate (DateTime): from when the logs to be send.
• ToDate (DateTime): until when the logs to be send.

Response JSON data:


[
{

"EmployeeCode": “5 ",
"LogDate": “2019-09-16 [Link] ",
"SerialNumber": ""
“PunchDirection”:” in”
“Temperature”:97.4
“TemperatureState”:”Normal”
}
]

Other Biometric Response:


{
status: false,
message: “Invalid API Key.”
}
SMARTOFFICE 1.0.1

d) Upload Users to Biometric Device

POST /api/v2/WebAPI/UploadUser
To upload User into Biometric Device from Smart Office

Request JSON Object


• APIKey (String): Authentication-token key.
• EmployeeName (String): Name of the Employee/User.
• EmployeeCode (String): Biometric Code of the Employee/User.
• CardNumber (String): Card Number of user.
• SerialNumber (String): To which Biometric device Serial Number User has to
be uploaded, Use Comma (,) to separate multiple serial numbers.
• VerifyMode (String): To Allow dual verification mode
(face+card) – This will add face & card verification mode

Response:

• Message: “Command Send Successfully."

Other Response Messages

• Device is not exists.


• API key is not correct
SMARTOFFICE 1.0.1

e) Delete Users from Biometric Device

POST /api/v2/WebAPI/DeleteUser
To Delete User from Biometric Device using Smart Office

Request JSON Object


• APIKey (String): Authentication-token key.
• EmployeeCode (String): Biometric Code of the Employee/User.
• SerialNumber (String): To which Biometric device Serial Number User has to
be deleted, Use Comma (,) to separate multiple serial numbers.

Response:

• Message: “Delete Command Send Successfully."

Other Response Messages

• Device is not exists.


• API key is not correct
SMARTOFFICE 1.0.1

f) Fetch Live Users from Biometric

GET /api/v2/WebAPI/FetchLiveUsersFromBiometric
To fetch live Users from Biometric Device using Smart Office

Request JSON Object


• APIKey (String): Authentication-token key.
• SerialNumber (String): To which Biometric device Serial Number live User
has to be fetched.

Response:
[
{
"EmployeeCode": "01",
"FPCount": "1",
"Privilege": "USER"
}
]

Other Response Messages

• Device is not exists.


• API key is not correct

g) Set User Expiration

GET /api/v2/WebAPI/SetUserExpiration
To set the expiration rule of the Biometric User in Device using Smart Office

Request JSON Object


• APIKey (String): Authentication-token key.
• SerialNumber (String): Biometric Serial Number, If Set as 0 then it will
execute all on Biometric devices.
• EmployeeCode (String): Biometric Code of the Employee/User.
• ExpirationDate (String): Expiration date of the User and the Format will be
(yyyy-MM-dd).
SMARTOFFICE 1.0.1

Response:

• Message: “Command Send Successfully."

Other Response Messages

• Device is not exists.


• API key is not correct

h) Fetch Biometric Commands

GET /api/WebAPI/GetDeviceCommands
To get and check the status of the commands issued by the user in the device.

Request Query String


• APIKey (String): Authentication-token key.
• FromDate (DateTime): From when the commands need to fetched.
• ToDate(DateTime): Till when the commands need to be fetched.

Response:
{

"status": "success",
"message": "",
"records": [
{
"Title": "Get All Users from Biometric -MUM_BKC",
SMARTOFFICE 1.0.1

"DeviceCode": "MUM_BKC",
"SerialNumber": "C2689C47030A2334",
"CreationDate": "2020-11-05 15:08",
"ExecutionDate": "1900-01-01 00:00",
"Status": "Pending",
"Response": ""
}],
"result": true
}

Other Response Messages

• From Date cannot be greater than To Date.


{
"status": "failure",
"message": "From Date [05-Nov-2020] cannot be greater than To Date [01-Nov-2020],
"records": [],
"result": false
}
SMARTOFFICE 1.0.1

i) Photo Registration

POST /api/WebAPI/PhotoUploadInBiometric
To register user using base64 image into the biometric.

Request JSON Object


• APIKey (String): Authentication-token key.
• SerialNumber (string): Serial Number of the Biometric.
• EmployeeName(string): Name of the Employee.
• EmployeeCode(string): Employee Biometric Code from which the user need
to be get registered.
• Base64String(string): base64 data of the registration image.

Response:

• Message: “Upload Command Send Successfully."

Other Response Messages

• Serial Number cannot be blank.


• EmployeeCode cannot be blank.
• EmployeeName cannot be blank.
• Base64String cannot be blank.
• API key is not correct
SMARTOFFICE 1.0.1

j) Block/unblock Users

GET /api/WebAPI/BlockUserinBiometric
To register user using base64 image into the biometric.

Request JSON Object


• APIKey (String): Authentication-token key.
• EmployeeCode(string): Employee Biometric Code from which the user need
to be block/unblock.
• SerialNumber (string): Serial Number of the Biometric.
• BlockUser (int): 0 – to block the user, 1 – to unblock the user.

Response:

• Message: “Command Send Successfully.

Other Response Messages

• Biometric device not exist with the Serial Number


• API key is not correct
SMARTOFFICE 1.0.1

k) Add/Update Employee

GET /api/v2/WebAPI/AddEmployee
To add/update Employee details in the application .

Request JSON Object


{
"StaffCode":"12121",
"StaffName":"abc",
"Gender":"Male",
"Status":"Working",
"CompanySName":"Default",
"DepartmentSName":"Default",
"Location":"Default",
"Designation":"Default"
}

Response:
{
"Message":"Employee Added Succesfully",
"Result":true
}
SMARTOFFICE 1.0.1

l) Delete Employee

GET /api/v2/WebAPI/DeleteEmployee
To delete the existing employee from the application.

Request JSON Object


• EmployeeCode (string): Employee Code to delete.

Response:
{
"Message":"Employee Deleteed Succesfully",
"Result":true
}

You might also like