Add aptitudes

This endpoint allows to register a list of aptitudes for an employee.

POST /api/v1/import/aptitudes

Below is an explanation of each field in the request body.

All fields in this request are mandatory, hence they are marked with an asterisk (*).

Request body

JSON Analysis
{
  "business": "string",
  "employeeId": "string",
  "aptitudes": [
    {
      "productId": "string",
      "aptitudes": [
        {
          "locationId": "string",
          "level": 0,
          "excludedZones": ["string"]
        }
      ]
    }
  ]
}
Details
  • business*: external business identifier.

  • employeeId*: external employee identifier.

  • aptitudes*: set of aptitudes to be defined for the employee regarding tasks for a product.

    • productId*: external identifier of the product or section for the employee.

    • aptitudes*: list of aptitudes. Each aptitude is composed of the following fields:

      • locationId*: external identifier of the task to which the aptitude refers.

      • level*: level of competency for the task, ranging from 0 (not competent) to 3 (expert).

      • excludedZones: external identifiers of the zones that will be excluded from this aptitude. If not specified, the aptitude applies to all zones of the product.

Request example

Once the fields have been analyzed, below is an example of the request:

POST /api/v1/import/aptitudes
{
  "business": "BUSINESSID",
  "employeeId": "EMPLOYEEID",
  "aptitudes": [
    {
      "productId": "0001-G",
      "aptitudes": [
                {
                    "locationId": "02",
                    "level": 3,
                    "excludedZones": ["Z1"]
                }
      ]
    }
  ]
}

If the data is correct, the request will return a 200 OK status and all the employee’s aptitudes for the specified product will be replaced by those in the request.

Considerations

If decimal values are sent for level, they will be truncated to their integer number.

The same level of competence will be set for all zones of the product that have the task enabled, unless a zone is included in the excludedZones field. Excluded zones will be set to level 0.

If the employee has aptitudes defined for other products, those will remain unaltered.

Error codes

In addition to the common errors, this endpoint can return the following codes:

Code Message Description

406 Not Acceptable

must be less than or equal to 3

One or more level fields contain out-of-range values. The request accepts the values 0, 1, 2 and 3 for level.

must be greater than or equal to 0

One or more level fields contain out-of-range values. The request accepts the values 0, 1, 2 and 3 for level.

409 Conflict

-

Duplicate aptitudes have been included in the creation. It is recommended to review the request and remove the duplicate aptitudes before sending it.

What is an aptitude?

What is a task?