Skip to main content

Get Pending Drivers

GET /admin/pending_drivers.php
Retrieve list of drivers pending approval.

Query Parameters

admin_id
integer
required
Administrator ID

Response

success
boolean
Request success status
drivers
array
Array of pending driver profiles

Request Example

cURL
curl -X GET "https://76.13.114.194/admin/pending_drivers.php?admin_id=1" \
  -H "Accept: application/json"

Response Example

Success
{
  "success": true,
  "drivers": [
    {
      "id": 25,
      "nombre_completo": "Juan Carlos Martínez",
      "email": "[email protected]",
      "telefono": "+573109876543",
      "fecha_solicitud": "2024-03-10T14:30:00.000Z",
      "licencia": {
        "numero": "12345678",
        "tipo": "C1",
        "fecha_expiracion": "2030-05-15T00:00:00.000Z"
      },
      "vehiculo": {
        "marca": "Yamaha",
        "modelo": "FZ-16",
        "placa": "ABC123",
        "tipo": "moto"
      },
      "aprobado": false
    }
  ]
}

Approve Driver

POST /admin/aprobar_conductor.php
Approve a driver to start accepting trips.

Request Body

conductor_id
integer
required
Driver ID to approve

Response

success
boolean
Approval success status
message
string
Confirmation message

Request Example

curl -X POST https://76.13.114.194/admin/aprobar_conductor.php \
  -H "Content-Type: application/json" \
  -d '{"conductor_id": 25}'

Response Example

Success
{
  "success": true,
  "message": "Conductor aprobado exitosamente"
}

Reject Driver

POST /admin/rechazar_conductor.php
Reject a driver application with a reason.

Request Body

conductor_id
integer
required
Driver ID to reject
motivo
string
required
Rejection reasonCommon reasons:
  • Licencia de conducción vencida
  • Documentos del vehículo incompletos
  • SOAT vencido
  • Tecnomecánica vencida
  • Información inconsistente
  • Vehículo no cumple requisitos

Response

success
boolean
Rejection success status
message
string
Confirmation message

Request Example

curl -X POST https://76.13.114.194/admin/rechazar_conductor.php \
  -H "Content-Type: application/json" \
  -d '{
    "conductor_id": 25,
    "motivo": "Licencia de conducción vencida"
  }'

Response Example

Success
{
  "success": true,
  "message": "Conductor rechazado"
}
When a driver is rejected, they receive a notification with the rejection reason and can resubmit after addressing the issues.

Driver Verification Checklist

Administrators should verify the following before approving a driver:
1

Personal Information

  • Full name matches ID
  • Valid phone number
  • Valid email address
2

Driver's License

  • License number is valid
  • License type matches vehicle type
  • Not expired (check fecha_expiracion)
  • Clear photos of both sides
3

Vehicle Documents

  • SOAT (insurance) is valid and not expired
  • Tecnomecánica (inspection) is current
  • Tarjeta de propiedad (ownership card) is valid
  • License plate matches documents
4

Vehicle Information

  • Make, model, year are correct
  • Vehicle type is appropriate for service
  • Color matches photos
  • Vehicle is in good condition (check photos)
5

Background Check

  • No previous violations or complaints
  • Clean driving record (if available)
  • Company affiliation verified (if applicable)

Document Expiration Checks

class DriverVerification {
  bool isLicenseValid(DateTime? expirationDate) {
    if (expirationDate == null) return false;
    return DateTime.now().isBefore(expirationDate);
  }
  
  bool isSOATValid(DateTime? expirationDate) {
    if (expirationDate == null) return false;
    return DateTime.now().isBefore(expirationDate);
  }
  
  bool isTecnomecanicaValid(DateTime? expirationDate) {
    if (expirationDate == null) return false;
    return DateTime.now().isBefore(expirationDate);
  }
  
  List<String> getVerificationIssues(ConductorProfile profile) {
    final issues = <String>[];
    
    if (!isLicenseValid(profile.license?.fechaExpiracion)) {
      issues.add('Licencia de conducción vencida o no proporcionada');
    }
    
    if (!isSOATValid(profile.vehicle?.soatVencimiento)) {
      issues.add('SOAT vencido o no proporcionado');
    }
    
    if (!isTecnomecanicaValid(profile.vehicle?.tecnomecanicaVencimiento)) {
      issues.add('Tecnomecánica vencida o no proporcionada');
    }
    
    if (profile.vehicle?.placa == null || profile.vehicle!.placa.isEmpty) {
      issues.add('Placa del vehículo no proporcionada');
    }
    
    return issues;
  }
  
  bool canApprove(ConductorProfile profile) {
    return getVerificationIssues(profile).isEmpty;
  }
}

Bulk Operations

For bulk approval or rejection of drivers, consider implementing a batch processing endpoint in future versions.

Error Responses

400
Bad Request
Invalid driver ID or missing rejection reason
403
Forbidden
Insufficient admin privileges
404
Not Found
Driver not found
500
Internal Server Error
Server error during approval/rejection

See Also

Build docs developers (and LLMs) love