teresaleelim / intprojectmanagement

1 stars 0 forks source link

Investigate API for bring the daily attandance data #23

Closed KyusangCho closed 5 months ago

KyusangCho commented 5 months ago
Date Door Person ID Status
2024-01-26 13:23:56 Nivel20 999(Bryan Cho) Authorize failed
2024-01-26 13:23:56 Nivel16 8(Kevin) Open
kevin-rz1 commented 5 months ago

BioStar 2 API

[!NOTE] Suprema BioStar API es una API basada en JSON. Todas las endpoints comienzan con https://server_ip|domain_name[:port]/api

Primero se debe realizar la autenticacion del usuario administrador.

Authorization

Endpoint: https://127.0.0.1/api/login Body:

{
    "User": {
        "login_id": "admin",
        "password": "yourpassword"
    }
}

image

La respuesta devolverá bs-session-id para autorizar cualquier movimiento en la API. Para aplicar este valor, se agrega en header de la peticion image

Important endpoints

Descripcion Endpoint Body Tipo
Lista de usuarios por ID de Grupo ( El valor por defecto es 1 para mostrar todos los usuarios https://127.0.0.1/api/v2/users/search {"limit": 0, "search_text": null, "user_group_id": "1", "order_by": "user_id:false" } POST
Ver usuario por ID https://127.0.0.1/api/users/:id GET
Exportar usuarios en .csv
Ubicacion:
{{Biostar 2 Installation Folder]]\nginx\html\download
https://127.0.0.1/api/users/csv_export?id=[id here]
Colocar * para todos los usuarios o concatenar id de usuarios con '+'
{"Query": {}} POST

BioStar 2 T&A API

Reports

Primero se debe realizar la autenticacion del usuario administrador.

Authorization

Endpoint: https://127.0.0.1:3002/tna/login Body:

{
    "User": {
        "login_id": "admin",
        "password": "yourpassword"
    }
}

image

Types

Se utiliza misma endpoint pero cambia la propiedad report_type para un reporte en especifico.

image

DailyReport

Descripcion Endpoint Body Tipo
Reporte Diario https://127.0.0.1/tna/report.json POST

image

Individual Report

Descripcion Endpoint Body Tipo
Reporte Individual: Cambia la propiedad "report_filter_type": "INDIVIDUAL_FILTER_SUMMARY" https://127.0.0.1/tna/report.json POST

[!IMPORTANT] Colocar un ID en la propiedad user_id_list 👇

Referencias

teresaleelim commented 5 months ago

Attendance up to this point was sent manually as an Excel file to Rosenda by email. This report was exported and then edited to fit the format shown below:

2024-01-25_Attendance.xls