Skip to main content

Quickstart

Send your first Work Card check-in event in three requests. This takes 5–10 minutes against the trial environment.

What you'll do

  1. Authenticate and get an access token.
  2. Submit a check-in event for one employee.
  3. Confirm Ergani accepted it.

1. Authenticate

curl -s -X POST \
"https://trialv2eservices.yeka.gr/WebservicesAPI/Api/Authentication" \
-H "Content-Type: application/json" \
-d '{
"Username": "myusername",
"Password": "mypassword",
"Usertype": "02"
}'
{
"accessToken": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...",
"accessTokenExpired": 10800,
"refreshToken": "pnFB5Vdno3pd/YgkzBjDdn+Vxe29b5I+eTLSWD8cbWk=",
"refreshTokenExpired": "2024-05-11T09:43:37.5388855+03:00"
}

Copy the accessToken — you'll use it in step 2.

2. Submit a check-in event

This is a real WRKCardSE submission for one employee, checking in at 08:58 on 2024-05-04.

cURL

curl -s -X POST \
"https://trialv2eservices.yeka.gr/WebservicesAPI/Api/Documents/WRKCardSE" \
-H "Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9..." \
-H "Content-Type: application/json" \
-d '{
"Cards": {
"Card": [
{
"f_afm_ergodoti": "094187530",
"f_aa": "0",
"f_comments": "Quickstart test submission",
"Details": {
"CardDetails": [
{
"f_afm": "028233026",
"f_eponymo": "ΚΑΠΟΙΟΣ",
"f_onoma": "ΛΑΜΠΡΟΣ",
"f_type": "0",
"f_reference_date": "2024-05-04",
"f_date": "2024-05-04T08:58:00+03:00",
"f_aitiologia": null
}
]
}
}
]
}
}'

Node.js

const accessToken = "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...";

const response = await fetch(
"https://trialv2eservices.yeka.gr/WebservicesAPI/Api/Documents/WRKCardSE",
{
method: "POST",
headers: {
Authorization: `Bearer ${accessToken}`,
"Content-Type": "application/json",
},
body: JSON.stringify({
Cards: {
Card: [
{
f_afm_ergodoti: "094187530",
f_aa: "0",
f_comments: "Quickstart test submission",
Details: {
CardDetails: [
{
f_afm: "028233026",
f_eponymo: "ΚΑΠΟΙΟΣ",
f_onoma: "ΛΑΜΠΡΟΣ",
f_type: "0",
f_reference_date: "2024-05-04",
f_date: "2024-05-04T08:58:00+03:00",
f_aitiologia: null,
},
],
},
},
],
},
}),
}
);

const result = await response.json();
console.log(result);

PHP

<?php

$accessToken = "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...";

$payload = [
"Cards" => [
"Card" => [
[
"f_afm_ergodoti" => "094187530",
"f_aa" => "0",
"f_comments" => "Quickstart test submission",
"Details" => [
"CardDetails" => [
[
"f_afm" => "028233026",
"f_eponymo" => "ΚΑΠΟΙΟΣ",
"f_onoma" => "ΛΑΜΠΡΟΣ",
"f_type" => "0",
"f_reference_date" => "2024-05-04",
"f_date" => "2024-05-04T08:58:00+03:00",
"f_aitiologia" => null,
],
],
],
],
],
],
];

$ch = curl_init("https://trialv2eservices.yeka.gr/WebservicesAPI/Api/Documents/WRKCardSE");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, [
"Authorization: Bearer $accessToken",
"Content-Type: application/json",
]);
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($payload));

$response = curl_exec($ch);
curl_close($ch);

$result = json_decode($response, true);
print_r($result);

Not sure what these fields mean? See the Glossary.

3. Confirm Ergani accepted it

Success

[
{
"id": "92",
"protocol": "ΕΥΣ92",
"submitDate": "04/05/2024 08:58"
}
]

You're done — a protocol value means the event is recorded. Store it.

Failure

{
"message": "Για το Παράρτημα: 0\\nΤο ΑΦΜ δεν αντιστοιχεί στον συνδεδεμένο εργοδότη."
}

This specific message means f_afm_ergodoti doesn't match the employer connected to your credentials. Use the trial environment's test employer ΑΦΜ, or your own employer's ΑΦΜ if testing against your real account. For other error messages, see Error Handling.

What's next

  • Core Concepts — understand check-in/check-out, reference dates, and the on-time window before you build more workflows.
  • Workflows — check-out, corrections, late submissions, bulk sends.
  • Authentication — token refresh strategy for production.