0% found this document useful (0 votes)
74 views7 pages

Sentry API Integration Guide

The document provides an overview of the Sentry API, detailing how to make requests for authorization tokens, retrieve time logs, and save personnel information using HTTP requests. It includes sample requests, expected parameters in JSON format, and examples of responses from the API. The document emphasizes the need for proper authorization and outlines the structure of the data being sent and received.

Uploaded by

amazein.tracking
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)
74 views7 pages

Sentry API Integration Guide

The document provides an overview of the Sentry API, detailing how to make requests for authorization tokens, retrieve time logs, and save personnel information using HTTP requests. It includes sample requests, expected parameters in JSON format, and examples of responses from the API. The document emphasizes the need for proper authorization and outlines the structure of the data being sent and received.

Uploaded by

amazein.tracking
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

API is the acronym for Application Programming Interface,

which is a software intermediary that allows two applications to talk to each other.

REQUEST
http(s) Request
CLIENT SENTRY API

RESPONSE

COMMAND

DATA/INFO

SENTRY DATABASE
1. GET Authorization/TOKEN

HTTP REQUEST:

[Link] No.&password=PERSONNEL PASSWORD

Sample Personnel: Juan Delacruz


Personnel No. 1234
Personnel Sentry Password: 1
User Role: With Access on API

GET [Link]
username=1234&password=1

CLIENT SENTRY API

v_1_0.eyJVc2VyUm9sZUlkIjpudWxsLCJVc2VyTmFtZSI6IjEyMzQiL
CJDbGFpbXMiOiJBUEkiLCJFeHBpcmF0aW9uIjoiMjAyMi0wOC0w
OVQwMzozNTo1OC41NTMzNjA0WiIsIkRpc3BsYXlOYW1lIjoiSnVh
biJ9.XAb1l+lFsPadekaryIxjygKjP+eJC6j2j+A4u8qu7D4= COMMAND

DATA/INFO

SENTRY DATABASE
2. GET TIMELOGS

HTTP REQUEST:

[Link]

Sample Personnel: Juan Delacruz


Personnel No. 1234
Personnel Sentry Password: 1
User Role: With Access on API

BODDY : PARAMETERS Format: JSON

{
"PersonnelNo": "",
"StartDate": "2022-01-01",
"EndDate": "2022-12-28",
"start": 0,
"max": 1000
}

RESULT FILTER: DATA PROPERTIES


POST [Link]
ContentType: application/json
Bearer Token:
v_1_0.eyJVc2VyUm9sZUlkIjpudWxsLCJVc2VyTmFtZSI6IjEyMzQiLCJD
bGFpbXMiOiJBUEkiLCJFeHBpcmF0aW9uIjoiMjAyMi0wOC0wOVQw
MzozNTo1OC41NTMzNjA0WiIsIkRpc3BsYXlOYW1lIjoiSnVhbiJ9.XAb1
l+lFsPadekaryIxjygKjP+eJC6j2j+A4u8qu7D4=
BODY:
{
"PersonnelNo": "",
"StartDate": "2022-01-01",
"EndDate": "2022-12-28",
"start": 0,
"max": 1000
}

CLIENT METHODSENTRY
: POST
API

{
"personnelid": "1234",
"personnelfirstname": "Juan",
"personnellastname": "Delacruz",
"deviceid": "1234",
COMMAND
"inout": "IN",
"logtype": "0",
"logdate": "08/05/2022 [Link]",
"logtime": "08/05/2022 [Link] +08:00"
}

DATA/INFO

SENTRY DATABASE
3. SAVE PERSONNEL

HTTP REQUEST:
[Link]

Sample Personnel: Juan Delacruz


Personnel No. 1234
Personnel Sentry Password: 1
User Role: With Access on API

BODDY : PARAMETERS Format: JSON


{
"PersonnelNo": "2020109",
"AccessNumber": "2020109",
"LastName": "Test2",
"FirstName": "Test2",
"MiddleName": "",
"Birthdate": null,
"Email": ""

Available Column for the PARAMETERS

Table Name :Personnel


columns:
{
"PersonnelNo":,
"AccessNumber":
"LastName": ,
"FirstName": ,
"MiddleName": ,
"Birthdate":,
"Email":

}
POST [Link]
ContentType: application/json
Bearer Token:
v_1_0.eyJVc2VyUm9sZUlkIjpudWxsLCJVc2VyTmFtZSI6IjEyMzQiLCJDbGFpbXMiOiJBUEkiLCJFeHB
pcmF0aW9uIjoiMjAyMi0wOC0wOVQwMzozNTo1OC41NTMzNjA0WiIsIkRpc3BsYXlOYW1lIjoiSnV
hbiJ9.XAb1l+lFsPadekaryIxjygKjP+eJC6j2j+A4u8qu7D4=
BODY:
{
"PersonnelNo": "2020199",
"AccessNumber": "2020199",
"LastName": "Test2",
"FirstName": "Test2",
"MiddleName": "test 2",
"Birthdate": "2022-01-01",
"Email": "test@[Link]"
}

CLIENT SENTRY API

{
COMMAND
"content": "Successfully Saved",
"status": "SUCCESSFUL",
"errorMessage": "",
"validationErrors": {}
}

SENTRY DATABASE

Common questions

Powered by AI

An HTTP GET request to retrieve time logs from the Sentry API includes the URL endpoint (http://localhost:8080/api/Integration/GetTimeLogsBulkData), method type (GET), and parameters within the request URL, specifying details such as PersonnelNo, StartDate, EndDate, start index, and maximum records to fetch. The response returns data in JSON format .

The client application authenticates itself to the Sentry API using a Bearer Token, which is a type of access token. The token is included in the HTTP request header when calling the API endpoints. This token specifies the permissions of the client and is generated based on the user's credentials provided upon requesting authentication .

The Sentry API indicates a successful operation by returning a response with a content message 'Successfully Saved', a status of 'SUCCESSFUL', and empty fields for errorMessage and validationErrors, indicating no issues were encountered during the record saving process .

An API, or Application Programming Interface, acts as a software intermediary that allows two applications to communicate with each other. It defines methods and data structures necessary for this interaction and enables the exchange of data and functionalities between different systems via HTTP requests and responses .

Including a Bearer Token in an API request header is crucial for authorizing the requesting client. It signifies that the client has provided valid authentication credentials and is permitted to access resources within the scope of this token. This enhances security by ensuring that only authenticated clients can execute specific operations or retrieve sensitive data .

Parameters in the Sentry API's request body for getting bulk time logs are specified in JSON format, outlining the query details such as PersonnelNo, StartDate, EndDate, start index, and max record count. These parameters refine the data retrieval by specifying the range and amount of data required, optimizing the query for the client's needs .

The Sentry API manages different user roles by associating API access permissions with user accounts via tokens. Each token encapsulates the user's role, dictating which API actions the user can perform. This role-based access control ensures that only users with appropriate privileges can access or modify data, enhancing the security of the API and ensuring that functionality is appropriately distributed according to user needs .

The JSON body of a POST request for saving personnel information includes fields such as PersonnelNo, AccessNumber, LastName, FirstName, MiddleName, Birthdate, and Email. These fields provide the essential data needed for the personnel entry and must conform to the format expectations of the API endpoint (http://localhost:8080/api/Integration/SavePersonnelIntegration).

Without proper authentication mechanisms, an API like Sentry would be vulnerable to unauthorized access, leading to potential data breaches, misuse of API resources, and exposure of sensitive information. This could result in compromised client data integrity and confidentiality, as well as financial and reputational damages to the service provider .

The Sentry API uses HTTP POST requests for operations like saving personnel information because POST requests support the sending of payload data in the request body, enabling the creation or modification of resource states on the server. This method allows transmitting more complex and sensitive data securely, as the request body, which includes personnel details, is not exposed in the URL like with GET requests .

You might also like