Web Analytics

iFlow API V2.0

How do you obtain the API key?

The API key can be obtained from Settings → API Access. Once generated, the API key cannot be edited, but it can be revoked if necessary.

Call the API

Make a POST request with the content encoded as multipart/form-data body content type.

CURL Sample:

The following sample gets the work schedule for all the users. Moreover, it calculates the total worked and overtime hours.

curl -d "api_key=YOUR_API_KEY&api_language=ro_RO&year=2019&month=12&totals=total,overtime" 
-X POST https://app.iflow.ro/api/api_v2/user/get_work_schedule

ARC (Advanced Rest Client) Sample:

For a simple debug process and testing, we recommend you use a REST Client. We usually use Advanced REST client.

Errors and replies:

The API replies with an HTTP status code 200 if everything goes well on the application side. If you get a 404 status code, that means the endpoint is not available. If you get a 500 status code, the server has encountered an unspecified error.

You can instantly send a reply code of 200 HTTP to a JSON interpreter for parsing. The structure of the reply is an object named API_reply. If that object has a property “error,” that means that the request did not pass the API Validator.

In the following example, the API replied with an error for a missing field called “totals”. The field was missing from the POST request.

{
    "api_reply": {
        "error": [
            {
                "field_name": "totals",
                "check_name": "required",
                "message": "totals is required"
            }
        ]
    }
}

API endpoints

The iFlow API currently has endpoints for user synchronization and computed data retrieval. We are working hard to add additional endpoints to better integrate iFlow with other systems and programs.

/api_v2/user/get_work_schedule

Gets the work schedule report as it was planned and the difference between overtime and time off. The planned hours and overtime are calculated separately and are available via the totals parameter.

Required parameters:

  • api_key – the API key
  • api_language – the language that iFlow uses for error messages
    • en_US – for English / US
    • ro_RO – for Romanian
  • year – what year to use for the report
  • month – what month to use for the report (01 – 12)
  • totals – comma-separated values for the totals that you want to receive.
    • ex: regular,total,overtime – this will return the normal working hours, total worked hours and the overtime. (total = regular+overtime)
    • ex: regular,regular_weekdays,regular_weekend,regular_holiday – this will return the total regular hours, regular hours in weekdays, regular hours worked in weekend and in national holidays. You can append _weekdays, _weekend, _holiday modifiers to all the totals types

/api_v2/user/update

This API endpoint is used to sync employees if the employee management is done in another application (like a payroll app).

The endpoint updates any user if the social security number (SSN/CNP) or id card number already exists in the database, and if not, it adds the user.

Parameters:

  • api_key – the API key
  • api_language – the language that iFlow will use for error messages
    • US – for English / US
    • ro_RO – for Romanian
  • update_by – what to use to search for the user, if a matching user is found it will be updated instead of creating a new one. Possible values are: cnp or id_card (we use cnp is the social security number)
  • update_by_value – the value of the cnp if update_by is set to cnp, or the value for id_card if update_by is set to id_card.
  • full_name – if it’s set in post data, must not be empty for updating users and it’s required for new users.
  • team_name – if the given team is not found on company a new team with using the given team name will be created.
  • cnp
  • id_card
  • disable_date
  • is_enabled
  • rfid_tag
  • id_card_issued_by
  • id_card_issue_date
  • bank_account
  • birth_date
  • employment_date
  • job_title
  • mark_number
  • contract_number
  • section
  • address
  • city
  • county
  • phone_one
  • phone_two

Reply:

{
    "api_reply": {
        "update_by": "cnp",
        "update_by_value": "186022222222",
        "new_user": {
                "team_id": "3853",
                "full_name": "John Deer",
                "is_enabled": "1",
                "disable_date": null,
                "rfid_tag": null,
                "cnp": "186022222222",
                "id_card": null,
                "id_card_issued_by": null,
                "id_card_issue_date": null,
                "bank_account": null,
                "birth_date": null,
                "employment_date": null,
                "job_title": null,
                "mark_number": null,
                "contract_number": null,
                "section": null,
                "address": null,
                "city": null,
                "county": null,
                "phone_one": null,
                "phone_two": null,
        }
    }
}

Radu O.
Radu O.
Passionate for coding, I enjoy designing systems that are easy to use. I'm the one who makes sure the code is clean, the team is cheerful and the customers are happy.

Sign Up to Our Newsletter!

Be the first to get the latest news.

LEAVE A REPLY

Please enter your comment!
Please enter your name here