The Tezz Corp Biometric API allows you to integrate our biometric attendance system into your applications. With our API, you can manage users, devices, and attendance records, and generate reports.
https://api.tezzcorp.com/v1
The current version of the API is v1. We recommend specifying the API version in the URL to ensure compatibility with your application.
All API requests must be made over HTTPS. Calls made over plain HTTP will fail.
The Biometric API uses API keys to authenticate requests. You can view and manage your API keys in the Dashboard.
Authentication is performed via HTTP Bearer Auth. Provide your API key as the bearer token value.
curl -X GET "https://api.tezzcorp.com/v1/users" \
-H "Authorization: Bearer YOUR_API_KEY"
Keep your API keys secure! Do not share them in publicly accessible areas such as GitHub, client-side code, etc.
The API provides the following endpoints for managing your biometric attendance system:
Endpoints for managing users in your biometric system.
Returns a list of all users.
| Parameter | Type | Description |
|---|---|---|
| limit | integer | Maximum number of users to return. Default is 20. |
| offset | integer | Number of users to skip. Default is 0. |
curl -X GET "https://api.tezzcorp.com/v1/users?limit=10&offset=0" \
-H "Authorization: Bearer YOUR_API_KEY"
{
"data": [
{
"id": "usr_123456789",
"name": "John Doe",
"email": "john.doe@example.com",
"phone": "+919876543210",
"department": "IT",
"created_at": "2023-01-15T10:30:00Z",
"updated_at": "2023-01-15T10:30:00Z"
},
{
"id": "usr_987654321",
"name": "Jane Smith",
"email": "jane.smith@example.com",
"phone": "+919876543211",
"department": "HR",
"created_at": "2023-01-16T11:45:00Z",
"updated_at": "2023-01-16T11:45:00Z"
}
],
"meta": {
"total": 45,
"limit": 10,
"offset": 0
}
}
Creates a new user.
| Parameter | Type | Description |
|---|---|---|
| name | string | Required. The user's full name. |
| string | Required. The user's email address. | |
| phone | string | Required. The user's phone number. |
| department | string | Optional. The user's department. |
curl -X POST "https://api.tezzcorp.com/v1/users" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"name": "John Doe",
"email": "john.doe@example.com",
"phone": "+919876543210",
"department": "IT"
}'
{
"data": {
"id": "usr_123456789",
"name": "John Doe",
"email": "john.doe@example.com",
"phone": "+919876543210",
"department": "IT",
"created_at": "2023-01-15T10:30:00Z",
"updated_at": "2023-01-15T10:30:00Z"
}
}
Endpoints for managing biometric devices.
Returns a list of all registered devices.
curl -X GET "https://api.tezzcorp.com/v1/devices" \
-H "Authorization: Bearer YOUR_API_KEY"
{
"data": [
{
"id": "dev_123456789",
"name": "Main Entrance",
"serial_number": "BIO-FP-001",
"type": "fingerprint",
"status": "active",
"location": "Office Building - Ground Floor",
"last_sync": "2023-01-15T10:30:00Z",
"created_at": "2023-01-01T09:00:00Z",
"updated_at": "2023-01-15T10:30:00Z"
},
{
"id": "dev_987654321",
"name": "Back Entrance",
"serial_number": "BIO-FP-002",
"type": "fingerprint",
"status": "active",
"location": "Office Building - Back Door",
"last_sync": "2023-01-15T10:35:00Z",
"created_at": "2023-01-01T09:15:00Z",
"updated_at": "2023-01-15T10:35:00Z"
}
]
}
Endpoints for managing attendance records.
Records a new attendance entry.
| Parameter | Type | Description |
|---|---|---|
| user_id | string | Required. The ID of the user. |
| device_id | string | Required. The ID of the device. |
| type | string | Required. Either "check_in" or "check_out". |
| timestamp | string | Optional. ISO 8601 formatted timestamp. Defaults to current time. |
curl -X POST "https://api.tezzcorp.com/v1/attendance" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"user_id": "usr_123456789",
"device_id": "dev_123456789",
"type": "check_in",
"timestamp": "2023-01-15T09:00:00Z"
}'
{
"data": {
"id": "att_123456789",
"user_id": "usr_123456789",
"device_id": "dev_123456789",
"type": "check_in",
"timestamp": "2023-01-15T09:00:00Z",
"created_at": "2023-01-15T09:00:05Z"
}
}
Endpoints for generating attendance reports.
Generates an attendance report for a specified time period.
| Parameter | Type | Description |
|---|---|---|
| start_date | string | Required. Start date in YYYY-MM-DD format. |
| end_date | string | Required. End date in YYYY-MM-DD format. |
| user_id | string | Optional. Filter by user ID. |
| department | string | Optional. Filter by department. |
| format | string | Optional. Response format: "json" (default), "csv", or "pdf". |
curl -X GET "https://api.tezzcorp.com/v1/reports/attendance?start_date=2023-01-01&end_date=2023-01-31&department=IT" \
-H "Authorization: Bearer YOUR_API_KEY"
{
"data": {
"report_id": "rep_123456789",
"start_date": "2023-01-01",
"end_date": "2023-01-31",
"department": "IT",
"generated_at": "2023-02-01T10:00:00Z",
"summary": {
"total_users": 15,
"total_days": 31,
"working_days": 22,
"average_attendance": 95.5
},
"users": [
{
"id": "usr_123456789",
"name": "John Doe",
"department": "IT",
"attendance": {
"present_days": 21,
"absent_days": 1,
"late_days": 2,
"early_departure_days": 1,
"attendance_percentage": 95.45
}
},
// More users...
]
}
}
The API uses conventional HTTP response codes to indicate the success or failure of an API request.
| Code | Description |
|---|---|
| 200 - OK | Everything worked as expected. |
| 400 - Bad Request | The request was unacceptable, often due to missing a required parameter. |
| 401 - Unauthorized | No valid API key provided. |
| 403 - Forbidden | The API key doesn't have permissions to perform the request. |
| 404 - Not Found | The requested resource doesn't exist. |
| 429 - Too Many Requests | Too many requests hit the API too quickly. |
| 500, 502, 503, 504 - Server Errors | Something went wrong on our end. |
{
"error": {
"code": "invalid_request",
"message": "The request was unacceptable, often due to missing a required parameter.",
"param": "user_id",
"type": "validation_error"
}
}
The API has rate limits to prevent abuse and ensure stability. The current rate limits are:
| Plan | Rate Limit |
|---|---|
| Basic | 100 requests per minute |
| Premium | 500 requests per minute |
| Enterprise | 1000 requests per minute |
Rate limit information is included in the response headers:
X-RateLimit-Limit: The maximum number of requests you're permitted to make per minute.X-RateLimit-Remaining: The number of requests remaining in the current rate limit window.X-RateLimit-Reset: The time at which the current rate limit window resets in UTC epoch seconds.Webhooks allow you to receive real-time notifications when events occur in your biometric system.
| Event | Description |
|---|---|
| user.created | Triggered when a new user is created. |
| user.updated | Triggered when a user is updated. |
| attendance.created | Triggered when a new attendance record is created. |
| device.status_changed | Triggered when a device's status changes. |
You can set up webhooks in the Dashboard under the Webhooks section.
{
"id": "evt_123456789",
"type": "attendance.created",
"created_at": "2023-01-15T09:00:05Z",
"data": {
"id": "att_123456789",
"user_id": "usr_123456789",
"device_id": "dev_123456789",
"type": "check_in",
"timestamp": "2023-01-15T09:00:00Z"
}
}
We provide official SDKs for the following languages:
Our PHP SDK makes it easy to integrate with the Biometric API in your PHP applications.
View on GitHub
require 'vendor/autoload';
use BthDevelopers\BiometricApi\Client;
// Initialize the client with your API key
$client = new Client('YOUR_API_KEY');
try {
// Record a check-in
$attendance = $client->attendance->create([
'user_id' => 'usr_123456789',
'device_id' => 'dev_123456789',
'type' => 'check_in',
'timestamp' => date('c') // Current time in ISO 8601 format
]);
echo "Attendance recorded successfully!\n";
echo "Attendance ID: " . $attendance->id . "\n";
echo "User ID: " . $attendance->user_id . "\n";
echo "Type: " . $attendance->type . "\n";
echo "Timestamp: " . $attendance->timestamp . "\n";
} catch (\Exception $e) {
echo "Error: " . $e->getMessage() . "\n";
}
// Install the SDK: npm install @bthdevelopers/biometric-api-js
const { BiometricApiClient } = require('@bthdevelopers/biometric-api-js');
// Initialize the client with your API key
const client = new BiometricApiClient('YOUR_API_KEY');
// Record a check-in
async function recordAttendance() {
try {
const attendance = await client.attendance.create({
user_id: 'usr_123456789',
device_id: 'dev_123456789',
type: 'check_in',
timestamp: new Date().toISOString()
});
console.log('Attendance recorded successfully!');
console.log('Attendance ID:', attendance.id);
console.log('User ID:', attendance.user_id);
console.log('Type:', attendance.type);
console.log('Timestamp:', attendance.timestamp);
} catch (error) {
console.error('Error:', error.message);
}
}
recordAttendance();
# Install the SDK: pip install bthdevelopers-biometric-api
from bthdevelopers.biometric_api import BiometricApiClient
from datetime import datetime
import iso8601
# Initialize the client with your API key
client = BiometricApiClient('YOUR_API_KEY')
try:
# Record a check-in
attendance = client.attendance.create(
user_id='usr_123456789',
device_id='dev_123456789',
type='check_in',
timestamp=datetime.now().isoformat()
)
print('Attendance recorded successfully!')
print(f'Attendance ID: {attendance.id}')
print(f'User ID: {attendance.user_id}')
print(f'Type: {attendance.type}')
print(f'Timestamp: {attendance.timestamp}')
except Exception as e:
print(f'Error: {str(e)}')
// Add the dependency to your build.gradle:
// implementation 'com.bthdevelopers:biometric-api-java:1.0.0'
import com.bthdevelopers.biometricapi.BiometricApiClient;
import com.bthdevelopers.biometricapi.models.Attendance;
import com.bthdevelopers.biometricapi.requests.AttendanceCreateRequest;
import java.time.Instant;
public class RecordAttendanceExample {
public static void main(String[] args) {
// Initialize the client with your API key
BiometricApiClient client = new BiometricApiClient("YOUR_API_KEY");
try {
// Record a check-in
AttendanceCreateRequest request = new AttendanceCreateRequest.Builder()
.userId("usr_123456789")
.deviceId("dev_123456789")
.type("check_in")
.timestamp(Instant.now().toString())
.build();
Attendance attendance = client.attendance().create(request);
System.out.println("Attendance recorded successfully!");
System.out.println("Attendance ID: " + attendance.getId());
System.out.println("User ID: " + attendance.getUserId());
System.out.println("Type: " + attendance.getType());
System.out.println("Timestamp: " + attendance.getTimestamp());
} catch (Exception e) {
System.err.println("Error: " + e.getMessage());
}
}
}
Contact us today to get started with our Biometric API and transform your attendance management system.
Get in Touch