Skip to content

API Días Laborales v1

Descripción general

Recurso de la capa de experiencia encargado de recuperar información de días laborales desde el API BotService. Registra las solicitudes y respuestas, y captura datos clave para auditoría y control.

Categoría de Negocio: Movilidad


Capa de experiencia

Endpoint y método


GET [https://bot-xapi-services-qa.us-e2.cloudhub.io/v1/parameters/businessdays](https://bot-xapi-services-qa.us-e2.cloudhub.io/v1/parameters/businessdays)

Especificación

Ver en Anypoint Exchange

Descripción funcional

Permite obtener el calendario de días laborales desde BotService, gestionando la información para auditoría de llamadas y control de consumo.


Capa de proceso

No aplica.


Capa de sistema

Endpoint y método


GET [https://bot-sapi-services-dev.us-e2.cloudhub.io/bot/parameters/businessdays/v1](https://bot-sapi-services-dev.us-e2.cloudhub.io/bot/parameters/businessdays/v1)

Especificación

Ver en Anypoint Exchange

Descripción funcional

Consulta directamente el servicio BotService para recuperar la información de días laborales. Usa la ruta interna:


[http://botdev.portallteqa.p.azurewebsites.net/api/parameters/v1/getbusinessdays](http://botdev.portallteqa.p.azurewebsites.net/api/parameters/v1/getbusinessdays)

Ejemplos de Request/Response

Solicitud (request)

json
GET https://bot-xapi-services-qa.us-e2.cloudhub.io/v1/parameters/businessdays

Respuesta exitosa (200)

json
{
  "responseHeader": {
    "system": {
      "name": "PARAMETRICOS",
      "correlationID": "36a2c407-dfe7-4ab7-b67f-"
    },
    "service": {
      "status": "OK",
      "responseDate": "2025-06-15T18:46:29.5644856Z",
      "statusDetail": [
        {
          "errorCode": "OK_01",
          "errorDetailCode": "Se consultaron los días hábiles exitosamente",
          "errorMessage": "La solicitud 36a2c407-dfe7-4ab7-b67f- fue exitosa"
        }
      ]
    },
    "property": []
  },
  "responseBody": {
    "businessDays": [
      {
        "date": "2025-06-16T23:46:29.5644856+00:00",
        "day": "16",
        "month": "06",
        "monthStr": "Jun",
        "year": "2025"
      }
    ]
  }
}

Respuesta de error (4xx/5xx)

json
{
  "status": 409,
  "code": "INVALID_FIELD",
  "message": {
    "message": ""
  },
  "messageServer": "No such column 'Segmento' on entity 'Account'.",
  "cause": [
    {
      "origin": "bot-xapi-services",
      "message": "org.mule.extension.http.api.request.validator.ResponseValidatorTypedException"
    }
  ]
}
json
{
  "status": 500,
  "code": "INTERNAL_SERVER_ERROR",
  "message": {
    "message": "HTTP GET on resource 'http://0.0.0.0:8080/XXXXX/services/xxxxxx' failed: internal server error (500)."
  },
  "messageServer": "Descripcion del error. Detalle de porque fallo.",
  "cause": [
    {
      "origin": "bot-xapi-services",
      "message": "org.mule.extension.http.api.request.validator.ResponseValidatorTypedException"
    }
  ]
}

Esquemas de datos

Respuesta exitosa (200)

CampoTipoObligatorioDescripción
responseHeader.system.nameStringNombre del sistema que responde.
responseHeader.system.correlationIDNumberID de correlación para trazabilidad.
responseHeader.system.processingServerStringNoServidor de procesamiento.
responseHeader.service.statusStringEstado de la respuesta.
responseHeader.service.responseDateStringFecha y hora de la respuesta.
responseHeader.service.statusDetail.errorCodeStringCódigo de resultado.
responseHeader.service.statusDetail.errorDetailCodeStringDetalle del código de resultado.
responseHeader.service.statusDetail.errorMessageStringNoMensaje descriptivo.
responseHeader.propertyObjectNoPropiedades adicionales.
responseBody.businessDays.dateStringFecha en formato ISO.
responseBody.businessDays.dayStringDía numérico.
responseBody.businessDays.monthStringMes numérico.
responseBody.businessDays.monthStrStringMes en texto.
responseBody.businessDays.yearStringAño.

Respuesta de error (4xx/5xx)

CampoTipoObligatorioDescripción
codeStringCódigo HTTP asociado al error.
statusNumberCódigo estandarizado del error.
message.messageStringNoMensaje comprensible para humanos.
messageServerStringDescripción técnica del error.
cause.originStringNombre de la API o capa generadora del error.
cause.messageStringDescripción técnica del error.

Diagramas

Diagrama de flujo

mermaid
flowchart TD
    A[Cliente] -->|GET| B[API Experiencia]
    B -->|GET| C[API Sistema]
    C -->|Request| D[BotService]
    D -->|Response| C
    C -->|Response| B
    B -->|Response| A

Diagrama de secuencia

mermaid
sequenceDiagram
    participant Client as Cliente Externo
    participant XAPI as bot-xapi-services-qa.us-e2.cloudhub.io
    participant SAPI as bot-sapi-services
    participant BotServices as Bot Services (External)
    participant Logger as Logging System
    participant ErrorHandler as Error Handler
    participant Auth as Authentication Service

    Note over Client,Auth: Flujo de consulta de días hábiles
    
    Client->>XAPI: GET /v1/parameters/businessdays
    Note right of Client: Headers: x-correlation-id, source, name, systemid
    
    XAPI->>XAPI: bot-xapi-services-main
    Note right of XAPI: HTTP Listener con TLS
    
    XAPI->>Logger: initial-loggin-Sub_Flow
    Note right of Logger: Log inicial de la petición
    
    XAPI->>XAPI: apikit:router
    Note right of XAPI: Enrutamiento basado en RAML
    
    XAPI->>XAPI: get:\v1\parameters\businessdays:bot-xapi-services-config
    Note right of XAPI: Flow específico para businessdays
    
    XAPI->>XAPI: get-parameters-businessdays-handlerSub_Flow
    Note right of XAPI: Handler de parámetros
    
    XAPI->>XAPI: get-parameters-businessdays-orchestadorSub_Flow
    Note right of XAPI: Orquestador principal
    
    XAPI->>XAPI: Set variables
    Note right of XAPI: variablesRequest.processname = "getParametersBusinessdays"
    
    XAPI->>XAPI: get-parameters-sendClient-orchestadorSub_Flow
    Note right of XAPI: Lógica de envío al cliente
    
    XAPI->>XAPI: Choice Router
    Note right of XAPI: Evaluación del processname
    
    XAPI->>XAPI: get-parameters-businessdays-clientSub_Flow
    Note right of XAPI: Cliente HTTP para SAPI
    
    XAPI->>SAPI: POST /api/parameters/businessdays/v1
    Note right of XAPI: Headers: client_secret, client_id, x_civ_request, processname, systemId
    
    SAPI->>SAPI: bot-sapi-services-main
    Note right of SAPI: HTTP Listener
    
    SAPI->>Logger: initial-loggin-Sub_Flow
    Note right of Logger: Log inicial SAPI
    
    SAPI->>SAPI: apikit:router
    Note right of SAPI: Enrutamiento SAPI
    
    SAPI->>SAPI: get:\parameters\businessdays\v1:bot-sapi-services-config
    Note right of SAPI: Flow específico SAPI
    
    SAPI->>SAPI: get-parameters-businessdays-handlerSub_Flow
    Note right of SAPI: Handler SAPI
    
    SAPI->>SAPI: post-parameters-getBusinessDays-orchestadorSub_Flow
    Note right of SAPI: Orquestador SAPI
    
    SAPI->>SAPI: Set initialPayload
    Note right of SAPI: Guardar payload inicial
    
    SAPI->>Auth: get-authentication-token
    Note right of Auth: Obtener token de autenticación
    
    Auth->>Auth: Prepare auth body
    Note right of Auth: Preparar cuerpo de autenticación
    
    Auth->>BotServices: POST /authenticate
    Note right of Auth: Solicitar token con credenciales
    
    BotServices-->>Auth: SecurityToken
    Note right of Auth: Token de autenticación
    
    Auth-->>SAPI: generatedToken
    Note right of SAPI: Token recibido
    
    SAPI->>SAPI: botServices-parameters-getBusinessdays-clientSub_Flow
    Note right of SAPI: Cliente para Bot Services
    
    SAPI->>Logger: loggin-client-call (Async)
    Note right of Logger: Log de salida
    
    SAPI->>BotServices: GET /parameters/businessdays
    Note right of SAPI: Headers: Authorization: Bearer {token}, x_civ_request
    
    BotServices-->>SAPI: Business Days Data
    Note right of SAPI: Datos de días hábiles
    
    SAPI->>Logger: loggin-client-call (Async)
    Note right of Logger: Log de respuesta
    
    SAPI-->>XAPI: WSResponseBody + WSResponseHeader
    Note right of XAPI: Respuesta estructurada
    
    XAPI->>XAPI: Choice Router (Response Validation)
    Note right of XAPI: Validar si hay respuesta
    
    alt Response exists
        XAPI->>XAPI: parameters-responseSub_Flow
        Note right of XAPI: Transformar respuesta exitosa
    else No Response
        XAPI->>XAPI: parameters-noResponseSub_Flow
        Note right of XAPI: Manejar respuesta vacía
    end
    
    XAPI->>XAPI: Transform Response
    Note right of XAPI: Camelizar campos y estructurar respuesta
    
    XAPI->>Logger: loggin-client-call (Async)
    Note right of Logger: Log de respuesta final
    
    XAPI->>ErrorHandler: error-handlerError_Handler
    Note right of ErrorHandler: Manejo de errores global
    
    XAPI-->>Client: JSON Response
    Note right of Client: {responseHeader: {...}, responseBody: {...}}
    
    Note over Client,Auth: Fin del flujo de consulta de días hábiles

Políticas de seguridad

Autenticación

  • OAuth 2.0 Access Token Enforcement Using External Provider.
  • Validación del token, su vigencia y el scope asociado al client_id.
  • Respuesta de “Acceso denegado” si el token es inválido o no autorizado.

SLAs

  • Puede incluir límite de 1000 req/min por cliente.
  • Tiempos de respuesta sujetos a acuerdos establecidos.

Rate Limits

  • Anypoint Security:

    • Longitud máxima de ruta: 4096 bytes.
    • Longitud máxima de encabezado: 16384 bytes.
  • CloudHub 2.0:

    • Tamaño máximo de URI: 4 KB.
    • Longitud máxima del encabezado HTTP: 32 KB.

Errores comunes

  • 409 INVALID_FIELD: Campo inválido en la solicitud.
  • 500 INTERNAL_SERVER_ERROR: Error interno al procesar la solicitud.

Dependencias

  • Recepción de peticiones desde sistemas externos.

  • Llamada a la capa de sistema:

    https://bot-sapi-services-dev.us-e2.cloudhub.io/bot/parameters/businessdays/v1
  • Comunicación con BotService:

    http://botdev.portallteqa.p.azurewebsites.net/api/parameters/v1/getbusinessdays

Historial de cambios

VersiónFechaDescripción
En desarrollo16/06/2025Creación inicial