Skip to main content
POST
/
api
/
ingresoconductorcampana
curl -X POST https://api.example.com/api/ingresoconductorcampana \
  -H "Content-Type: multipart/form-data" \
  -F "id_usuario=123" \
  -F "id_campana=45" \
  -F "id_vehiculo=78" \
  -F "id_formulario_registro=567" \
  -F "fecha_registro=2026-03-09" \
  -F "documento_QR=@/path/to/qr_document.pdf" \
  -F "imagen_QR=@/path/to/qr_image.png" \
  -F "estado=1" \
  -F "id_ciudad=1" \
  -F "id_pais=1"
{
  "id_usuario": 123,
  "id_campana": 45,
  "id_vehiculo": 78,
  "id_formulario_registro": 567,
  "fecha_registro": "2026-03-09",
  "documento_QR": "documents/qr_campaign45_driver123.pdf",
  "imagen_QR": "media/qr_campaign45_driver123.png",
  "estado": 1,
  "id_ciudad": 1,
  "id_pais": 1
}
This endpoint finalizes a driver’s entry into a campaign after their registration form has been approved. It generates unique QR codes for the driver-campaign relationship, enabling tracking and verification throughout the campaign duration.

Request Body

id_usuario
integer
required
User ID of the driver entering the campaign
id_campana
integer
required
Campaign ID that the driver is joining
id_vehiculo
integer
required
Vehicle ID that will be used in the campaign
id_formulario_registro
integer
default:"1"
Reference to the approved FormularioRegistroCampana ID
fecha_registro
string
required
Registration date in YYYY-MM-DD format
documento_QR
file
required
QR code document file (PDF format)
  • Uploaded to: documents/ directory
  • Contains encoded driver-campaign information
  • Used for official verification and record-keeping
imagen_QR
file
required
QR code image file (PNG, JPG formats)
  • Uploaded to: media/ directory
  • Used for quick scanning and verification
  • Should be scannable by mobile devices
id_ciudad
integer
default:"1"
City ID where the driver operates
id_pais
integer
default:"1"
Country ID where the driver operates
estado
integer
required
Entry status code:
  • 0: Inactive
  • 1: Active
  • 2: Suspended
  • 3: Completed

Response

id_usuario
integer
User ID of the driver
id_campana
integer
Campaign ID the driver has joined
id_vehiculo
integer
Vehicle ID registered for the campaign
id_formulario_registro
integer
Reference to the original registration form
fecha_registro
string
Date of campaign entry (YYYY-MM-DD)
documento_QR
string
URL path to the uploaded QR document
imagen_QR
string
URL path to the uploaded QR image
estado
integer
Current status of the campaign entry
id_ciudad
integer
City ID
id_pais
integer
Country ID
curl -X POST https://api.example.com/api/ingresoconductorcampana \
  -H "Content-Type: multipart/form-data" \
  -F "id_usuario=123" \
  -F "id_campana=45" \
  -F "id_vehiculo=78" \
  -F "id_formulario_registro=567" \
  -F "fecha_registro=2026-03-09" \
  -F "documento_QR=@/path/to/qr_document.pdf" \
  -F "imagen_QR=@/path/to/qr_image.png" \
  -F "estado=1" \
  -F "id_ciudad=1" \
  -F "id_pais=1"
{
  "id_usuario": 123,
  "id_campana": 45,
  "id_vehiculo": 78,
  "id_formulario_registro": 567,
  "fecha_registro": "2026-03-09",
  "documento_QR": "documents/qr_campaign45_driver123.pdf",
  "imagen_QR": "media/qr_campaign45_driver123.png",
  "estado": 1,
  "id_ciudad": 1,
  "id_pais": 1
}

Campaign Entry Workflow

  1. Prerequisites:
    • Driver must have submitted FormularioRegistroCampana
    • Registration form must be in “aprobado” (approved) status
    • Campaign must be in active registration period
  2. QR Code Generation:
    • System generates unique QR code containing:
      • Driver ID
      • Campaign ID
      • Vehicle ID
      • Registration date
      • Verification token
    • QR code created in two formats:
      • PDF document: Official record with metadata
      • Image: Scannable version for mobile verification
  3. File Upload:
    • documento_QR uploaded to documents/ directory
    • imagen_QR uploaded to media/ directory
    • Files named with convention: qr_campaign{id}_driver{id}.{ext}
  4. Status Activation:
    • Entry is created with status 1 (Active)
    • Driver can now proceed to vehicle verification
    • Driver can start tracking routes once verified
  5. Next Steps:
    • Driver must complete initial VerificacionConductorCampana
    • Driver can then start creating RecorridoRealizado entries
    • QR code used for periodic verification checks

QR Code Usage

  • Initial Verification: Scanned during first vehicle branding verification
  • Route Tracking: Associated with each RecorridoRealizado entry
  • Periodic Checks: Used in VerificacionConductorCampana for ongoing compliance
  • Payment Processing: Linked to driver’s earnings calculations
  • Campaign Analytics: Tracks individual driver performance

Notes

  • QR code must be unique per driver-campaign combination
  • Image QR should be high resolution (minimum 500x500px) for scanning
  • PDF document QR includes additional metadata not in image version
  • QR codes remain valid throughout campaign duration
  • Status can be updated via separate endpoint to suspend/reactivate drivers
  • One driver can participate in multiple campaigns with different QR codes

Build docs developers (and LLMs) love