List Credentials
Retrieve credentials filtered by type, department, or unit.
Endpoint
Query Parameters
Filter by credential type ID
Response
Unique credential identifier
Username/account identifier
Password (may be encrypted or masked)
Additional notes about this credential
Creation timestamp (ISO 8601)
Last update timestamp (ISO 8601)
Success message: “Cuentas registradas”
Example Request
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
Request Body
Username or account identifier. Cannot be empty.
Password or access key for the credential
ID of the credential type
ID of the department this credential is associated with
ID of the unit this credential belongs to
Additional notes or description
Response
No data returned on success
Success message: “Cuenta registrada”
Example Request
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
Path Parameters
Request Body
Same structure as Create Credential endpoint.
Username or account identifier
Response
Success message: “Cuenta actualizada”
Example Request
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
Response
Success message: “Cuenta eliminada”
Example Request
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
Response
List of credential types with id and nombre (name) fields
Success message: “Tipos de cuentas”
Example Request
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
Request Body
Name of the credential type. Cannot be empty.
Response
Success message: “Tipo registrado”
Example Request
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
Credential type ID to update
Request Body
New name for the credential type
Response
Success message: “Tipo actualizado”
Example Request
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
Credential type ID to delete
Response
Success message: “Tipo eliminado”
Example Request
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.