API Name:
api/api_v2/get_work_schedule
We use this API to get monthly iFlow users work schedule data.
Quick info:
First you get month and year values;
Afterwards company free days within current month;
And finally monthly work schedule data of all users.
Full url
Method: GET
https://app.iflow.ro/api/api_v2/users/get_work_schedule
CURL request
Method: GET
curl -X GET -H "Authorization: Bearer {ACCESS TOKEN}" https://app.iflow.ro/api/api_v2/users/get_work_schedule
Method: POST
curl -X POST -H "Authorization: Bearer {ACCESS TOKEN}" https://app.iflow.ro/api/api_v2/users/get_work_schedule -d "api_language={ro_RO/en_US}&year={VALUE}&month={VALUE}&totals={VALUE}" https://app.iflow.ro/api/api_v2/users/get_work_schedule
Parameters:
Access token
The API access token is generated from Iflow, with a label name of your choosing and is assigned to an administrator from the company.
Language
Method: POST With api_language key and ro_RO value you can translate the status to romanian.
Year
Method: POST It displays the work schedule data from the year entered in the value of the "year" key. Default is the current year.
Month
Method: POST It displays the work schedule data from the month entered in the value of the "month" key. Default is the current month.
Totals
Method: POST
Values of the "totals" key are as follows:
   - For total work hours:
    1. Total:
       "totals" => total
       "totals" => total_day
       "totals" => total_night
    2. Week days (monday - friday):
       "totals" => total_weekdays
       "totals" => total_weekdays_day
       "totals" => total_weekdays_night
    3. Weekend:
       "totals" => total_weekend
       "totals" => total_weekend_day
       "totals" => total_weekend_night
    4. Holidays :
       "totals" => total_holiday
       "totals" => total_holiday_day
       "totals" => total_holiday_night
   - Regular schedule (no overtime):
    1. Total:
       "totals" => regular
       "totals" => regular_day
       "totals" => regular_night
    2. Week days (monday - friday):
       "totals" => regular_weekdays
       "totals" => regular_weekdays_day
       "totals" => regular_weekdays_night
    3. Weekend:
       "totals" => regular_weekend
       "totals" => regular_weekend_day
       "totals" => regular_weekend_night
    4. Holidays :
       "totals" => regular_holiday
       "totals" => regular_holiday_day
       "totals" => regular_holiday_night
   - Overtime:
    1. Total:
       "totals" => overtime
       "totals" => overtime_day
       "totals" => overtime_night
    2. Week days (monday - friday):
       "totals" => overtime_weekdays
       "totals" => overtime_weekdays_day
       "totals" => overtime_weekdays_night
    3. Weekend:
       "totals" => overtime_weekend
       "totals" => overtime_weekend_day
       "totals" => overtime_weekend_night
    4. Holidays :
       "totals" => overtime_holiday
       "totals" => overtime_holiday_day
       "totals" => overtime_holiday_night
Ok response:
If everything is ok, you get a list of monthly work schedule with no errors.
Returns:
[ { "current_month": 11, "current_year": 2022, "days_in_month": "30", "current_month_company_free_days": { "2022-11-30": { "ID": "108504", "company_id": "1", "day_name": "Sfântul Andrei", "date": "2022-11-30", "users_ids": [] } }, "user_totals": [ { "user_name": "Abrudan Alexandru", "user_id": "2", "cnp": "3333333333333", "totals": [ { "category": "Work schedule hours", "section": "Total", "option": "Total", "slug": "regular", "description": "Work schedule hours", "total_regular_hours": 160 } ], "leave_days": [ { "name": "01 - Common illness", "timesheet_symbol": "Ci", "slug": "other_leave_1", "leave_hours": 8 } ] }, { "user_name": "Ban Alina", "user_id": "50456", "cnp": "5555555555555", "totals": [ { "category": "Work schedule hours", "section": "Total", "option": "Total", "slug": "regular", "description": "Work schedule hours", "total_regular_hours": 168 } ], "leave_days": [] }, ]
Examples of errors you can get:
Error response:
{ "error": "Key is invalid!" }
Error response:
{ "error": "Invalid month provided" }