Minden POST kérés JSON body-val megy, és tartalmaznia kell az action mezőt. Az API kulcsot X-API-KEY headerben kell küldeni.
POST /api/v2/restapi.php
X-API-KEY: <INTEGRATION_KEY>
Content-Type: application/json
{
"action": "get_employee"
}
{
"success": true,
"data": [...]
}
GET /api/v2/restapi.php?action=status
{
"success": true,
"status": "ok"
}
Megjegyzés: GET módszernél csak a status engedélyezett, minden más GET hibát ad.
Dolgozók listázása vagy egy dolgozó lekérése.
{
"action": "get_employee"
}
{
"success": true,
"data": [
{
"ID": 5,
"CompanyID": 3,
"LocationID": 1,
"Name": "Fejlesztő Atti",
"Email": "atti@ceg.hu",
"Phone": "+36...",
"CardSN": "ABC123",
"Position": "Fejlesztő",
"Activated": 1
}
]
}
{
"action": "get_employee",
"id": 5
}
{
"success": true,
"data": {
"ID": 5,
"CompanyID": 3,
"LocationID": 1,
"Name": "Fejlesztő Atti",
"Email": "atti@ceg.hu",
"Phone": "+36...",
"CardSN": "ABC123",
"Position": "Fejlesztő",
"Activated": 1
}
}
Beosztások lekérdezése több, kombinálható szűrővel.
| Mező | Típus | Leírás |
|---|---|---|
id | int | UserID szűrés |
date | string | Dátum/idő, ami a Shift_Start és Shift_End közé esik |
stid | int | Work_Event_ID (shift type) szűrés |
isactive | 0/1 | ActiveWork (Aktív) szűrés |
ispaid | 0/1 | is_paid (Fizetett) szűrés |
{
"action": "get_shift"
}
{
"action": "get_shift",
"id": 5,
"date": "2026-01-10 10:00:00",
"stid": 2
}
{
"success": true,
"data": [
{
"ID": 123,
"UserID": 5,
"Name": "Fejlesztő Atti",
"ShiftDate": "2026-01-10",
"Shift_Start": "2026-01-10 09:00:00",
"Shift_End": "2026-01-10 18:00:00",
"Registrated_WorkTime": 480,
"Planed_WorkTime": 480,
"Work_Event_ID": 2,
"WorkEventName": "Fejlesztés",
"Fizetett": 1,
"Aktiv": 1,
"Approved": 0,
"GPS": "..."
}
]
}
Szabadság összesítő (User tábla + Shifts alapján számolt mezők).
Ha kapsz id-t, akkor 1 user; ha nem, akkor minden user.
{
"action": "get_freedays",
"id": 5
}
{
"action": "get_freedays"
}
{
"UserID": 5,
"Name": "Fejlesztő Atti",
"SocialSecurityNumber": "...",
"Position": "Fejlesztő",
"FreeDays": 27,
"Available_FreeDays": 25,
"UsedDays": 2,
"PendingPaidFreeDays": 1,
"UnpaidInactiveDays": 0
}
PendingPaidFreeDays = fizetett + nem aktív + nem jóváhagyott, aktuális évben.
UnpaidInactiveDays = nem fizetett + nem aktív, aktuális évben.
Org chart generálás. Az API válasza SVG (Content-Type: image/svg+xml).
{
"action": "orgchart"
}
<svg xmlns="http://www.w3.org/2000/svg" ...>...</svg>
Postmanben a “Visualize/Preview” nézetben megjelenik. Frontendben <img src="data:image/svg+xml;...">
vagy sima fetch + DOM-ba illesztés.
action="employee" és employee-action vezérli a műveletet:
add | update | disabled | delete.
{
"action": "employee",
"employee-action": "add",
"name": "Teszt Béla",
"email": "teszt@ceg.hu",
"position": "Junior fejlesztő",
"manager_id": 3
}
{
"success": true,
"employee_action": "add",
"user_id": 101
}
{
"action": "employee",
"employee-action": "update",
"id": 101,
"position": "Medior fejlesztő"
}
{
"action": "employee",
"employee-action": "disabled",
"id": 101
}
{
"action": "employee",
"employee-action": "delete",
"id": 101
}
position-action: add | update | delete
{
"action": "positions",
"position-action": "add",
"location_id": 2,
"name": "Senior fejlesztő",
"description": "Backend senior pozíció",
"min_count": 1,
"max_count": 3,
"wage_bruto": 1200000,
"wage_neto": 800000,
"wage_type": "monthly"
}
{
"action": "positions",
"position-action": "update",
"id": 7,
"max_count": 4
}
{
"action": "positions",
"position-action": "delete",
"id": 7
}
work-event-action: add | update | delete
{
"action": "work-event-types",
"work-event-action": "add",
"name": "Szabadság",
"code": "HOLIDAY",
"color_code": "#4CAF50",
"ActiveWork": 0,
"is_paid": 1,
"is_absence": 1,
"CountsAgainstHoliday": 1,
"multiplier": 1.0
}
{
"action": "work-event-types",
"work-event-action": "update",
"id": 4,
"color_code": "#FF9800",
"multiplier": 1.25
}
{
"action": "work-event-types",
"work-event-action": "delete",
"id": 4
}
benefit-action: add | update | delete
{
"action": "benefits",
"benefit-action": "add",
"location_id": 1,
"benefit_name": "Cafeteria",
"benefit_type": "monthly",
"benefit_brutto": 50000,
"benefit_neto": 35000
}
{
"action": "benefits",
"benefit-action": "update",
"id": 6,
"benefit_brutto": 60000
}
{
"action": "benefits",
"benefit-action": "delete",
"id": 6
}
CardRecords lekérdezése: összesen / szűrve user_id, from, to, reader_id, card_sn, location_id alapján (szabadon kombinálható).
{
"action": "card-records"
}
{
"action": "card-records",
"user_id": 5,
"from": "2026-01-01 00:00:00",
"to": "2026-01-31 23:59:59",
"location_id": 2
}
{
"action": "card-records",
"reader_id": "ENTRANCE_1",
"card_sn": "ABC123"
}
{
"success": true,
"count": 2,
"data": [
{
"ID": 9001,
"UserID": 5,
"UserName": "Fejlesztő Atti",
"CardSN": "ABC123",
"ReaderID": "ENTRANCE_1",
"LocationID": 2,
"Address": "Főbejárat",
"ReadDateTime": "2026-01-10 08:58:12"
}
]
}
{
"success": false,
"error": "X-API-KEY header is required"
}
{
"success": false,
"error": "Invalid or inactive API key"
}
{
"success": false,
"error": "Unknown action"
}
{
"success": false,
"error": "Missing action in POST body"
}
Tipp: mindig küldd a Content-Type: application/json headert és valid JSON body-t.
Method: POST
URL: https://wfshift.online/api/v2/restapi.php
Headers:
X-API-KEY: <KEY>
Content-Type: application/json
Orgchart esetén a válasz SVG; Postmanben a Preview/Visualize nézetet használd.
Dokumentáció a restapi.php V2 hőz. - WFShift.onlilne | info@wfshift.online | Szoft-Tech.hu | info@szoft-tech.hu