Page tree

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

  • Endpoint: /acreditaciones/ejecutar
  • Método: POST
  • Descripción: Ejecutar una acreditación.
  • Headers:
    • API-KEY: BMMyeLpIomvnnGwmN8IOydFCON4AQelKTIY4C44Fljg8AjFled
  • Request Body:

    Code Block
    languagepy
    titlejson
    linenumberstrue
    {
        "acreditacion": {
            "usuario": "test1",
            "idAcreditacion":274
        }
    }
    Expand
    titleConsideraciones del Request

    "usuario" => Puede enviar el nombre del usuario que creo la acreditación para asociar esa información a la petición.
    "idAcreditacion" => Debe enviar el ID de la orden de acreditación devuelta por el endpoint anterior.

  • Response Body:

    Code Block
    languagepy
    titlejson
    linenumberstrue
    {
        "header": {
            "codReturn": 0,
            "txtReturn": "SUCCESS"
        },
        "data": {
            "descripcion": "Se proceso correctamente"
        }
    }
    Expand
    titleRespuestas posibles

    "codReturn": 0, "txtReturn": "SUCCESS", "descripcion": "Se proceso correctamente" => Todos los colaboradores del Request pueden recibir su acreditación sin problemas.
    "codReturn": 1, "txtReturn": "ERROR", "descripcion": "Hubo un problema al ejecutar la acreditacion" => El endpoint tuvo un problema procesando la petición. Sistemas ya fue notificado.
    "codReturn": 2, "txtReturn": "ERROR", "descripcion": "No existe la orden de acreditacio" => Hay usuarios que no pertenecen a la lista de colabores de la empresa, pero si se procesa la orden para el resto.
    "codReturn": 3, "txtReturn": "WARNING", "descripcion": "Esta orden de acreditacion ya fue ejecutada" => Todos los colabores del request, no pertenecen a la empresa.
    "codReturn": 4, "txtReturn": "ERROR", "descripcion": "DINAMICO" => Se devuelve una descripción distinta dependiendo de la validación que rechazo la petición.

Manejo de errores

  • Common HTTP Status Codes:
    • 200 OK: The request was successful.
    • 400 Bad Request: The request could not be understood or was missing required parameters.
    • 401 Unauthorized: Authentication failed or user does not have permissions for the desired action.
    • 404 Not Found: The requested resource could not be found.
    • 500 Internal Server Error: An error occurred on the server.

Ejemplos de uso

Ejemplos de como consumir por curl:

AltaColaborador

HistoricoAcreditaciones

  • Endpoint: /acreditaciones/historico
  • Método: POST
  • Descripción: Devuelve los datos del histórico.
  • Headers:
    • API-KEY: BMMyeLpIomvnnGwmN8IOydFCON4AQelKTIY4C44Fljg8AjFled
  • Request Body:

    Code Block
    languagepy

...

  • title

...

  • json

...

  • linenumbers

...

  • true
    {
        "filtros": {
            "fechaInicio": "01/09/2024",
            "fechaFinal": "11/09/2024",
            "estado": "APROBADO"
        }
    }
    Expand
    titleConsideraciones del Request

    "fechaInicio" => Debe tener el formato de "dd/mm/yyyy"
    "fechaFinal" => Debe tener el formato de "dd/mm/yyyy"
    "estado" => Valores posibles: APROBADO, APROBADO-EJECUTADO y PENDIENTE.


    Se puede enviar uno o todos los campos vacios => "" Esto devolverá todos los registros.

  • Response Body:

    Code Block
    languagepy
    titlejson
    linenumberstrue
    {
        "header": {
            "codReturn": 0,
            "txtReturn": "SUCCESS"
        },
        "data": [
            {
                "descripcion": "Orden para Joel",
                "estado": "APROBADO",
                "fechaAprob": "03/09/2024 09:30:22",
                "fechaEjec": "03/09/24 09:30",
                "fechaInsert": "03/09/2024 09:30:22",
                "glosa": "ACREDITACION DE SALARIOS",
                "idAcreditacion": "570",
                "montoTotal": "1000000",
                "usuarioAprob": "test1",
                "usuarioEjec": "test1",
                "usuarioInsert": "test1"
            },
            {
                "descripcion": "Orden Nro. 5500",
                "estado": "APROBADO",
                "fechaAprob": "02/09/2024 10:53:40",
                "fechaEjec": "02/09/24 10:53",
                "fechaInsert": "02/09/2024 10:53:40",
                "glosa": "ACREDITACION DE SALARIOS",
                "idAcreditacion": "568",
                "montoTotal": "1000000",
                "usuarioAprob": "test1",
                "usuarioEjec": "test1",
                "usuarioInsert": "test1"
            },
            {
                "descripcion": "Joel acreditación",
                "estado": "APROBADO",
                "fechaAprob": "02/09/2024 10:52:23",
                "fechaEjec": "02/09/24 10:52",
                "fechaInsert": "02/09/2024 10:52:23",
                "glosa": "ACREDITACION DE SALARIOS",
                "idAcreditacion": "567",
                "montoTotal": "1000000",
                "usuarioAprob": "test1",
                "usuarioEjec": "test1",
                "usuarioInsert": "test1"
            },
            {
                "descripcion": "Acreditación Joel",
                "estado": "APROBADO",
                "fechaAprob": "02/09/2024 10:51:10",
                "fechaEjec": "02/09/24 10:51",
                "fechaInsert": "02/09/2024 10:51:10",
                "glosa": "ACREDITACION DE SALARIOS",
                "idAcreditacion": "566",
                "montoTotal": "1000000",
                "usuarioAprob": "test1",
                "usuarioEjec": "test1",
                "usuarioInsert": "test1"
            }
        ]
    }

DisponibleCuentaEmpresa

  • Endpoint: /acreditaciones/disponible
  • Método: POST
  • Descripción: Devuelve los datos de la cuenta.
  • Headers:
    • API-KEY: BMMyeLpIomvnnGwmN8IOydFCON4AQelKTIY4C44Fljg8AjFled
  • Request Body: (SIN REQUEST, SOLO POST)

  • Response Body:

    Code Block
    languagepy
    titlejson
    linenumberstrue
    {
        "data": {
            "disponible": "45075000",
            "estado": "Operativa",
            "nroCuenta": "",
            "nroTarjeta": "2C382210F8FE550D",
            "nroTarjetaCripto": "6043-XXXX-XXXX-6775"
        },
        "header": {
            "codReturn": 0,
            "txtReturn": "SUCCESS"
        }
    }

Manejo de errores

  • Common HTTP Status Codes:
    • 200 OK: The request was successful.
    • 400 Bad Request: The request could not be understood or was missing required parameters.
    • 401 Unauthorized: Authentication failed or user does not have permissions for the desired action.
    • 404 Not Found: The requested resource could not be found.
    • 500 Internal Server Error: An error occurred on the server.


Ejemplos de uso

Ejemplos de como consumir por curl:

AltaColaborador

Code Block
languagepy
themeDJango
titlecurl
linenumberstrue
curl -X POST "http://10.5.1.31:8103/rest/colaboradores/alta" \
-H "API-KEY: BMMyeLpIomvnnGwmN8IOydFCON4AQelKTIY4C44Fljg8AjFled" \
-H "Content-Type: application/json" \
-d '{
  "data": {
    "nroDocumento": 4040440,
    "nombres": "Arturo",
    "apellidos": "Sosa Bagnoli",
    "nroTelefono": "0971159618",
    "correo": "asosa@cabal.com.py"
  }
}'

ListarColaborador

Code Block
languagepy
themeDJango
titlecurl
linenumberstrue
curl -X POST "http://10.5.1.31:8103/rest/colaboradores/listar" \
-H "API-KEY: BMMyeLpIomvnnGwmN8IOydFCON4AQelKTIY4C44Fljg8AjFled" \
-H "Content-Type: application/json" \
-d '{
  "nroDocumento": 4040440
}'

CrearAcreditacion

Code Block
languagepy
themeDJango
titlecurl
linenumberstrue
curl -X POST "http://10.5.1.31:8103/rest/acreditaciones/crear" \
-H "API-KEY: BMMyeLpIomvnnGwmN8IOydFCON4AQelKTIY4C44Fljg8AjFled" \
-H "Content-Type: application/json" \
-d '{
  "acreditacion": {
    "usuario": "test1",
    "descripcion": "prueba 1",
    "lista": [
      {
        "nroDocumento": 4040440,
        "monto": 1500000
      },
      {
        "nroDocumento": 4040440,
    "nombres": "Arturo",     "apellidosmonto": "Sosa1200000
Bagnoli",     "nroTelefono": "0971159618", },
      {
"correo": "asosa@cabal.com.py"   } }'

ListarColaborador

Code Block
languagepy
themeDJango
titlecurl
linenumberstrue
curl -X POST "http://10.5.1.31:8103/rest/colaboradores/listar" \
-H "API-KEY: BMMyeLpIomvnnGwmN8IOydFCON4AQelKTIY4C44Fljg8AjFled" \
-H "Content-Type: application/json" \
-d '{
  "nroDocumento": 4040440
}'

...

nroDocumento": 404011111,
        "monto": 1600000
      }
    ]
  }
}'

EjecutarAcreditacion

Code Block
languagepy
themeDJango
titlecurl
linenumberstrue
curl -X POST "http://10.5.1.31:8103/rest/acreditaciones/crearejecutar" \
-H "API-KEY: BMMyeLpIomvnnGwmN8IOydFCON4AQelKTIY4C44Fljg8AjFled" \
-H "Content-Type: application/json" \
-d '{
  "acreditacion": {
    "usuario": "test1",
    "descripcion": "prueba 1",
    "lista": [
      
-d '{
  "acreditacion": {
    "nroDocumentousuario": 4040440"test1",
        "montoidAcreditacion": 1500000274
  }
   },
      {
        "nroDocumento": 4040440,
   }'

HistoricoAcreditacion

Code Block
languagepy
themeDJango
titlecurl
linenumberstrue
curl -X POST "http://10.5.1.31:8103/rest/acreditaciones/historico" \
-H "API-KEY: BMMyeLpIomvnnGwmN8IOydFCON4AQelKTIY4C44Fljg8AjFled" \
-H "Content-Type: application/json" \
-d '{
    "montofiltros": 1200000
      },
      {
        "nroDocumentofechaInicio": 404011111"01/09/2024",
        "montofechaFinal": 1600000"11/09/2024",
      }  "estado": "APROBADO"
 ]   }
}'

...

ConsultarDisponible

Code Block
languagepy
themeDJango
titlecurl
linenumberstrue
curl -X POST "http://10.5.1.31:8103/rest/acreditaciones/ejecutardisponible" \
-H "API-KEY: BMMyeLpIomvnnGwmN8IOydFCON4AQelKTIY4C44Fljg8AjFled" \
-H "Content-Type: application/json" \
-d '{
  "acreditacion": {
    "usuario": "test1",
    "idAcreditacion": 274
  }
}'
Este documento proporciona una guía completa para la integración y uso de la API de Dimo Empresa. Asegúrate de seguir las mejores prácticas de seguridad y yo me comprometo a mantener actualizada la documentación para reflejar cualquier cambio en la API.



Cabal Paraguay Ltda.
Caballero 728, Asunción Paraguay.

Versión de la doc: v1.0.

0

1.0
Autor: Arturo Sosa Bagnoli
asosa@cabal.com.py - 0971-159618