Skip to main content

List Credentials

Retrieve credentials filtered by type, department, or unit.

Endpoint

GET /credenciales

Query Parameters

idTipo
integer
Filter by credential type ID
idDepartamento
integer
Filter by department ID
idUnidad
integer
Filter by unit ID

Response

data
array
message
string
Success message: “Cuentas registradas”

Example Request

cURL
curl -X GET "http://localhost:8081/comialex/api/integra/credenciales?idDepartamento=5&idUnidad=3" \
  -H "Authorization: Bearer YOUR_JWT_TOKEN"

Example Response

{
  "data": [
    {
      "id": 42,
      "tipoId": 1,
      "tipoNombre": "Email Corporativo",
      "departamentoId": 5,
      "departamentoNombre": "Tecnología",
      "unidadId": 3,
      "unidadClave": "TI-001",
      "unidadNombreCompleto": "Tecnología - Desarrollo",
      "usuario": "[email protected]",
      "clave": "********",
      "nota": "Cuenta principal de desarrollo",
      "creado": "2025-01-15T10:30:00",
      "actualizado": "2025-02-20T14:45:00"
    }
  ],
  "message": "Cuentas registradas",
  "success": true
}

Create Credential

Register a new credential account.

Endpoint

POST /credenciales

Request Body

usuario
string
required
Username or account identifier. Cannot be empty.
clave
string
Password or access key for the credential
idTipoCuenta
integer
required
ID of the credential type
idDepartamento
integer
required
ID of the department this credential is associated with
idUnidad
integer
required
ID of the unit this credential belongs to
nota
string
Additional notes or description

Response

data
null
No data returned on success
message
string
Success message: “Cuenta registrada”

Example Request

cURL
curl -X POST http://localhost:8081/comialex/api/integra/credenciales \
  -H "Authorization: Bearer YOUR_JWT_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "usuario": "[email protected]",
    "clave": "SecurePass123!",
    "idTipoCuenta": 1,
    "idDepartamento": 5,
    "idUnidad": 3,
    "nota": "Cuenta principal de desarrollo"
  }'

Example Response

{
  "data": null,
  "message": "Cuenta registrada",
  "success": true
}

Update Credential

Update an existing credential.

Endpoint

PUT /credenciales/{id}

Path Parameters

id
integer
required
Credential ID to update

Request Body

Same structure as Create Credential endpoint.
usuario
string
required
Username or account identifier
clave
string
Password or access key
idTipoCuenta
integer
required
Credential type ID
idDepartamento
integer
required
Department ID
idUnidad
integer
required
Unit ID
nota
string
Additional notes

Response

message
string
Success message: “Cuenta actualizada”

Example Request

cURL
curl -X PUT http://localhost:8081/comialex/api/integra/credenciales/42 \
  -H "Authorization: Bearer YOUR_JWT_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "usuario": "[email protected]",
    "clave": "NewSecurePass456!",
    "idTipoCuenta": 1,
    "idDepartamento": 5,
    "idUnidad": 3,
    "nota": "Password actualizado"
  }'

Delete Credential

Delete a credential account.

Endpoint

DELETE /credenciales/{id}

Path Parameters

id
integer
required
Credential ID to delete

Response

message
string
Success message: “Cuenta eliminada”

Example Request

cURL
curl -X DELETE http://localhost:8081/comialex/api/integra/credenciales/42 \
  -H "Authorization: Bearer YOUR_JWT_TOKEN"

List Credential Types

Retrieve all available credential types.

Endpoint

GET /credenciales/tipos

Response

data
array
List of credential types with id and nombre (name) fields
message
string
Success message: “Tipos de cuentas”

Example Request

cURL
curl -X GET http://localhost:8081/comialex/api/integra/credenciales/tipos \
  -H "Authorization: Bearer YOUR_JWT_TOKEN"

Example Response

{
  "data": [
    {
      "id": 1,
      "nombre": "Email Corporativo"
    },
    {
      "id": 2,
      "nombre": "VPN"
    },
    {
      "id": 3,
      "nombre": "ERP"
    }
  ],
  "message": "Tipos de cuentas",
  "success": true
}

Create Credential Type

Register a new credential type.

Endpoint

POST /credenciales/tipo

Request Body

nombre
string
required
Name of the credential type. Cannot be empty.

Response

message
string
Success message: “Tipo registrado”

Example Request

cURL
curl -X POST http://localhost:8081/comialex/api/integra/credenciales/tipo \
  -H "Authorization: Bearer YOUR_JWT_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "nombre": "Sistema CRM"
  }'

Update Credential Type

Update an existing credential type.

Endpoint

PUT /credenciales/tipo/{id}

Path Parameters

id
integer
required
Credential type ID to update

Request Body

nombre
string
required
New name for the credential type

Response

message
string
Success message: “Tipo actualizado”

Example Request

cURL
curl -X PUT http://localhost:8081/comialex/api/integra/credenciales/tipo/4 \
  -H "Authorization: Bearer YOUR_JWT_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "nombre": "Sistema CRM v2"
  }'

Delete Credential Type

Delete a credential type.

Endpoint

DELETE /credenciales/tipo/{id}

Path Parameters

id
integer
required
Credential type ID to delete

Response

message
string
Success message: “Tipo eliminado”

Example Request

cURL
curl -X DELETE http://localhost:8081/comialex/api/integra/credenciales/tipo/4 \
  -H "Authorization: Bearer YOUR_JWT_TOKEN"
Deleting a credential type may affect existing credentials that reference this type. Ensure no credentials are using this type before deletion.

Build docs developers (and LLMs) love