Buk

Buk Substitutions API

The Substitutions API from Buk — 2 operation(s) for substitutions.

OpenAPI Specification

buk-substitutions-api-openapi.yml Raw ↑
openapi: 3.2.0
info:
  title: Buk Substitutions API
  version: '1.0'
  description: 'Operations tagged Substitutions 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: Substitutions
paths:
  /substitutions:
    get:
      tags:
      - Substitutions
      description: "Obtain substitutions\n\nAttributes description:\n- `id`: Unique identifier of the substitution.\n- `active`: Status of the substitution.\n- `employee_id`: Id of the Colaboradores.\n- `substitute_id`: Id of the substitute Colaboradores.\n- `start_date`: Start date of the substitution.\n- `end_date`: End date of the substitution.\n- `reason`: Cause of the substitution.\n\n**Permisos requeridos para utilizar este endpoint:** \n* Employee permissions en: 'Lectura'.\n"
      parameters:
      - name: page
        in: query
        type: integer
        description: 'Optional query parameters to filter and label substitutions.

          '
      - name: page_size
        in: query
        type: integer
        description: 'Optional query parameters to filter and label substitutions.

          '
      responses:
        '200':
          description: 'API response when retrieving substitutions with labels and details of each substitution.

            '
          name: data
          schema:
            properties:
              pagination:
                $ref: '#/definitions/Pagination'
              data:
                type: array
                items:
                  $ref: '#/definitions/EmployeeSubstitutionDetail'
    post:
      tags:
      - Substitutions
      description: "Create a new substitution\n\nAttribute description:\n- `active`: Status of the substitution.\n- `employee_id`: Id of the Colaboradores.\n- `substitute_id`: Id of the substitute Colaboradores.\n- `start_date`: Start date of the substitution.\n- `end_date`: End date of the substitution.\n- `reason`: Reason for the substitution.\n\n**Permisos requeridos para utilizar este endpoint:** \n* Employee permissions en: 'Lectura y Modificación'.\n"
      parameters:
      - name: substitution
        in: body
        description: 'Data for the new substitution to be created, including ID’s of the Colaborador and the substitute, start and end dates, and status.

          '
        required: true
        schema:
          $ref: '#/definitions/EmployeeSubstitutionInput'
      responses:
        '201':
          description: 'API response upon creating a new substitution, including details of the created substitution.

            '
          schema:
            $ref: '#/definitions/EmployeeSubstitutionDetail'
        '400':
          description: 'Invalid entry

            '
  /substitutions/{id}:
    patch:
      tags:
      - Substitutions
      description: "Updates a specific substitution\nAttribute description:\n- `active`: Status of the substitution.\n- `employee_id`: Id of the Colaboradores.\n- `substitute_id`: Id of the substitute Colaboradores.\n- `start_date`: Start date of the substitution.\n- `end_date`: End date of the substitution.\n- `reason`: Reason for the substitution.\n\n**Permisos requeridos para utilizar este endpoint:** \n* Employee permissions en: 'Lectura y Modificación'.\n"
      parameters:
      - name: id
        in: path
        type: integer
        description: 'Substitution ID to be updated

          '
        required: true
      - name: substitution
        in: body
        description: 'Data to be updated in the existing substitution, such as start and end dates or status

          '
        required: true
        schema:
          $ref: '#/definitions/EmployeeSubstitutionInput'
      responses:
        '200':
          description: 'API response after successful update of a substitution

            '
          schema:
            $ref: '#/definitions/EmployeeSubstitutionDetail'
        '400':
          description: 'Invalid entry

            '
        '404':
          description: 'Substitution not found

            '
    delete:
      tags:
      - Substitutions
      description: "Eliminate a specific substitution\n\n**Permisos requeridos para utilizar este endpoint:** \n* Employee permissions en: 'Lectura y Modificación'.\n"
      parameters:
      - name: id
        in: path
        type: integer
        description: 'Substitution ID to be deleted

          '
        required: true
      responses:
        '200':
          description: 'API response after successful deletion of a substitution

            '
        '404':
          description: 'Substitution not found

            '
        '422':
          description: 'It was not possible to eliminate the substitution

            '
definitions:
  EmployeeSubstitutionDetail:
    properties:
      id:
        type: integer
        readOnly: true
      active:
        type: boolean
      employee_id:
        type: integer
      substitute_id:
        type: integer
      start_date:
        type: string
        format: date
      end_date:
        type: string
        format: date
      reason:
        type: string
        description: Causal
  EmployeeSubstitutionInput:
    properties:
      active:
        type: boolean
      employee_id:
        type: integer
      substitute_id:
        type: integer
      start_date:
        type: string
        format: date
      end_date:
        type: string
        format: date
      reason:
        type: string
        description: Causal
  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