API Name:
api_v2/projects/activity
We use this API to get the activity overview report from iFlow, which contains data about project participation.
Quick info:
The data we get from the activity overview report will be set by default as it is set in iFlow application.
Full url
Method: GET
https://app.iflow.ro/api/api_v2/projects/activity
CURL request
Method: GET
curl -X GET -H "Authorization: Bearer {ACCES TOKEN}" https://app.iflow.ro/api/api_v2/projects/activity
Method: POST
curl -X POST -H "Authorization: Bearer {ACCES TOKEN}" -d "start_date={VALUE}&end_date={VALUE}&pids={VALUE(S)}&users_ids={VALUE(S)}&projects_ids={VALUE(S)}&total_projects_hours ={true/false}" https://app.iflow.ro/api/api_v2/projects/activity
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.
POST method info: With POST method you can select data that you get from the activity overview report by start and end date, by unique project code, by user id and by project id. The totals parameter is set from the report in the iFlow application.
Start date
With the key "start_date" you will get information from the activity report starting with the value of the key.
End date
With the key "end_date" you will get information from the activity report ending with the value of the key.
Unique project code
The unique project code aka "pids" can get the report information with attendance on the projects that have set the unique code. You can also get information from multiple projects if you set the "pids" key with values separated by a comma.
User id
Based on the "users_ids" key you can get information for specific user, or users if the values imputed are multiple users ids separated by commas.
Project id
Based on the "projects_ids" key you can get information for specific project, or projects if the values imputed are multiple projects ids separated by commas.
Projects total hours
Based on the "total_projects_hours " key, if it is set to true, you get an extra row with empty values except in totals where the value of total will show all hours worked on all projects from date interval selected. Default or absent, this key is set to false.
Returns:
Ok response:
If everything is ok, you get a list of attendances with no errors.
[ { "row_no": 8, "ID": 7, "cnp": "5555555555555", "mark_number": "", "full_name": "Miclea Dorin", "team_name": "Development", "project_name": "Project name", "project_name_for_lists": "Project name", "sub_project_name": "", "sub_project_name_for_lists": "", "location_name": "", "user_id_rowspan": 1, "project_id_rowspan": 1, "location_id_rowspan": 1, "days_data": { "2022-10-11": { "value": 9, "predefined_shift": "", "title": "", "color": "", "free_day_name": "", "live_attendance_issue": "", "start_time": 8, "end_time": 17, "check_in": "08:00:00", "check_out": "17:00:00", "is_employed": true } }, "totals_data": { "row_no": 8, "user_id": 7, "project_id": 5555, "pid": "1212", "location_id": false, "user_id_rowspan": 1, "project_id_rowspan": 1, "location_id_rowspan": 1, "totals": { "total": 9, "total_weekdays": 9 }, "leave_hours": [], "totals_with_id": [], "totals_extra": { "project_id": 9 } } } ]
Ok response:
Ok response with "total_projects_hours " parameter.
[ { "row_no": 8, "ID": 7, "cnp": "5555555555555", "mark_number": "", "full_name": "Miclea Dorin", "team_name": "Development", "project_name": "Project name", "project_name_for_lists": "Project name", "sub_project_name": "", "sub_project_name_for_lists": "", "location_name": "", "user_id_rowspan": 1, "project_id_rowspan": 1, "location_id_rowspan": 1, "days_data": { "2022-10-11": { "value": 9, "predefined_shift": "", "title": "", "color": "", "free_day_name": "", "live_attendance_issue": "", "start_time": 8, "end_time": 17, "check_in": "08:00:00", "check_out": "17:00:00", "is_employed": true } }, "totals_data": { "row_no": 8, "user_id": 7, "project_id": 5555, "pid": "1212", "location_id": false, "user_id_rowspan": 1, "project_id_rowspan": 1, "location_id_rowspan": 1, "totals": { "total": 9, "total_weekdays": 9 }, "leave_hours": [], "totals_with_id": [], "totals_extra": { "project_id": 9 } } } { "row_no": "", "ID": "", "cnp": "", "mark_number": "", "full_name": "", "team_name": "",, "project_name": "", "project_name_for_lists": "", "sub_project_name": "", "sub_project_name_for_lists": "", "location_name": "", "user_id_rowspan": "", "project_id_rowspan": "", "location_id_rowspan": "", "days_data":[], "totals_data": { "row_no": "", "user_id": "",, "project_id": "", "pid": "",, "location_id": "", "user_id_rowspan": "", "project_id_rowspan": "", "location_id_rowspan": "", "totals": { "total": total worked hours on projects, "total_weekdays": "", }, "leave_hours": [], "totals_with_id": [], "totals_extra": { "project_id": "", } } } ]
Examples of errors you can get:
Error response:
{ "error": "Key is invalid!" }
Error response:
{ "error": "Invalid end date: 2022-10-112, correct format is yyyy-mm-dd, ex: 2022-10-25" }