Overview
The Communications API handles formal communications, transmittals, and document exchange between parties. This is commonly used for RFIs (Requests for Information), memos, and formal document transmittals.
Authentication
All API requests require Django session authentication. See Authentication for details.
Endpoints
Create Transmittal
Create a new transmittal communication.
Endpoint: POST /comunicaciones/api/create-transmittal/
Type of communication (RFI, MEMO, etc.)
Array of recipient user IDs
Array of document IDs to attach
Array of asset IDs to reference
Example Request:
fetch ( '/comunicaciones/api/create-transmittal/' , {
method: 'POST' ,
headers: {
'Content-Type' : 'application/json' ,
'X-CSRFToken' : csrfToken
},
body: JSON . stringify ({
tipo_id: 1 , // RFI type
asunto: "Request for Information - Equipment Specifications" ,
cuerpo: "Please provide technical specifications for the cooling tower." ,
destinatarios: [ 5 , 12 ], // User IDs
documentos: [ 45 , 67 ], // Document IDs
activos: [ 100 ] // Asset IDs
})
});
Response:
Auto-generated consecutive number (e.g., “RFI-2025-0001”)
Status: BORRADOR or ENVIADO
Send timestamp (null if draft)
{
"id" : 123 ,
"consecutivo" : "RFI-2025-0001" ,
"estado" : "ENVIADO" ,
"fecha_envio" : "2025-03-06T10:30:00Z"
}
List Transmittals
View transmittals (sent and received).
Endpoint: GET /comunicaciones/transmittals/
Query Parameters:
Filter by communication type code
Filter by status (BORRADOR, ENVIADO)
Response:
Returns HTML page with transmittal list.
Transmittal Detail
View complete transmittal details including attachments and recipients.
Endpoint: GET /comunicaciones/transmittals/<comunicado_id>/
Response:
Returns HTML page with:
Transmittal header (consecutive, subject, sender, date)
Message body
Attached documents
Referenced assets
Recipient list with read status
Reply thread
Data Models
Comunicado (Transmittal)
class Comunicado ( models . Model ):
ESTADOS = (
( 'BORRADOR' , 'Borrador' ),
( 'ENVIADO' , 'Enviado' ),
)
tipo = models.ForeignKey( 'TipoComunicado' , on_delete = models. PROTECT )
consecutivo = models.CharField( max_length = 50 , unique = True )
asunto = models.CharField( max_length = 255 )
cuerpo = models.TextField()
remitente = models.ForeignKey(User, on_delete = models. PROTECT )
fecha_envio = models.DateTimeField( blank = True , null = True )
estado = models.CharField( max_length = 20 , choices = ESTADOS )
# Reply threading
parent = models.ForeignKey( 'self' , on_delete = models. PROTECT ,
null = True , blank = True )
Destinatario (Recipient)
class Destinatario ( models . Model ):
comunicado = models.ForeignKey( 'Comunicado' , on_delete = models. CASCADE )
usuario = models.ForeignKey(User, on_delete = models. CASCADE )
tipo = models.CharField( max_length = 10 ) # TO, CC, BCC
# Read tracking
leido = models.BooleanField( default = False )
fecha_lectura = models.DateTimeField( blank = True , null = True )
AdjuntoComunicado (Attachment)
class AdjuntoComunicado ( models . Model ):
comunicado = models.ForeignKey( 'Comunicado' , on_delete = models. CASCADE )
# Can attach documents or assets
documento = models.ForeignKey( 'documentos.Documento' ,
on_delete = models. CASCADE ,
null = True , blank = True )
activo = models.ForeignKey( 'activos.Activo' ,
on_delete = models. CASCADE ,
null = True , blank = True )
archivo = models.FileField( upload_to = 'comunicados/' ,
blank = True , null = True )
Transmittal Workflow
Create Draft
User creates transmittal in draft state
Add Recipients
Specify TO, CC, and BCC recipients
Attach Documents
Link existing documents or upload new files
Send
Change status to ENVIADO, assigns consecutive number
Track Reads
System tracks when recipients view the transmittal
Reply Thread
Recipients can reply, creating threaded conversations
Use Cases
RFI Management Formal requests for information with response tracking
Document Transmittals Formal transmission of technical documents
Memos Internal communications and announcements
Change Notices Notification of changes or updates
Documents Attach documentation
Assets Reference equipment
Projects Link to project communications