Buk

Buk Days worked API

The Days worked API from Buk — 2 operation(s) for days worked.

OpenAPI Specification

buk-days-worked-api-openapi.yml Raw ↑
openapi: 3.2.0
info:
  title: Buk Days worked API
  version: '1.0'
  description: 'Operations tagged Days worked across 5 of this provider''s published API definitions: buk-data-access-api-brasil-openapi.yml, buk-data-access-api-chile-openapi.yml, buk-data-access-api-colombia-openapi.yml, buk-data-access-api-mexico-openapi.yml, buk-data-access-api-peru-openapi.yml. Each path carries the servers of the definition it was published in.'
host: demo.buk.cl
tags:
- name: Days worked
paths:
  /working_days:
    get:
      summary: Show Worked Days
      description: "Provides information about the days worked for each Colaborador.\n\nA type of Worked Day has the following attributes:\n- employee_id: unique identifier of the Colaborador\n- document_number: Document Number of the Colaborador\n- document_type: Type of Document of the Colaborador\n- code: file code of the Colaborador\n- working_days: total number of days worked\n- working_days_dates: dates of the days worked\n\n**Permisos requeridos para utilizar este endpoint:** \n* Attendance permissions en: 'Lectura'.\n"
      tags:
      - Days worked
      parameters:
      - name: from
        in: query
        type: string
        format: date
        description: (OPTIONAL) Indicates the starting date of the worked days (Format YYYYY-MM-DD)
      - name: to
        in: query
        type: string
        format: date
        description: (OPTIONAL) Indicates the end date of the worked days (Format YYYYY-MM-DD)
      - name: document_number
        in: query
        type: string
        description: (OPTIONAL) Document Number of the Colaborador
      - name: code
        in: query
        type: string
        description: (OPTIONAL) Colaborador file code
      - name: page_size
        in: query
        type: integer
        description: (OPTIONAL) Number of answers per page. By default it has a value of 25 and must be within a range of [25 - 100].
      - name: page
        in: query
        type: integer
        description: (OPTIONAL) Page number
      responses:
        '200':
          description: A list of days worked for each Colaborador.
          schema:
            properties:
              pagination:
                $ref: '#/definitions/Pagination'
              data:
                type: array
                items:
                  $ref: '#/definitions/WorkingDay'
    post:
      summary: Create worked days
      description: "Save worked days for each Colaborador. The parameters are:\n\n- employee_id: ID of the Colaborador\n- month: Number of the month to which the worked days will be added\n- working_days: a list of worked days for the indicated month. This list should be a sequence of integers, where each number represents a day of the month, separated by commas.\n\nPlease note that the worked days will be saved for the specified month, overwriting the existing entry. In other words, each request will overwrite the worked days.\n\nPlease note that if the employee's pay stub is closed for that month, worked days cannot be added.\n\nPlease note that worked days can only be added in open months.\n\n**Permisos requeridos para utilizar este endpoint:** \n* Attendance permissions en: 'Lectura y Modificación'.\n"
      tags:
      - Days worked
      parameters:
      - name: WorkingDay
        description: Object of type WorkingDay
        in: body
        schema:
          $ref: '#/definitions/WorkingDay::Minimal'
      responses:
        '201':
          description: Response in case of successful creation of worked days
          schema:
            properties:
              message:
                type: string
  /working_days/{employee_id}/{monthyear}:
    delete:
      summary: Delete worked days
      description: "Deletes the days worked for an Colaborador. The parameters are:\n\n- employee_id: ID of the Colaborador\n- Date for deleting worked days (Format MM-YYYY)\n\n**Permisos requeridos para utilizar este endpoint:** \n* Attendance permissions en: 'Lectura y Modificación'.\n"
      tags:
      - Days worked
      parameters:
      - name: employee_id
        in: path
        type: integer
        description: '- employee_id: ID of the Colaborador'
        required: true
      - name: monthyear
        in: path
        type: string
        format: date
        description: '- Date for deleting worked days (Format MM-YYYY)'
        required: true
      responses:
        '200':
          description: Response in case of successful deletion of the worked days
          name: data
          schema:
            properties:
              deleted:
                type: string
        '404':
          description: When there are no allowed resources to delete
          name: data
          schema:
            properties:
              message:
                type: string
        '400':
          description: There is an error with the data submitted
          schema:
            $ref: '#/definitions/bad_request'
definitions:
  BasePersonIdentifier:
    properties:
      document_number:
        type: string
        description: Document Number of  Colaborador.
      document_type:
        type: string
        description: 'Document Type Colaborador. Valid Document Types in the {code: translation} format are: {"rut":"RUT","otro":"Other"}'
  WorkingDay:
    properties:
      employee_id:
        type: integer
      rut:
        type: string
      code:
        type: string
      working_days:
        type: integer
      working_days_dates:
        type: array
        items:
          type: string
          format: date
    allOf:
    - $ref: '#/definitions/BasePersonIdentifier'
  WorkingDay::Minimal:
    properties:
      employee_id:
        type: integer
      month:
        type: integer
      working_days:
        type: string
        default: 1,2,3
  bad_request:
    properties:
      errors:
        type: array
        items:
          type: string
  Pagination:
    properties:
      next:
        type: string
      previous:
        type: string
      count:
        type: integer
      total_pages:
        type: integer
securityDefinitions:
  auth_token:
    type: apiKey
    name: auth_token
    in: header
x-refined-from:
- buk-data-access-api-brasil-openapi.yml
- buk-data-access-api-chile-openapi.yml
- buk-data-access-api-colombia-openapi.yml
- buk-data-access-api-mexico-openapi.yml
- buk-data-access-api-peru-openapi.yml