feat: exponer endpoint get_modules_list para autodetección desde el plugin portal unificado
This commit is contained in:
parent
983c0dbcd9
commit
a7aff82a81
165
.agent/scripts/gen_index_ucrm_apib.php
Executable file
165
.agent/scripts/gen_index_ucrm_apib.php
Executable file
@ -0,0 +1,165 @@
|
||||
<?php
|
||||
/**
|
||||
* Generador de Índice Comprimido para unmscrm.apib (API Blueprint UCRM)
|
||||
*
|
||||
* USO: php gen_index_ucrm_apib.php
|
||||
* SALIDA: INDEX_api_ucrm.md en la raíz del plugin
|
||||
*
|
||||
* Reduce ~266KB (65K tokens) → ~10KB (2-3K tokens)
|
||||
*/
|
||||
|
||||
$apibPath = __DIR__ . '/../references/unmscrm.apib';
|
||||
$outputPath = __DIR__ . '/../../INDEX_api_ucrm.md';
|
||||
|
||||
if (!file_exists($apibPath)) {
|
||||
die("ERROR: No se encontró unmscrm.apib en: $apibPath\n");
|
||||
}
|
||||
|
||||
echo "Leyendo unmscrm.apib (" . round(filesize($apibPath) / 1024, 1) . " KB)...\n";
|
||||
|
||||
$content = file_get_contents($apibPath);
|
||||
$lines = explode("\n", $content);
|
||||
|
||||
$groups = [];
|
||||
$current_group = 'General';
|
||||
$current_resource = '';
|
||||
|
||||
foreach ($lines as $line) {
|
||||
$line = rtrim($line);
|
||||
|
||||
// Grupo: "# Group Clients"
|
||||
if (preg_match('/^#\s+Group\s+(.+)$/i', $line, $m)) {
|
||||
$current_group = trim($m[1]);
|
||||
if (!isset($groups[$current_group])) {
|
||||
$groups[$current_group] = [];
|
||||
}
|
||||
continue;
|
||||
}
|
||||
|
||||
// Recurso nivel 1: "# /clients{?param1,param2}" — solo si empieza con /
|
||||
if (preg_match('/^#\s+(\/[^\s{]+)/', $line, $m)) {
|
||||
// Limpiar parámetros de query string del path
|
||||
$raw_path = $m[1];
|
||||
$current_resource = preg_replace('/\{[^}]*\}/', '', $raw_path); // quitar {?params}
|
||||
continue;
|
||||
}
|
||||
|
||||
// Recurso nivel 2 con path en brackets: "## Client [/clients/{id}]"
|
||||
if (preg_match('/^##\s+[^[]+\[([^\]]+)\]/', $line, $m)) {
|
||||
$current_resource = trim($m[1]);
|
||||
continue;
|
||||
}
|
||||
|
||||
// Recurso nivel 2 que es un path: "## /clients/{id}"
|
||||
if (preg_match('/^##\s+(\/[^\s{]+)/', $line, $m)) {
|
||||
$current_resource = $m[1];
|
||||
continue;
|
||||
}
|
||||
|
||||
// Método HTTP nivel 2 directo: "## GET" or "## POST"
|
||||
if (preg_match('/^##\s+(GET|POST|PUT|PATCH|DELETE|HEAD|OPTIONS)\s*$/i', $line, $m)) {
|
||||
$method = strtoupper($m[1]);
|
||||
if (!isset($groups[$current_group])) {
|
||||
$groups[$current_group] = [];
|
||||
}
|
||||
$groups[$current_group][] = [
|
||||
'method' => $method,
|
||||
'path' => $current_resource ?: '/',
|
||||
'desc' => '—',
|
||||
];
|
||||
continue;
|
||||
}
|
||||
|
||||
// Método HTTP nivel 3: "### Descripción [METHOD /path]"
|
||||
if (preg_match('/^###\s+(.+)$/i', $line, $m)) {
|
||||
$raw = trim($m[1]);
|
||||
$method = '';
|
||||
$path = $current_resource;
|
||||
$desc = $raw;
|
||||
|
||||
// Formato: "Create Client [POST /clients]"
|
||||
if (preg_match('/\[(GET|POST|PUT|PATCH|DELETE|HEAD|OPTIONS)\s*([^\]]*)\]/i', $raw, $pm)) {
|
||||
$method = strtoupper($pm[1]);
|
||||
$pathInBracket = trim($pm[2]);
|
||||
if ($pathInBracket) $path = $pathInBracket;
|
||||
$desc = trim(preg_replace('/\[.+\]/', '', $raw));
|
||||
}
|
||||
// Formato: "GET /path Description"
|
||||
elseif (preg_match('/^(GET|POST|PUT|PATCH|DELETE|HEAD|OPTIONS)\s+(\S+)\s*(.*)$/i', $raw, $pm)) {
|
||||
$method = strtoupper($pm[1]);
|
||||
$path = $pm[2];
|
||||
$desc = trim($pm[3]) ?: '—';
|
||||
}
|
||||
// Formato: Solo METHOD
|
||||
elseif (preg_match('/^(GET|POST|PUT|PATCH|DELETE|HEAD|OPTIONS)$/i', $raw, $pm)) {
|
||||
$method = strtoupper($pm[1]);
|
||||
$desc = '—';
|
||||
}
|
||||
|
||||
if ($method) {
|
||||
if (!isset($groups[$current_group])) {
|
||||
$groups[$current_group] = [];
|
||||
}
|
||||
$groups[$current_group][] = [
|
||||
'method' => $method,
|
||||
'path' => $path ?: '/',
|
||||
'desc' => $desc ?: '—',
|
||||
];
|
||||
}
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
// Generar Markdown
|
||||
$output_lines = [];
|
||||
$output_lines[] = "# Índice API UCRM — CRM v1.0";
|
||||
$output_lines[] = "";
|
||||
$output_lines[] = "> **Generado automáticamente** desde `unmscrm.apib`";
|
||||
$output_lines[] = "> Ejecutar `php .agent/scripts/gen_index_ucrm_apib.php` para regenerar.";
|
||||
$output_lines[] = "";
|
||||
$output_lines[] = "**Base URL:** `https://{ipserver}/crm/api/v1.0/`";
|
||||
$output_lines[] = "**Auth:** Header `X-Auth-App-Key: {apitoken}`";
|
||||
$output_lines[] = "";
|
||||
$output_lines[] = "---";
|
||||
$output_lines[] = "";
|
||||
$output_lines[] = "## Resumen de Grupos";
|
||||
$output_lines[] = "";
|
||||
|
||||
$total = 0;
|
||||
foreach ($groups as $group => $ops) {
|
||||
$count = count($ops);
|
||||
$total += $count;
|
||||
$output_lines[] = "- **{$group}** ({$count} endpoints)";
|
||||
}
|
||||
$output_lines[] = "";
|
||||
$output_lines[] = "**Total: {$total} endpoints en " . count($groups) . " grupos**";
|
||||
$output_lines[] = "";
|
||||
$output_lines[] = "---";
|
||||
$output_lines[] = "";
|
||||
|
||||
foreach ($groups as $group => $ops) {
|
||||
if (empty($ops)) continue;
|
||||
$output_lines[] = "## {$group}";
|
||||
$output_lines[] = "";
|
||||
foreach ($ops as $op) {
|
||||
$output_lines[] = sprintf(
|
||||
" - %-8s `%s` — %s",
|
||||
$op['method'],
|
||||
$op['path'],
|
||||
$op['desc']
|
||||
);
|
||||
}
|
||||
$output_lines[] = "";
|
||||
}
|
||||
|
||||
$output = implode("\n", $output_lines);
|
||||
file_put_contents($outputPath, $output);
|
||||
|
||||
$sizeKb = round(strlen($output) / 1024, 1);
|
||||
$tokenEst = round(strlen($output) / 4);
|
||||
|
||||
echo "✅ Índice generado: INDEX_api_ucrm.md\n";
|
||||
echo " Tamaño: {$sizeKb} KB (~{$tokenEst} tokens)\n";
|
||||
echo " Reducción: " . round((1 - strlen($output) / filesize($apibPath)) * 100) . "% vs original\n";
|
||||
echo " Grupos: " . count($groups) . "\n";
|
||||
echo " Endpoints: {$total}\n";
|
||||
126
.agent/scripts/gen_index_unms_swagger.php
Executable file
126
.agent/scripts/gen_index_unms_swagger.php
Executable file
@ -0,0 +1,126 @@
|
||||
<?php
|
||||
/**
|
||||
* Generador de Índice Comprimido para unms-swagger.json
|
||||
*
|
||||
* USO: php gen_index_unms_swagger.php
|
||||
* SALIDA: INDEX_api_unms.md en la raíz del plugin
|
||||
*
|
||||
* Reduce ~3MB (750K tokens) → ~15KB (3-4K tokens)
|
||||
*/
|
||||
|
||||
$swaggerPath = __DIR__ . '/../references/unms-swagger.json';
|
||||
$outputPath = __DIR__ . '/../../INDEX_api_unms.md';
|
||||
|
||||
if (!file_exists($swaggerPath)) {
|
||||
die("ERROR: No se encontró unms-swagger.json en: $swaggerPath\n");
|
||||
}
|
||||
|
||||
echo "Leyendo unms-swagger.json (" . round(filesize($swaggerPath) / 1024 / 1024, 2) . " MB)...\n";
|
||||
|
||||
$swagger = json_decode(file_get_contents($swaggerPath), true);
|
||||
|
||||
if (!$swagger) {
|
||||
die("ERROR: No se pudo parsear el JSON. Error: " . json_last_error_msg() . "\n");
|
||||
}
|
||||
|
||||
$paths = $swagger['paths'] ?? [];
|
||||
$info = $swagger['info'] ?? [];
|
||||
$basePath = $swagger['basePath'] ?? '';
|
||||
$host = $swagger['host'] ?? '';
|
||||
|
||||
// Agrupar por tag
|
||||
$grouped = [];
|
||||
$tagDescriptions = [];
|
||||
|
||||
// Recolectar descripciones de tags
|
||||
foreach ($swagger['tags'] ?? [] as $tag) {
|
||||
$tagDescriptions[$tag['name']] = $tag['description'] ?? '';
|
||||
}
|
||||
|
||||
foreach ($paths as $path => $methods) {
|
||||
foreach ($methods as $method => $operation) {
|
||||
if (!in_array(strtoupper($method), ['GET', 'POST', 'PUT', 'PATCH', 'DELETE'])) continue;
|
||||
|
||||
$tags = $operation['tags'] ?? ['sin-tag'];
|
||||
$summary = $operation['summary'] ?? $operation['description'] ?? '—';
|
||||
$opId = $operation['operationId'] ?? '';
|
||||
|
||||
// Extraer parámetros clave (no el body completo)
|
||||
$params = [];
|
||||
foreach ($operation['parameters'] ?? [] as $param) {
|
||||
if (in_array($param['in'], ['path', 'query'])) {
|
||||
$required = ($param['required'] ?? false) ? '' : '?';
|
||||
$params[] = $param['name'] . $required;
|
||||
}
|
||||
}
|
||||
$paramStr = $params ? ' [' . implode(', ', $params) . ']' : '';
|
||||
|
||||
// Códigos de respuesta clave
|
||||
$responses = array_keys($operation['responses'] ?? []);
|
||||
$respStr = $responses ? ' → ' . implode('/', $responses) : '';
|
||||
|
||||
foreach ($tags as $tag) {
|
||||
$grouped[$tag][] = sprintf(
|
||||
" - %-8s `%s`%s — %s%s",
|
||||
strtoupper($method),
|
||||
$path,
|
||||
$paramStr,
|
||||
$summary,
|
||||
$respStr
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
ksort($grouped);
|
||||
|
||||
// Generar Markdown
|
||||
$lines = [];
|
||||
$lines[] = "# Índice API UNMS (UISP) — NMS v2.1";
|
||||
$lines[] = "";
|
||||
$lines[] = "> **Generado automáticamente** desde `unms-swagger.json`";
|
||||
$lines[] = "> Ejecutar `php .agent/scripts/gen_index_unms_swagger.php` para regenerar.";
|
||||
$lines[] = "";
|
||||
$lines[] = "**Host:** `{$host}` **Base Path:** `{$basePath}`";
|
||||
$lines[] = "**Versión API:** " . ($info['version'] ?? 'N/A');
|
||||
$lines[] = "";
|
||||
$lines[] = "---";
|
||||
$lines[] = "";
|
||||
$lines[] = "## Resumen de Grupos";
|
||||
$lines[] = "";
|
||||
|
||||
$total = 0;
|
||||
foreach ($grouped as $tag => $ops) {
|
||||
$count = count($ops);
|
||||
$total += $count;
|
||||
$desc = $tagDescriptions[$tag] ?? '';
|
||||
$lines[] = "- **{$tag}** ({$count} endpoints)" . ($desc ? " — {$desc}" : '');
|
||||
}
|
||||
$lines[] = "";
|
||||
$lines[] = "**Total: {$total} endpoints en " . count($grouped) . " grupos**";
|
||||
$lines[] = "";
|
||||
$lines[] = "---";
|
||||
$lines[] = "";
|
||||
|
||||
// Detalle por grupo
|
||||
foreach ($grouped as $tag => $ops) {
|
||||
$desc = $tagDescriptions[$tag] ?? '';
|
||||
$lines[] = "## {$tag}" . ($desc ? " — _{$desc}_" : '');
|
||||
$lines[] = "";
|
||||
foreach ($ops as $op) {
|
||||
$lines[] = $op;
|
||||
}
|
||||
$lines[] = "";
|
||||
}
|
||||
|
||||
$output = implode("\n", $lines);
|
||||
file_put_contents($outputPath, $output);
|
||||
|
||||
$sizeKb = round(strlen($output) / 1024, 1);
|
||||
$tokenEst = round(strlen($output) / 4);
|
||||
|
||||
echo "✅ Índice generado: INDEX_api_unms.md\n";
|
||||
echo " Tamaño: {$sizeKb} KB (~{$tokenEst} tokens)\n";
|
||||
echo " Reducción: " . round((1 - strlen($output) / filesize($swaggerPath)) * 100) . "% vs swagger original\n";
|
||||
echo " Grupos: " . count($grouped) . "\n";
|
||||
echo " Endpoints: {$total}\n";
|
||||
20
CHANGELOG.md
20
CHANGELOG.md
@ -1,5 +1,25 @@
|
||||
# CHANGELOG - SIIP WhatsApp Notifications Plugin
|
||||
|
||||
## VERSIÓN 4.7.4 - 15-07-2026
|
||||
|
||||
### 🐛 Correcciones (Bug Fixes)
|
||||
1️⃣ **Preservación de Contraseña de Antena Desconectada**: Se implementó una lógica de validación para evitar que el script de auditoría (`audit_client_passwords.php`) y la automatización del plugin sobrescriban una contraseña real y válida que ya esté registrada en UCRM con la leyenda `"Antena desconectada al momento de obtener la contraseña"`. Si el CPE está desconectado pero ya tenía una clave configurada en UCRM, ésta se preserva para que los instaladores puedan consultarla y utilizarla en las órdenes de soporte en sitio.
|
||||
|
||||
## VERSIÓN 4.7.3 - 13-07-2026
|
||||
|
||||
### 🔄 Mejoras (Enhancements)
|
||||
1️⃣ **Sincronización Inmediata en CallBell**: Se implementó el refresco en tiempo real del objeto de notificación `$notification->clientData` antes de llamar a `verifyClientActionToDo()`, garantizando que la contraseña corregida y el nuevo Site/Antena se actualicen en CallBell inmediatamente en el mismo webhook.
|
||||
2️⃣ **Robustez y Detección de Etiquetas**: Se actualizó la lógica en `client.edit` de `Plugin.php` para buscar las etiquetas (`OBTENER PASSWORD ANTENA`, etc.) directamente en `$notification->clientData['tags']`, haciendo que funcione correctamente con la estructura de webhooks de producción de UCRM que no contienen `extraData`.
|
||||
3️⃣ **Integración del Logger del Plugin**: Se mejoró el script de auditoría de contraseñas (`audit_client_passwords.php`) para registrar sus mensajes de progreso y excepciones de la API de UISP directamente en el log principal de UCRM (`data/plugin.log`) en lugar de enmascararlos en un log local.
|
||||
4️⃣ **Prevención de Sobrescritura de Red**: Se agregaron salvaguardas en `audit_client_passwords.php` y `ejemplo_script_actualizador.php` para evitar que fallos de conexión o respuestas parciales de la API de UISP sobrescriban el Site con `"Sin SITE"` o la Antena con `"REPETIDOR"` si el CRM ya tiene información sectorial válida.
|
||||
5️⃣ **Resolución Inteligente de Torres (AP Fallback)**: Se implementó un fallback que consulta el Site del AP Device al que está conectado inalámbricamente la antena si el Sitio del Cliente no tiene configurada la jerarquía Padre-Hijo en UISP, logrando sincronizar la Torre de manera automática en el CRM.
|
||||
|
||||
|
||||
## VERSIÓN 4.7.2 - 10-06-2026
|
||||
|
||||
### 🔄 Mejoras (Enhancements)
|
||||
1️⃣ **Ordenamiento de Tareas de Instaladores**: Se implementó el ordenamiento descendente (de más reciente a más antiguo) por fecha en la consulta de tareas/tickets activos del instalador, permitiendo al administrador ver primero los trabajos más recientes asignados.
|
||||
|
||||
## VERSIÓN 4.7.1 - 05-06-2026
|
||||
|
||||
### 🐛 Correcciones (Bug Fixes)
|
||||
|
||||
@ -1,88 +0,0 @@
|
||||
📢 Buenos días equipo, Mega Actualización del Plugin Notificaciones y Pagos WhatsApp SIIP 🚀 *Versiones 3.0.0 hasta 4.3.0*
|
||||
|
||||
Se ha completado una de las actualizaciones tecnológicas más grandes e importantes en la historia del sistema central de notificaciones y cobranza. Aquí se detallan todos los cambios monumentales:
|
||||
|
||||
━━━━━━━━━━━━━━━━━━━━━━
|
||||
|
||||
💻 *1. El Nuevo Portal Administrativo SIIP*
|
||||
|
||||
Se integró un portal web completo y dedicado directamente dentro del CRM. Este portal centraliza toda la operación en 4 módulos principales:
|
||||
|
||||
• 👷♂️ *Módulo de Instaladores*: Permite gestionar y vincular a los técnicos e instaladores de la empresa para el enrutamiento de notificaciones.
|
||||
• ✉️ *Módulo de Notificaciones y Comprobantes*: Brinda un historial de los pagos de cada cliente, con la función (altamente solicitada) para **reenviar manualmente los comprobantes de pago** por WhatsApp con un solo clic.
|
||||
• 💳 *Módulo de Cobranza con Tarjetas (Stripe)*: Permite realizar cargos a tarjetas de crédito/débito en tiempo real o generar enlaces de pago, además de visualizar el historial financiero de los clientes.
|
||||
• 🏪 *Módulo de Cobranza en Efectivo (Oxxo)*: Desde aquí se generan referencias de Oxxo Pay al instante para que el cliente pague en tienda, llevando un control exacto de las referencias emitidas.
|
||||
|
||||
━━━━━━━━━━━━━━━━━━━━━━
|
||||
|
||||
🤖 *2. El Nuevo Cerebro de WhatsApp (Callbell)*
|
||||
|
||||
• 📱 *Nuevo Bot de Callbell*: Se migró toda la operación a un nuevo bot construido desde cero. Esto permite un envío de mensajes más estable y con mucha mayor capacidad de respuesta.
|
||||
• ⚡ *Multiservicio*: Soporte ampliado para procesar múltiples servicios simultáneos sin cuellos de botella.
|
||||
|
||||
━━━━━━━━━━━━━━━━━━━━━━
|
||||
|
||||
🧾 *3. La Revolución de Oxxo Pay y Comprobantes*
|
||||
|
||||
• 🛒 *Flujo por Órdenes y Base de Datos*: Se cambió la forma en que el sistema de Oxxo Pay funciona. Ahora trabaja bajo un sistema de órdenes respaldado por base de datos, ¡eliminando por fin los fallos y cobros no reflejados por *timeout*!
|
||||
• 🏭 *Nuevos Microservicios Dedicados*: Se extrajo la carga de trabajo pesada a un nuevo microservicio.
|
||||
→ Ahora este se encarga de generar los vouchers de Oxxo y los comprobantes de pago.
|
||||
→ Realiza el recorte automático (cropping) preciso de las imágenes.
|
||||
→ Inserta dinámicamente el *nombre del cliente* en la imagen ("overlay"), dejándolos listos para enviar.
|
||||
|
||||
━━━━━━━━━━━━━━━━━━━━━━
|
||||
|
||||
☁️ *4. MinIO: La Nueva Nube Privada (Estilo AWS)*
|
||||
|
||||
• 🚀 *Adiós al FTP de WordPress*: Se ha dejado de depender de cargas lentas e inseguras por FTP hacia WordPress.
|
||||
• 📦 *Almacenamiento MinIO*: Se implementó un sistema de almacenamiento de objetos idéntico a Amazon Web Services S3. Ahora todos los vouchers, comprobantes y PDFs se guardan de forma instantánea, segura y generan enlaces públicos a la velocidad de la luz.
|
||||
|
||||
━━━━━━━━━━━━━━━━━━━━━━
|
||||
|
||||
🎨 *5. Interfaz Gráfica y Experiencia (UI/UX)*
|
||||
|
||||
• 💎 *Diseño Premium (Glassmorphism)*: Renovación visual completa usando estética de cristal moderno en el nuevo Portal Administrativo.
|
||||
• 🔐 *Sistema de Login Seguro*: Ya no cualquiera puede entrar; ahora el portal valida la sesión de manera segura directo con el core de UCRM (al igual que el Hub de Herramientas de Pagos).
|
||||
• 👁️ *Vouchers Inline*: Ahora se pueden visualizar los vouchers generados directamente dentro de la interfaz del portal sin tener que descargarlos previamente.
|
||||
• 🌙 *Modo Oscuro*: El portal ahora respeta la vista con un modo oscuro elegante y funcional para todo el equipo.
|
||||
|
||||
━━━━━━━━━━━━━━━━━━━━━━
|
||||
|
||||
📦 *Historial de Versiones Resumido (Desde v2.9.2)*
|
||||
|
||||
*v4.3.0* (Actual)
|
||||
→ Sistema de Login con validación UCRM y Rediseño Premium Glassmorphism UI.
|
||||
|
||||
*v4.1.0*
|
||||
→ Integración de Microservicio PDF y MinIO, Auto-recorte de comprobantes y textos dinámicos sobre imagen.
|
||||
|
||||
*v4.0.0*
|
||||
→ Re-diseño UI con Nuevo Portal, integración Stripe (SPEI/OXXO), visualización inline y Optimización de seguridad FTP/Nube.
|
||||
|
||||
*v3.1.0*
|
||||
→ Módulos Administrativos y Re-envío manual de notificaciones de pago.
|
||||
|
||||
*v3.0.0*
|
||||
→ Soporte multiservicios y optimizaciones pesadas de rendimiento backend.
|
||||
|
||||
━━━━━━━━━━━━━━━━━━━━━━
|
||||
|
||||
🚀 *Cómo Acceder*
|
||||
|
||||
Al igual que siempre, lo encuentran integrado en el CRM en:
|
||||
*Reportes → Portal Administrativo de Pagos de STRIPE y Notificaciones WhatsApp*.
|
||||
|
||||
━━━━━━━━━━━━━━━━━━━━━━
|
||||
|
||||
📝 *Notas Finales*
|
||||
|
||||
Esta no es solo una actualización visual, se cambió por completo el *motor interno* del plugin. Ahora el sistema opera con arquitectura de microservicios, cuenta con un portal administrativo completo y usa nubes privadas (MinIO) de nivel empresarial. Los fallos de timeout al cruzar cobros con Oxxo y las lentitudes de subir archivos por FTP pasaron a la historia.
|
||||
|
||||
Cualquier duda, favor de reportarla de inmediato para revisión.
|
||||
|
||||
*¡A sacarle provecho!* 💪
|
||||
|
||||
━━━━━━━━━━━━━━━━━━━━━━
|
||||
|
||||
_Desarrollado con ❤️ por SIIP Internet_
|
||||
_Versión 4.3.0 - Marzo 2026_
|
||||
388
INDEX_api_ucrm.md
Executable file
388
INDEX_api_ucrm.md
Executable file
@ -0,0 +1,388 @@
|
||||
# Índice API UCRM — CRM v1.0
|
||||
|
||||
> **Generado automáticamente** desde `unmscrm.apib`
|
||||
> Ejecutar `php .agent/scripts/gen_index_ucrm_apib.php` para regenerar.
|
||||
|
||||
**Base URL:** `https://{ipserver}/crm/api/v1.0/`
|
||||
**Auth:** Header `X-Auth-App-Key: {apitoken}`
|
||||
|
||||
---
|
||||
|
||||
## Resumen de Grupos
|
||||
|
||||
- **Clients** (4 endpoints)
|
||||
- **Client Bank Accounts** (5 endpoints)
|
||||
- **Client Contacts** (5 endpoints)
|
||||
- **Client Logs** (4 endpoints)
|
||||
- **Client Tags** (5 endpoints)
|
||||
- **Credit Note Templates** (0 endpoints)
|
||||
- **Credit Notes** (3 endpoints)
|
||||
- **Custom Attributes** (5 endpoints)
|
||||
- **Document Templates** (0 endpoints)
|
||||
- **Documents** (5 endpoints)
|
||||
- **Geocoding** (2 endpoints)
|
||||
- **Email** (0 endpoints)
|
||||
- **Fees** (2 endpoints)
|
||||
- **Invoice Templates** (0 endpoints)
|
||||
- **Invoices** (3 endpoints)
|
||||
- **Invoice Items** (4 endpoints)
|
||||
- **Job Attachments** (3 endpoints)
|
||||
- **Job Comments** (3 endpoints)
|
||||
- **Job Tasks** (3 endpoints)
|
||||
- **Jobs** (3 endpoints)
|
||||
- **Organizations** (0 endpoints)
|
||||
- **Payment Methods** (5 endpoints)
|
||||
- **Payment Plans** (4 endpoints)
|
||||
- **Payments** (3 endpoints)
|
||||
- **Payment Tokens** (0 endpoints)
|
||||
- **Credit Cards** (3 endpoints)
|
||||
- **Permission Groups** (0 endpoints)
|
||||
- **Products** (10 endpoints)
|
||||
- **Proforma Invoice Templates** (0 endpoints)
|
||||
- **Quote Templates** (0 endpoints)
|
||||
- **Quotes** (2 endpoints)
|
||||
- **Refund** (0 endpoints)
|
||||
- **Service Plans** (6 endpoints)
|
||||
- **Service Plan Groups** (3 endpoints)
|
||||
- **Service Surcharges** (5 endpoints)
|
||||
- **Service Suspension** (5 endpoints)
|
||||
- **Service UISP Location** (2 endpoints)
|
||||
- **Services** (10 endpoints)
|
||||
- **Service Change Requests** (2 endpoints)
|
||||
- **Prepaid Service Periods** (2 endpoints)
|
||||
- **Surcharges** (5 endpoints)
|
||||
- **Taxes** (4 endpoints)
|
||||
- **Tickets** (3 endpoints)
|
||||
- **Ticket Activity** (0 endpoints)
|
||||
- **Ticket Comment Attachments** (0 endpoints)
|
||||
- **Ticket Comments** (0 endpoints)
|
||||
- **Ticket Groups** (5 endpoints)
|
||||
- **Ticket Tags** (5 endpoints)
|
||||
- **Users** (0 endpoints)
|
||||
- **Webhook Events** (0 endpoints)
|
||||
- **General** (0 endpoints)
|
||||
- **Mobile** (0 endpoints)
|
||||
- **Client Zone Credit Cards** (3 endpoints)
|
||||
- **Client Zone Dashboard** (0 endpoints)
|
||||
- **Client Zone Invoices** (1 endpoints)
|
||||
- **Client Zone Payments** (1 endpoints)
|
||||
- **Client Zone Quotes** (1 endpoints)
|
||||
- **Client Zone Services** (1 endpoints)
|
||||
- **Client Zone Service Plans** (3 endpoints)
|
||||
- **Client Zone Tickets** (2 endpoints)
|
||||
- **Client Zone Tickets Activities** (1 endpoints)
|
||||
- **Client Zone Tickets Comments** (2 endpoints)
|
||||
- **Client Zone Tickets Comments Attachments** (1 endpoints)
|
||||
- **Client Zone Authentication** (0 endpoints)
|
||||
- **Client Zone Client** (0 endpoints)
|
||||
- **Client Zone Service Change Requests** (2 endpoints)
|
||||
- **Client Zone Prepaid Service Periods** (1 endpoints)
|
||||
- **Client Zone Overview** (0 endpoints)
|
||||
- **Client Zone Login Token** (0 endpoints)
|
||||
|
||||
**Total: 162 endpoints en 69 grupos**
|
||||
|
||||
---
|
||||
|
||||
## Clients
|
||||
|
||||
- GET `/clients` — —
|
||||
- GET `/clients/` — —
|
||||
- PATCH `/clients/` — —
|
||||
- POST `/clients/authenticated` — —
|
||||
|
||||
## Client Bank Accounts
|
||||
|
||||
- GET `/clients/bank-accounts/` — —
|
||||
- PATCH `/clients/bank-accounts/` — —
|
||||
- DELETE `/clients/bank-accounts/` — —
|
||||
- GET `/clients/` — —
|
||||
- POST `/clients/` — —
|
||||
|
||||
## Client Contacts
|
||||
|
||||
- GET `/clients/contacts/` — —
|
||||
- PATCH `/clients/contacts/` — —
|
||||
- DELETE `/clients/contacts/` — —
|
||||
- GET `/clients/` — —
|
||||
- POST `/clients/` — —
|
||||
|
||||
## Client Logs
|
||||
|
||||
- GET `/client-logs` — —
|
||||
- GET `/client-logs` — —
|
||||
- PATCH `/client-logs` — —
|
||||
- DELETE `/client-logs` — —
|
||||
|
||||
## Client Tags
|
||||
|
||||
- GET `/client-tags` — —
|
||||
- POST `/client-tags` — —
|
||||
- PATCH `/client-tags` — —
|
||||
- GET `/client-tags` — —
|
||||
- DELETE `/client-tags` — —
|
||||
|
||||
## Credit Notes
|
||||
|
||||
- GET `/credit-notes/` — —
|
||||
- PATCH `/credit-notes/` — —
|
||||
- DELETE `/credit-notes/` — —
|
||||
|
||||
## Custom Attributes
|
||||
|
||||
- GET `/custom-attributes` — —
|
||||
- POST `/custom-attributes` — —
|
||||
- GET `/custom-attributes` — —
|
||||
- PATCH `/custom-attributes` — —
|
||||
- DELETE `/custom-attributes` — —
|
||||
|
||||
## Documents
|
||||
|
||||
- GET `/documents` — —
|
||||
- POST `/documents` — —
|
||||
- GET `/documents` — —
|
||||
- DELETE `/documents` — —
|
||||
- GET `/documents` — —
|
||||
|
||||
## Geocoding
|
||||
|
||||
- GET `/geocode` — —
|
||||
- GET `/geocode/suggest` — —
|
||||
|
||||
## Fees
|
||||
|
||||
- GET `/geocode/suggest` — —
|
||||
- DELETE `/geocode/suggest` — —
|
||||
|
||||
## Invoices
|
||||
|
||||
- GET `/invoices/` — —
|
||||
- PATCH `/invoices/` — —
|
||||
- DELETE `/invoices/` — —
|
||||
|
||||
## Invoice Items
|
||||
|
||||
- GET `/invoices/items/` — —
|
||||
- PATCH `/invoices/items/` — —
|
||||
- DELETE `/invoices/items/` — —
|
||||
- GET `/invoices/` — —
|
||||
|
||||
## Job Attachments
|
||||
|
||||
- GET `/scheduling/jobs/attachments/` — —
|
||||
- PATCH `/scheduling/jobs/attachments/` — —
|
||||
- DELETE `/scheduling/jobs/attachments/` — —
|
||||
|
||||
## Job Comments
|
||||
|
||||
- GET `/scheduling/jobs/comments/` — —
|
||||
- PATCH `/scheduling/jobs/comments/` — —
|
||||
- DELETE `/scheduling/jobs/comments/` — —
|
||||
|
||||
## Job Tasks
|
||||
|
||||
- GET `/scheduling/jobs/tasks/` — —
|
||||
- PATCH `/scheduling/jobs/tasks/` — —
|
||||
- DELETE `/scheduling/jobs/tasks/` — —
|
||||
|
||||
## Jobs
|
||||
|
||||
- GET `/scheduling/jobs/` — —
|
||||
- PATCH `/scheduling/jobs/` — —
|
||||
- DELETE `/scheduling/jobs/` — —
|
||||
|
||||
## Payment Methods
|
||||
|
||||
- GET `/payment-methods` — —
|
||||
- POST `/payment-methods` — —
|
||||
- GET `/payment-methods/` — —
|
||||
- PATCH `/payment-methods/` — —
|
||||
- DELETE `/payment-methods/` — —
|
||||
|
||||
## Payment Plans
|
||||
|
||||
- GET `/payment-plans` — —
|
||||
- POST `/payment-plans` — —
|
||||
- GET `/payment-plans/` — —
|
||||
- PATCH `/payment-plans/` — —
|
||||
|
||||
## Payments
|
||||
|
||||
- GET `/payments/` — —
|
||||
- DELETE `/payments/` — —
|
||||
- PATCH `/payments/` — —
|
||||
|
||||
## Credit Cards
|
||||
|
||||
- GET `/payments/` — —
|
||||
- DELETE `/payments/` — —
|
||||
- PATCH `/payments/` — —
|
||||
|
||||
## Products
|
||||
|
||||
- GET `/products` — —
|
||||
- POST `/products` — —
|
||||
- PATCH `/products/` — —
|
||||
- GET `/products/` — —
|
||||
- DELETE `/products/` — —
|
||||
- GET `/products` — —
|
||||
- POST `/products` — —
|
||||
- PATCH `/products/` — —
|
||||
- GET `/products/` — —
|
||||
- DELETE `/products/` — —
|
||||
|
||||
## Quotes
|
||||
|
||||
- GET `/quotes/` — —
|
||||
- PATCH `/quotes/` — —
|
||||
|
||||
## Service Plans
|
||||
|
||||
- GET `/service-plans` — —
|
||||
- POST `/service-plans` — —
|
||||
- PATCH `/service-plans` — —
|
||||
- GET `/service-plans` — —
|
||||
- DELETE `/service-plans` — —
|
||||
- GET `/service-plans/statistics` — —
|
||||
|
||||
## Service Plan Groups
|
||||
|
||||
- PATCH `/service-plans/statistics` — —
|
||||
- GET `/service-plans/statistics` — —
|
||||
- DELETE `/service-plans/statistics` — —
|
||||
|
||||
## Service Surcharges
|
||||
|
||||
- GET `/clients/services/` — —
|
||||
- POST `/clients/services/` — —
|
||||
- PATCH `/clients/services/service-surcharges/` — —
|
||||
- GET `/clients/services/service-surcharges/` — —
|
||||
- DELETE `/clients/services/service-surcharges/` — —
|
||||
|
||||
## Service Suspension
|
||||
|
||||
- GET `/service-suspension-reasons` — —
|
||||
- POST `/service-suspension-reasons` — —
|
||||
- PATCH `/service-suspension-reasons/` — —
|
||||
- GET `/service-suspension-reasons/` — —
|
||||
- DELETE `/service-suspension-reasons/` — —
|
||||
|
||||
## Service UISP Location
|
||||
|
||||
- PATCH `/clients/services/` — —
|
||||
- PATCH `/clients/services/` — —
|
||||
|
||||
## Services
|
||||
|
||||
- GET `/clients/services/` — —
|
||||
- PATCH `/clients/services/` — —
|
||||
- DELETE `/clients/services/` — —
|
||||
- POST `/clients/` — —
|
||||
- GET `/clients/services/` — —
|
||||
- PATCH `/clients/services/` — —
|
||||
- PATCH `/clients/services/` — —
|
||||
- PATCH `/clients/services/` — —
|
||||
- PATCH `/clients/services/` — —
|
||||
- DELETE `/clients/services/` — —
|
||||
|
||||
## Service Change Requests
|
||||
|
||||
- GET `/service-change-requests/` — —
|
||||
- DELETE `/service-change-requests/` — —
|
||||
|
||||
## Prepaid Service Periods
|
||||
|
||||
- GET `/prepaid-service-periods/` — —
|
||||
- DELETE `/prepaid-service-periods/` — —
|
||||
|
||||
## Surcharges
|
||||
|
||||
- GET `/surcharges` — —
|
||||
- POST `/surcharges` — —
|
||||
- PATCH `/surcharges/` — —
|
||||
- GET `/surcharges/` — —
|
||||
- DELETE `/surcharges/` — —
|
||||
|
||||
## Taxes
|
||||
|
||||
- GET `/taxes` — —
|
||||
- POST `/taxes` — —
|
||||
- GET `/taxes` — —
|
||||
- DELETE `/taxes` — —
|
||||
|
||||
## Tickets
|
||||
|
||||
- GET `/ticketing/tickets/` — —
|
||||
- PATCH `/ticketing/tickets/` — —
|
||||
- DELETE `/ticketing/tickets/` — —
|
||||
|
||||
## Ticket Groups
|
||||
|
||||
- GET `/ticketing/ticket-groups` — —
|
||||
- POST `/ticketing/ticket-groups` — —
|
||||
- GET `/ticketing/ticket-groups/` — —
|
||||
- PATCH `/ticketing/ticket-groups/` — —
|
||||
- DELETE `/ticketing/ticket-groups/` — —
|
||||
|
||||
## Ticket Tags
|
||||
|
||||
- GET `/ticket-tags` — —
|
||||
- POST `/ticket-tags` — —
|
||||
- PATCH `/ticket-tags` — —
|
||||
- GET `/ticket-tags` — —
|
||||
- DELETE `/ticket-tags` — —
|
||||
|
||||
## Client Zone Credit Cards
|
||||
|
||||
- GET `/ticket-tags` — —
|
||||
- DELETE `/ticket-tags` — —
|
||||
- PATCH `/ticket-tags` — —
|
||||
|
||||
## Client Zone Invoices
|
||||
|
||||
- GET `/ticket-tags` — —
|
||||
|
||||
## Client Zone Payments
|
||||
|
||||
- GET `/ticket-tags` — —
|
||||
|
||||
## Client Zone Quotes
|
||||
|
||||
- GET `/ticket-tags` — —
|
||||
|
||||
## Client Zone Services
|
||||
|
||||
- GET `/ticket-tags` — —
|
||||
|
||||
## Client Zone Service Plans
|
||||
|
||||
- GET `/ticket-tags` — —
|
||||
- GET `/ticket-tags` — —
|
||||
- GET `/ticket-tags` — —
|
||||
|
||||
## Client Zone Tickets
|
||||
|
||||
- POST `/ticket-tags` — —
|
||||
- GET `/ticket-tags` — —
|
||||
|
||||
## Client Zone Tickets Activities
|
||||
|
||||
- GET `/ticket-tags` — —
|
||||
|
||||
## Client Zone Tickets Comments
|
||||
|
||||
- POST `/ticket-tags` — —
|
||||
- GET `/ticket-tags` — —
|
||||
|
||||
## Client Zone Tickets Comments Attachments
|
||||
|
||||
- GET `/ticket-tags` — —
|
||||
|
||||
## Client Zone Service Change Requests
|
||||
|
||||
- GET `/client-zone/service-change-requests/` — —
|
||||
- DELETE `/client-zone/service-change-requests/` — —
|
||||
|
||||
## Client Zone Prepaid Service Periods
|
||||
|
||||
- GET `/client-zone/prepaid-service-periods/` — —
|
||||
662
INDEX_api_unms.md
Executable file
662
INDEX_api_unms.md
Executable file
@ -0,0 +1,662 @@
|
||||
# Índice API UNMS (UISP) — NMS v2.1
|
||||
|
||||
> **Generado automáticamente** desde `unms-swagger.json`
|
||||
> Ejecutar `php .agent/scripts/gen_index_unms_swagger.php` para regenerar.
|
||||
|
||||
**Host:** `` **Base Path:** `/nms/api/v2.1`
|
||||
**Versión API:** 1.5.0
|
||||
|
||||
---
|
||||
|
||||
## Resumen de Grupos
|
||||
|
||||
- **Authorization** (33 endpoints) — Login and user authorization.
|
||||
- **Backups** (13 endpoints) — UISP manual and automatic backups.
|
||||
- **CRM** (5 endpoints) — Customer relationship management.
|
||||
- **Data Links** (7 endpoints) — Data Links between devices.
|
||||
- **Devices** (326 endpoints) — Configuration and monitoring for all devices.
|
||||
- **Discovery** (6 endpoints) — Scan for devices and connect them to UISP.
|
||||
- **Export** (1 endpoints) — Client data export.
|
||||
- **Firmware** (5 endpoints) — Manage firmware files in UISP.
|
||||
- **Gateways** (6 endpoints) — Setup network device gateways.
|
||||
- **Logs** (2 endpoints) — View devices log lines.
|
||||
- **Outages** (1 endpoints) — View devices outages.
|
||||
- **Server** (56 endpoints) — UISP settings with SMTP configuration, SSL and backups configuration.
|
||||
- **Sites** (39 endpoints) — Manage sites and clients (former endpoints), their pictures and network structure.
|
||||
- **Speed Test** (6 endpoints) — Speedtest between device to device or device to internet.
|
||||
- **Tasks** (8 endpoints) — View, start or cancel UISP background tasks, for example firmware upgrade.
|
||||
- **Token** (4 endpoints) — Manage access tokens.
|
||||
- **Traffic** (12 endpoints) — Devices and clients traffic statistics generated thanks to NetFlow.
|
||||
- **Users** (21 endpoints) — Manage UISP users and their profiles.
|
||||
- **Vault** (9 endpoints) — Device credentials vault.
|
||||
|
||||
**Total: 560 endpoints en 19 grupos**
|
||||
|
||||
---
|
||||
|
||||
## Authorization — _Login and user authorization._
|
||||
|
||||
- GET `/nms/account/login/ubiquiti` [code?, state?, error?, error_description?, deviceUrl?, deviceName?, token?] — SSO authentication response endpoint. → 200/302/400/401/403/404/500
|
||||
- GET `/user` — Get the authenticated user. → 200/401/403/500
|
||||
- PUT `/user` — Updates authenticated user. → 200/400/401/403/500
|
||||
- GET `/access-groups/sites` [groupId?, withInternal?, withOverview?] — Return site access groups. → 200/401/403/500
|
||||
- POST `/access-groups/sites` — Create new site access group. → 200/400/401/403/404/500
|
||||
- GET `/user/totpauth` — Gets new information for two factor authentication. → 200/401/403/500
|
||||
- PUT `/user/totpauth` — Sets two factor authentication for user. → 200/400/401/403/500
|
||||
- GET `/access-groups/sites/{groupId}` [groupId] — Get site access group. → 200/400/401/403/404/500
|
||||
- PUT `/access-groups/sites/{groupId}` [groupId] — Update site access group. → 200/400/401/403/404/409/500
|
||||
- DELETE `/access-groups/sites/{groupId}` [groupId] — Delete site access group. → 200/400/401/403/404/409/500
|
||||
- GET `/user/offline-passwords/requested` — Show status if offline passwords request is present for user. → 200/401/403/404/500
|
||||
- POST `/user/check-credentials` — Check user credentials. → 200/400/401/403/500
|
||||
- POST `/user/check-session` — Check that the session token and cookie are valid. → 200/401/403/500
|
||||
- POST `/user/last-release-notes-seen` — Updates authenticated last release notes seen version. → 200/400/401/403/500
|
||||
- POST `/user/login` — Login. → 200/201/400/401/500
|
||||
- POST `/user/logout` — Logout. → 200/401/403/500
|
||||
- POST `/user/offline-passwords` — Generates random offline passwords for user. → 200/401/403/500
|
||||
- POST `/nms/info/login` — Authenticate client and return device access token → 200/400/403/405/500
|
||||
- POST `/token/ubiquiti/exchange` — Exchange of SSO token to x-auth-token. → 200/400/401/403/500
|
||||
- POST `/user/login/totpauth` — Two Factor Authentication login step 2. → 200/400/500
|
||||
- POST `/user/login/ubiquiti` — Login using Ubiquiti SSO. → 200/400/401/500
|
||||
- POST `/user/offline-passwords/confirm` — Confirms request to generate random offline passwords for authenticated user. → 200/401/403/404/500
|
||||
- POST `/user/password/requestreset` — Request password reset. → 200/400/403/500
|
||||
- POST `/user/password/reset` — Reset user password. → 200/400/401/500
|
||||
- POST `/user/password/strength` — Check password strength. → 200/400/500
|
||||
- POST `/user/sso/verify` — Verify SSO login result. → 200/400/401/403/500
|
||||
- POST `/user/login/invite/local` — Finish user invitation using local password. → 200/400/401/500
|
||||
- POST `/user/login/invite/ubiquiti` — Finish user invitation using Ubiquiti SSO. → 200/400/401/500
|
||||
- PUT `/user/disabledtotpauth` — Disable two factor authorization for user. → 200/400/401/403/500
|
||||
- PUT `/user/preferences` — Updates authenticated user's preferences. → 200/400/401/403/500
|
||||
- PUT `/user/sso/enable` — Enable Ubiquiti SSO for current user. → 200/400/401/403/500
|
||||
- PUT `/access-groups/sites/{groupId}/{siteId}` [groupId, siteId] — Add or change access to single site. → 200/400/401/403/404/409/500
|
||||
- DELETE `/access-groups/sites/{groupId}/{siteId}` [groupId, siteId] — Remove access to single site. → 200/400/401/403/404/409/500
|
||||
|
||||
## Backups — _UISP manual and automatic backups._
|
||||
|
||||
- GET `/nms/backups` — Get UISP backups. → 200/400/401/403/500
|
||||
- GET `/nms/backups/{backupId}` [backupId] — Get UISP backup file. → 400/401/403/404/500
|
||||
- DELETE `/nms/backups/{backupId}` [backupId] — Delete UISP backup. → 200/400/401/403/404/500
|
||||
- GET `/nms/downloads/{token}` — Download UISP backups. → 400/404/500
|
||||
- GET `/nms/backups/{backupId}/download-token` [backupId] — Get temporary download token for this backup. → 400/401/403/404/500
|
||||
- GET `/devices/uisprs/{id}/tools/unms-controller/backups` [id] — Returns list of backups on the microSD and sync status. → 200/400/401/404/409/500
|
||||
- GET `/devices/uisprs/{id}/tools/unms-controller/backup-storage` [id] — Get details about the storage. → 200/400/401/404/500
|
||||
- GET `/devices/uisprs/{id}/tools/unms-controller/backup-storage/format` [id] — Get status of microSD card format. → 200/400/401/404/500
|
||||
- POST `/devices/uisprs/{id}/tools/unms-controller/backup-storage/format` [id] — Format the microSD card. → 200/400/401/404/409/500
|
||||
- POST `/nms/backups/create` — Create UISP backup. → 200/400/401/403/404/500
|
||||
- POST `/nms/backups/restore/set-user-password` — Restore UISP backup. → 200/400/401/403/404/500
|
||||
- POST `/nms/backups/{backupId}/restore` [backupId] — Restore UISP backup. → 200/400/401/403/404/500
|
||||
- POST `/devices/uisprs/{id}/tools/unms-controller/backup-storage/detach` [id] — Unmount the microSD card. → 200/400/401/404/409/500
|
||||
|
||||
## CRM — _Customer relationship management._
|
||||
|
||||
- GET `/crm/roles` — Get CRM admin users. → 200/401/403/500/503
|
||||
- GET `/crm/service-plans` — Get CRM service plans. → 200/401/403/500/503
|
||||
- GET `/crm/{ucrmClientId}/tickets` [ucrmClientId, limit?, offset?, order?, direction?] — List of CRM tickets belonging to the subscriber (CRM client). → 200/401/403/409/500/503
|
||||
- POST `/crm/clients` — Create CRM client. → 200/401/403/409/500/503
|
||||
- PATCH `/crm/service-change-requests/{requestId}/accept` [requestId] — Accept service change request in CRM. → 200/401/403/409/500/503
|
||||
|
||||
## Data Links — _Data Links between devices._
|
||||
|
||||
- GET `/data-links` [siteLinksOnly?] — List of all data links. → 200/400/401/403/500
|
||||
- POST `/data-links` — Create data link. → 200/401/403/409/500
|
||||
- GET `/data-links/{id}` [id] — Get data link based on its ID. → 200/400/401/403/404/500
|
||||
- PUT `/data-links/{id}` [id] — Update data link. → 200/400/401/403/409/500
|
||||
- DELETE `/data-links/{id}` [id] — Delete data link based on its ID. → 200/400/401/403/404/500
|
||||
- GET `/data-links/device/{id}` [id] — Get data link based on device ID. → 200/400/401/403/404/500
|
||||
- GET `/data-links/sites/{siteId}` [siteId] — List of data links based siteId → 200/400/401/403/404/500
|
||||
|
||||
## Devices — _Configuration and monitoring for all devices._
|
||||
|
||||
- GET `/devices` [siteId?, withInterfaces?, authorized?, type?, role?] — List of all devices in UISP. → 200/400/401/403/500
|
||||
- GET `/devices/discovered` — List of discovered devices. → 200/400/401/403/500
|
||||
- GET `/devices/images` — Returns list of all devices model image. → 200/401/403/404/500
|
||||
- GET `/devices/ips` [suspended?, management?, siteId?, ucrmId?, includeObsolete?] — Return a list of devices IPs which are in UISP monitored IP ranges. → 200/400/401/403/500
|
||||
- GET `/devices/login` [mac?, ip?] — Create device ticket to login via controller → 200/400/401/403/500
|
||||
- GET `/devices/macs` — Return a list of all devices MAC address (except for ONUs). → 200/400/401/403/500
|
||||
- GET `/devices/onus` [parentId?] — List of ONU in UISP. → 200/400/401/403/404/500
|
||||
- GET `/devices/ssids` — Get devices wireless configuration → 200/401/403/500
|
||||
- GET `/devices/unknown` [minTraffic?] — Get unknown client devices (based on detected network traffic) ordered by total traffic. → 200/400/401/403/500
|
||||
- GET `/devices/{id}` [id] — Device status overview. → 200/400/401/403/500
|
||||
- DELETE `/devices/{id}` [id] — Delete device. → 200/400/401/403/500
|
||||
- GET `/airlink/proxy/airlink-be` [lat1, lon1, lat2, lon2, samples?] — Get elevation data between two points. → 200/400/401/403/500/502
|
||||
- GET `/airlink/proxy/countries-map.geo.json` [version?] — Get countries map data file. → 400/401/403/500/502
|
||||
- GET `/airlink/proxy/elevation` [file, version?] — Get elevation data file. → 400/401/403/500/502
|
||||
- GET `/airlink/proxy/lidar-boundaries.geojson` [version?] — Get lidar boundaries data file. → 400/401/403/500/502
|
||||
- GET `/airlink/proxy/rainfall-average.map` [version?] — Get average rainfall map data file. → 400/401/403/500/502
|
||||
- GET `/airlink/proxy/rainfall-r001.map` [version?] — Get rainfall map data file. → 400/401/403/500/502
|
||||
- GET `/devices/aircubes/{id}` [id, withStations?] — Return AirCube detail. → 200/400/401/403/404/500
|
||||
- GET `/devices/airfibers/{id}` [id, withStations?] — Return AirFiber detail. → 200/400/401/403/404/500
|
||||
- GET `/devices/airmaxes/{id}` [id, withStations?] — Return AirMax detail. → 200/400/401/403/404/500
|
||||
- GET `/devices/aps/profiles` — List of all access points and their connection profiles. → 200/400/401/403/500
|
||||
- GET `/devices/blackboxes/{id}` [id] — Return Blackbox device. → 200/400/401/403/404/500
|
||||
- GET `/devices/discovered/head` — First of discovered devices without BlackBox and Express. → 200/400/401/403/500
|
||||
- GET `/devices/epowers/{id}` [id] — Get epower device. → default
|
||||
- GET `/devices/erouters/{id}` [id] — Return EdgeRouter detail. [Deprecated in favor of route GET /nms/api/v2.1/devices/{id}/detail] → 200/400/401/403/404/500
|
||||
- GET `/devices/eswitches/{id}` [id] — Return EdgeSwitch detail. → 200/400/401/403/404/500
|
||||
- GET `/devices/import/status` — Status of devices import process. → 200/401/403/500
|
||||
- GET `/devices/mac/{mac}` [mac] — Get info on device by mac address. → 200/400/401/403/404/500
|
||||
- GET `/devices/olts/{id}` [id] — Return OLT detail. → 200/400/401/403/404/500
|
||||
- GET `/devices/onus/{id}` [id] — Return ONU detail. → 200/400/401/403/500
|
||||
- GET `/devices/remoteuiproxy/sessions` — Get valid remote-ui-proxy session tokens. → 200/401/403/404/500
|
||||
- GET `/devices/solarbeams/{id}` [id] — Return SolarBeam detail. → 200/400/401/403/404/500
|
||||
- GET `/devices/top/active` [count?] — Get most active devices → 200/400/401/403/404/500
|
||||
- GET `/devices/toughswitches/{id}` [id] — Return ToughSwitch detail. → 200/400/401/403/404/500
|
||||
- GET `/devices/uisprlxcs/{id}` [id] — Return UISPRLXC detail. [Deprecated in favor of route GET /nms/api/v2.1/devices/{id}/detail] → 200/400/401/403/404/500
|
||||
- GET `/devices/uisprs/{id}` [id] — Return UISPR detail. [Deprecated in favor of route GET /nms/api/v2.1/devices/{id}/detail] → 200/400/401/403/404/500
|
||||
- GET `/devices/uispss/{id}` [id] — Return UISP Switch detail. → 200/400/401/403/404/500
|
||||
- GET `/devices/waves/{id}` [id, withStations?] — Return Wave detail. → 200/400/401/403/404/500
|
||||
- GET `/devices/{deviceId}/interfaces` [deviceId] — Return list of device interfaces. → 200/400/401/403/404/500
|
||||
- GET `/devices/{deviceType}/configuration-history` [deviceType] — Get all saved history of configurations by device type. → 200/400/401/403/404/500
|
||||
- GET `/devices/{id}/operators` [id] — Return list of available operators [UISP-LTE] → 200/400/401/403/404/500
|
||||
- GET `/devices/{deviceId}/mac-table-refresh` [deviceId] — Fetch mac table from device and save to UISP. [EdgeSwitch, EdgeRouter, AirMax, UISPRouter, UISPSwitch, AirFiber, AirCube] → 200/400/401/403/404/500
|
||||
- GET `/devices/{id}/capabilities` [id] — Device supported features lists. → 200/400/401/403/404/500
|
||||
- GET `/devices/{id}/system` [id] — Device system configuration. → 200/400/401/403/404/500
|
||||
- PUT `/devices/{id}/system` [id, isComposeRequest?] — Update a device's system settings. → 200/400/401/403/404/500
|
||||
- GET `/devices/{id}/statistics` [id, interval, start, period] — Return device statistics. → 200/400/401/403/404/500
|
||||
- GET `/devices/{id}/detail` [id, withStations?] — Get device detail with interfaces and/or stations. → 200/400/401/403/404/500
|
||||
- GET `/devices/{id}/supportfile` [id] — Get device's support file. → 401/403/404/500
|
||||
- GET `/devices/{id}/configuration` [id] — Get device system and services configuration. → 200/400/401/403/404/500
|
||||
- PUT `/devices/{id}/configuration` [id, isComposeRequest?] — Update device system and services configuration. → 200/400/401/403/404/500
|
||||
- GET `/devices/{id}/services` [id, payload?] — Device services. → 200/400/401/403/404/500
|
||||
- PUT `/devices/{id}/services` [id] — Update device services. → 200/400/401/403/404/500
|
||||
- GET `/devices/{deviceId}/location` [deviceId] — Return location of the device. → 200/400/401/403/404/500
|
||||
- PUT `/devices/{deviceId}/location` [deviceId] — Update location of the device. → 200/400/401/403/404/500
|
||||
- GET `/devices/{deviceId}/mac-table` [deviceId, sortBy?, sortDesc?, count?, page?, search?] — Return mac table of device. [EdgeSwitch, EdgeRouter, AirMax, UISPRouter, UISPSwitch, AirFiber, AirCube] → 200/400/401/403/404/500
|
||||
- GET `/devices/{id}/vlans` [id] — Get device's VLANs. → 200/400/401/403/500
|
||||
- POST `/devices/{id}/vlans` [id, isComposeRequest?] — Update device's VLANs. → 200/400/401/403/500
|
||||
- GET `/devices/{id}/netflow` [id, interfaceId?] — Get information on device's flow-accounting status. → 200/400/401/404
|
||||
- GET `/devices/{id}/clients` [id] — Return a devices' connected devices [UISP-LTE] → 200/400/401/403/404/500
|
||||
- GET `/devices/{id}/perform-default-login` [id] — Try connecting device using factory default credentials. → 200/400/401/403/500
|
||||
- GET `/devices/{id}/remoteuiproxy` [id] — Get initial remote UI. → 401/403/404/500
|
||||
- GET `/devices/{deviceId}/backups` [deviceId] — Return list of device backups. → 200/400/401/403/404/500
|
||||
- POST `/devices/{deviceId}/backups` [deviceId] — Create new device backup. → 200/400/401/403/404/500
|
||||
- PUT `/devices/{deviceId}/backups` [deviceId] — Upload device backup. → 200/400/401/403/404/500
|
||||
- GET `/devices/aircubes/{id}/network` [id] — Get AirCube network configuration. → 200/400/401/403/404/500
|
||||
- PUT `/devices/aircubes/{id}/network` [id] — Update AirCube network configuration. → 200/400/401/403/404/500
|
||||
- GET `/devices/aircubes/{id}/frequency-lists` [id] — Return AirCube frequency lists. → 200/400/401/403/404/500
|
||||
- GET `/devices/aircubes/{id}/stations` [id] — Return AirCube station list. → 200/400/401/403/404/500
|
||||
- GET `/devices/aircubes/{id}/tx-power-lists` [id] — Return AirCube tx power lists. → 200/400/401/403/404/500
|
||||
- GET `/devices/aircubes/{id}/wireless` [id] — Get AirCube wireless config → 200/400/401/403/404/500
|
||||
- PUT `/devices/aircubes/{id}/wireless` [id] — Update AirCube wireless configuration. → 200/400/401/403/404/500
|
||||
- GET `/devices/aircubes/{id}/system` [id] — Get AirCube system configuration. → 200/400/401/403/404/500
|
||||
- PUT `/devices/aircubes/{id}/system` [id] — Update AirCube system configuration. → 200/400/401/403/404/500
|
||||
- GET `/devices/airfibers/{id}/stations` [id] — Return AirFiber station list. → 200/400/401/403/404/500
|
||||
- GET `/devices/airmaxes/{id}/system` [id] — Get AirMax system config. [Deprecated in favor of route GET /nms/api/v2.1/devices/{id}/system] → 200/400/401/403/404/500
|
||||
- GET `/devices/airmaxes/{id}/stations` [id] — Return AirMax station list. → 200/400/401/403/404/500
|
||||
- GET `/devices/airmaxes/{id}/site-survey` [id] — Scan sites. → 200/400/401/403/404/500
|
||||
- GET `/devices/airmaxes/{id}/frequency-bands` [id] — Get AirMax stations frequency bands. → 200/400/401/403/404/500
|
||||
- GET `/devices/airos/{id}/regdomain` [id, countryCode?] — Get device regulatory domain information for configured or provided via query parameter country). → 200/400/401/403/404/500
|
||||
- GET `/devices/airos/{id}/configuration` [id] — Get airOS device configuration. → 200/400/401/403/404/500
|
||||
- PUT `/devices/airos/{id}/configuration` [id, isComposeRequest?, isLinkConfiguration?] — Update airOs device configuration. → 200/400/401/403/404/500
|
||||
- GET `/devices/airos/{id}/countries` [id] — Get list of available countries on device. → 200/400/401/403/404/500
|
||||
- GET `/devices/blackboxes/{id}/config` [id] — Return BlackBox device config. → 200/400/401/403/404/500
|
||||
- PUT `/devices/blackboxes/{id}/config` [id] — Update BlackBox device config. → 200/400/401/403/404/409/500
|
||||
- GET `/devices/erouters/{id}/netflow` [id, interfaceId?] — Get information on device's flow-accounting status. [Deprecated in favor of route GET /nms/api/v2.1/devices/{id}/netflow] → 200/400/401/404/500
|
||||
- GET `/devices/eswitches/{id}/system` [id] — Get EdgeSwitch system configuration. [Deprecated in favor of route GET /nms/api/v2.1/devices/{id}/system] → 200/400/401/403/404/500
|
||||
- GET `/devices/express/{id}/refresh` [id] — Refresh Express data → 200/400/401/403/404/500
|
||||
- GET `/devices/onus/{id}/network` [id] — Get an Onu's network settings. [Deprecated in favor of route "/nms/api/v2.1/devices/get-configuration"] → 200/400/401/403/404/500
|
||||
- PUT `/devices/onus/{id}/network` [id] — Update an Onu's network settings. [Deprecated in favor of route "/nms/api/v2.1/devices/update-configuration"] → 200/400/401/403/404/500
|
||||
- GET `/devices/onus/{id}/services` [id] — Get an Onu's services. [Deprecated in favor of route POST "/nms/api/v2.1/devices/get-configuration"] → 200/400/401/403/404/500
|
||||
- GET `/devices/onus/{id}/clients` [id] — Get an Onu's connected devices MAC addressees. → 200/400/401/403/500
|
||||
- GET `/devices/onus/{id}/wireless` [id] — Get an Onu's wireless settings. [Deprecated in favor of route "/nms/api/v2.1/devices/get-configuration"] → 200/400/401/403/404/500/501
|
||||
- PUT `/devices/onus/{id}/wireless` [id] — Update an Onu's wireless settings. [Deprecated in favor of route "/nms/api/v2.1/devices/update-configuration"] → 200/400/401/403/404/500
|
||||
- GET `/devices/onus/{id}/vlans` [id] — Deprecated. Get list of OLT's VLANs. → 200/400/401/403/404/500/501
|
||||
- GET `/devices/toughswitches/{id}/system` [id] — Get ToughSwitch system configuration. [Deprecated in favor of route GET /nms/api/v2.1/devices/{id}/system] → 200/400/401/403/404/500
|
||||
- GET `/devices/uisprlxcs/{id}/netflow` [id, interfaceId?] — Get information on device's flow-accounting status. [Deprecated in favor of route GET /nms/api/v2.1/devices/{id}/netflow] → 200/400/401/404/500
|
||||
- GET `/devices/uisprs/{id}/netflow` [id, interfaceId?] — Get information on device's flow-accounting status. [Deprecated in favor of route GET /nms/api/v2.1/devices/{id}/netflow] → 200/400/401/404/500
|
||||
- GET `/devices/uispss/{id}/system` [id] — Get UISP Switch system configuration. [Deprecated in favor of route GET /nms/api/v2.1/devices/{id}/system] → 200/400/401/403/404/500
|
||||
- GET `/devices/waves/{id}/stations` [id] — Return Wave station list. → 200/400/401/403/404/500
|
||||
- GET `/devices/wifi-router/{id}/configuration` [id] — Returns configuration of wifiRouter → 200/400/401/403/404/500
|
||||
- PUT `/devices/wifi-router/{id}/configuration` [id] — Update configuration of wifiRouter → 200/400/401/403/404/500
|
||||
- GET `/devices/{deviceId}/speed-tests/{testId}` [deviceId, testId] — Return detail about running speedtest. → 200/401/403/422/500
|
||||
- DELETE `/devices/{deviceId}/speed-tests/{testId}` [deviceId, testId] — Stop speed test. → 200/400/401/403/404/422/500
|
||||
- GET `/devices/{deviceId}/interfaces/{interfaceName}` [deviceId, interfaceName] — Get interface configuration. → 200/400/401/403/404/500
|
||||
- PUT `/devices/{deviceId}/interfaces/{interfaceName}` [deviceId, interfaceName, isComposeRequest?] — Update interface configuration. → 200/400/401/403/404/500
|
||||
- DELETE `/devices/{deviceId}/interfaces/{interfaceName}` [deviceId, interfaceName] — Delete interface. → 200/400/401/403/404/500
|
||||
- GET `/devices/{deviceId}/backups/{backupId}` [deviceId, backupId, replaceUnmsKey?] — Return device configuration backup file. → 400/401/403/404/500
|
||||
- PUT `/devices/{deviceId}/backups/{backupId}` [deviceId, backupId] — Update backup. → 400/401/403/404/500
|
||||
- DELETE `/devices/{deviceId}/backups/{backupId}` [deviceId, backupId] — Delete backup. → 200/400/401/403/404/500
|
||||
- GET `/devices/{id}/dhcp-details/{interface}` [id, interface] — Returns details of DHCP IP address - gateway and DNS servers. → 200/400/401/403/500
|
||||
- GET `/devices/{id}/router/routes` [id] — Get all routes. → 200/400/401/403/404/500
|
||||
- POST `/devices/{id}/router/routes` [id] — Create new static route. → 200/400/401/403/404/500
|
||||
- PUT `/devices/{id}/router/routes` [id] — Edit static route. → 200/400/401/403/404/500
|
||||
- GET `/devices/{id}/system/unms` [id] — Device specific UISP settings. → 200/400/401/403/404/500
|
||||
- PUT `/devices/{id}/system/unms` [id] — Update device specific UISP settings. → 200/400/401/403/404/500
|
||||
- GET `/devices/{id}/router/ospf` [id] — Get OSPF configuration. → 200/400/401/403/404/500
|
||||
- PUT `/devices/{id}/router/ospf` [id] — Update OSPF configuration. → 200/400/401/403/404/500
|
||||
- GET `/devices/{id}/remoteuiproxy/init` [id] — Get device remote ui proxy token. → 401/403/404/500
|
||||
- GET `/devices/aircubes/{id}/config/system` [id] — Get AirCube system config. This API endpoint is DEPRECATED.
|
||||
Please refer to '/nms/api/v2.1/devices/aircubes/{id}/system' instead. → 200/400/401/403/404/500
|
||||
- PUT `/devices/aircubes/{id}/config/system` [id] — Update AirCube system settings. This API endpoint is DEPRECATED.
|
||||
Please refer to '/nms/api/v2.1/devices/aircubes/{id}/system' instead. → 200/400/401/403/404/500
|
||||
- GET `/devices/aircubes/{id}/config/wireless` [id] — Get AirCube wireless config. This API endpoint is DEPRECATED.
|
||||
Please refer to '/nms/api/v2.1/devices/aircubes/{id}/wireless' instead. → 200/400/401/403/404/500
|
||||
- PUT `/devices/aircubes/{id}/config/wireless` [id] — Update AirCube wireless config. This API endpoint is DEPRECATED.
|
||||
Please refer to '/nms/api/v2.1/devices/aircubes/{id}/wireless' instead. → 200/400/401/403/404/500
|
||||
- GET `/devices/aircubes/{id}/config/network` [id] — Get AirCube network config. This API endpoint is DEPRECATED.
|
||||
Please refer to '/nms/api/v2.1/devices/aircubes/{id}/network' instead. → 200/400/401/403/404/500
|
||||
- PUT `/devices/aircubes/{id}/config/network` [id] — Update AirCube network config. This API endpoint is DEPRECATED.
|
||||
Please refer to '/nms/api/v2.1/devices/aircubes/{id}/network' instead. → 200/400/401/403/404/500
|
||||
- GET `/devices/airmaxes/{id}/config/wireless` [id] — Get AirMax wireless config. → 200/400/401/403/404/500
|
||||
- PUT `/devices/airmaxes/{id}/config/wireless` [id] — Update AirMax wireless config. → 200/400/401/403/404/500
|
||||
- GET `/devices/epowers/{id}/configuration/power` [id] — Get epower configuration: [Deprecated in favor of route GET /nms/api/v2.1/devices/{id}/system/configuration/power] → default
|
||||
- GET `/devices/erouters/{id}/dhcp/leases` [id] — DHCP IP address leases. → 200/400/401/403/404/500
|
||||
- POST `/devices/erouters/{id}/dhcp/leases` [id] — Create DHCP IP address lease. → 200/400/401/403/404/500
|
||||
- GET `/devices/erouters/{id}/dhcp/servers` [id] — Device DHCP servers. → 200/400/401/403/404/500
|
||||
- POST `/devices/erouters/{id}/dhcp/servers` [id] — Create new DHCP server. → 200/400/401/403/404/500
|
||||
- GET `/devices/erouters/{id}/router/routes` [id] — Get all routes. [Deprecated in favor of route GET /nms/api/v2.1/devices/{id}/router/routes] → 200/400/401/403/404/500
|
||||
- POST `/devices/erouters/{id}/router/routes` [id] — Create new static route. [Deprecated in favor of route POST /nms/api/v2.1/devices/{id}/router/routes] → 200/400/401/403/404/500
|
||||
- PUT `/devices/erouters/{id}/router/routes` [id] — Edit static route. [Deprecated in favor of route PUT /nms/api/v2.1/devices/{id}/router/routes] → 200/400/401/403/404/500
|
||||
- GET `/devices/solarbeams/{id}/config/system` [id] — Get SolarBeam system configuration. → 200/400/401/403/404/500
|
||||
- PUT `/devices/solarbeams/{id}/config/system` [id] — Update SolarBeam system settings. → 200/400/401/403/404/500
|
||||
- GET `/devices/uisprlxcs/{id}/firewall/sets` [id] — Get information on device's firewall sets. → 200/400/401/404/500
|
||||
- GET `/devices/uisprlxcs/{id}/firewall/mangles` [id] — Get information on device's firewall mangles chains. → 200/400/401/404/500
|
||||
- GET `/devices/uisprlxcs/{id}/router/routes` [id] — Get all routes. [Deprecated in favor of route GET /nms/api/v2.1/devices/{id}/router/routes] → 200/400/401/403/404/500
|
||||
- POST `/devices/uisprlxcs/{id}/router/routes` [id] — Create new static route. [Deprecated in favor of route POST /nms/api/v2.1/devices/{id}/router/routes] → 200/400/401/403/404/500
|
||||
- PUT `/devices/uisprlxcs/{id}/router/routes` [id] — Edit static route. [Deprecated in favor of route PUT /nms/api/v2.1/devices/{id}/router/routes] → 200/400/401/403/404/500
|
||||
- GET `/devices/uisprlxcs/{id}/dhcp/servers` [id] — Device DHCP servers. → 200/400/401/403/404/500
|
||||
- POST `/devices/uisprlxcs/{id}/dhcp/servers` [id] — Create new DHCP server. → 200/400/401/403/404/500
|
||||
- GET `/devices/uisprlxcs/{id}/dhcp/leases` [id] — DHCP IP address leases. → 200/400/401/403/404/500
|
||||
- POST `/devices/uisprlxcs/{id}/dhcp/leases` [id] — Create DHCP IP address lease. → 200/400/401/403/404/500
|
||||
- GET `/devices/uisprlxcs/{id}/firewall/filters` [id] — Get information on device's firewall filter chains. → 200/400/401/404/500
|
||||
- GET `/devices/uisprlxcs/{id}/firewall/nats` [id] — Get information on device's firewall NATs. → 200/400/401/404/500
|
||||
- GET `/devices/uisprlxcs/{id}/firewall/settings` [id] — Get information on device's firewall settings. → 200/400/401/404/500
|
||||
- PUT `/devices/uisprlxcs/{id}/firewall/settings` [id] — Set firewall settings on the device. → 200/400/401/404/500
|
||||
- GET `/devices/uisprs/{id}/firewall/sets` [id] — Get information on device's firewall sets. → 200/400/401/404/500
|
||||
- GET `/devices/uisprs/{id}/firewall/mangles` [id] — Get information on device's firewall mangles chains. → 200/400/401/404/500
|
||||
- GET `/devices/uisprs/{id}/router/routes` [id] — Get all routes. [Deprecated in favor of route GET /nms/api/v2.1/devices/{id}/router/routes] → 200/400/401/403/404/500
|
||||
- POST `/devices/uisprs/{id}/router/routes` [id] — Create new static route. [Deprecated in favor of route POST /nms/api/v2.1/devices/{id}/router/routes] → 200/400/401/403/404/500
|
||||
- PUT `/devices/uisprs/{id}/router/routes` [id] — Edit static route. [Deprecated in favor of route PUT /nms/api/v2.1/devices/{id}/router/routes] → 200/400/401/403/404/500
|
||||
- GET `/devices/uisprs/{id}/dhcp/servers` [id] — Device DHCP servers. → 200/400/401/403/404/500
|
||||
- POST `/devices/uisprs/{id}/dhcp/servers` [id] — Create new DHCP server. [Deprecated in favor of route PUT /nms/api/v2.1/devices/{id}/configuration] → 200/400/401/403/404/500
|
||||
- GET `/devices/uisprs/{id}/dhcp/leases` [id] — DHCP IP address leases. [Deprecated in favor of route GET /nms/api/v2.1/devices/{id}/configuration] → 200/400/401/403/404/500
|
||||
- POST `/devices/uisprs/{id}/dhcp/leases` [id] — Create DHCP IP address lease. [Deprecated in favor of route PUT /nms/api/v2.1/devices/{id}/configuration] → 200/400/401/403/404/500
|
||||
- GET `/devices/uisprs/{id}/firewall/filters` [id] — Get information on device's firewall filter chains. → 200/400/401/404/500
|
||||
- GET `/devices/uisprs/{id}/firewall/nats` [id] — Get information on device's firewall NATs. → 200/400/401/404/500
|
||||
- GET `/devices/uisprs/{id}/firewall/settings` [id] — Get information on device's firewall settings. → 200/400/401/404/500
|
||||
- PUT `/devices/uisprs/{id}/firewall/settings` [id] — Set firewall settings on the device. → 200/400/401/404/500
|
||||
- GET `/devices/{id}/remoteuiproxy/resources/{path*}` [id, path?] — Load local UI resources → 401/403/404/500
|
||||
- POST `/devices/{id}/remoteuiproxy/resources/{path*}` [id, path?] — Update local UI → 401/403/404/500
|
||||
- PUT `/devices/{id}/remoteuiproxy/resources/{path*}` [id, path?] — Update local UI → 401/403/404/500
|
||||
- DELETE `/devices/{id}/remoteuiproxy/resources/{path*}` [id, path?] — Update local UI → 401/403/404/500
|
||||
- PATCH `/devices/{id}/remoteuiproxy/resources/{path*}` [id, path?] — Update local UI → 401/403/404/500
|
||||
- GET `/devices/{id}/system/configuration/power` [id] — Get configuration - power. → 200/400/401/403/404/500
|
||||
- PUT `/devices/{id}/system/configuration/power` [id] — Set configuration - power. → 200/400/401/403/404/500
|
||||
- GET `/devices/{id}/router/ospf/areas` [id] — All OSPF areas. → 200/400/401/403/404/500
|
||||
- POST `/devices/{id}/router/ospf/areas` [id] — Create new OSPF area. → 200/400/401/403/404/500
|
||||
- GET `/devices/{deviceId}/udapi/{version}/{udapiUrl*}` [deviceId, version, udapiUrl] — Udapi device request. → 200/400/401/403/404/500/501
|
||||
- POST `/devices/{deviceId}/udapi/{version}/{udapiUrl*}` [deviceId, version, udapiUrl] — Udapi device request. → 200/400/401/403/404/500/501
|
||||
- PUT `/devices/{deviceId}/udapi/{version}/{udapiUrl*}` [deviceId, version, udapiUrl] — Udapi device request. → 200/400/401/403/404/500/501
|
||||
- PATCH `/devices/{deviceId}/udapi/{version}/{udapiUrl*}` [deviceId, version, udapiUrl] — Udapi device request. → 200/400/401/403/404/500/501
|
||||
- DELETE `/devices/{deviceId}/udapi/{version}/{udapiUrl*}` [deviceId, version, udapiUrl] — Udapi device request. → 200/400/401/403/404/500/501
|
||||
- GET `/devices/{deviceId}/interfaces/data-link/available` [deviceId, dataLinkId?] — Return list of interfaces available to create data link. → 200/400/401/403/404/500
|
||||
- GET `/devices/erouters/{id}/router/ospf/areas` [id] — All OSPF areas. [Deprecated in favor of route GET /nms/api/v2.1/devices/{id}/router/ospf/areas] → 200/400/401/403/404/500
|
||||
- POST `/devices/erouters/{id}/router/ospf/areas` [id] — Create new OSPF area. [Deprecated in favor of route POST /nms/api/v2.1/devices/{id}/router/ospf/areas] → 200/400/401/403/404/500
|
||||
- GET `/devices/erouters/{id}/dhcp/servers/{serverName}` [id, serverName] — Get DHCP server configuration. → 200/400/401/403/404/500
|
||||
- PUT `/devices/erouters/{id}/dhcp/servers/{serverName}` [id, serverName] — Update DHCP server configuration. → 200/400/401/403/404/500
|
||||
- DELETE `/devices/erouters/{id}/dhcp/servers/{serverName}` [id, serverName] — Delete DHCP server. → 200/400/401/403/404/500
|
||||
- GET `/devices/uisprlxcs/{id}/dhcp/servers/{serverName}` [id, serverName] — Get DHCP server configuration. → 200/400/401/403/404/500
|
||||
- PUT `/devices/uisprlxcs/{id}/dhcp/servers/{serverName}` [id, serverName] — Update DHCP server configuration. → 200/400/401/403/404/500
|
||||
- DELETE `/devices/uisprlxcs/{id}/dhcp/servers/{serverName}` [id, serverName] — Delete DHCP server. → 200/400/401/403/404/500
|
||||
- GET `/devices/uisprlxcs/{id}/router/ospf/areas` [id] — All OSPF areas. [Deprecated in favor of route GET /nms/api/v2.1/devices/{id}/router/ospf/areas] → 200/400/401/403/404/500
|
||||
- POST `/devices/uisprlxcs/{id}/router/ospf/areas` [id] — Create new OSPF area. [Deprecated in favor of route POST /nms/api/v2.1/devices/{id}/router/ospf/areas] → 200/400/401/403/404/500
|
||||
- GET `/devices/uisprlxcs/{id}/router/ospf/interfaces` [id] — All OSPF Interface. [Deprecated in favor of route GET /nms/api/v2.1/devices/{deviceId}/interfaces] → 200/400/401/403/404/500
|
||||
- GET `/devices/uisprs/{id}/dhcp/servers/{serverName}` [id, serverName] — Get DHCP server configuration. [Deprecated in favor of route GET /nms/api/v2.1/devices/{id}/configuration] → 200/400/401/403/404/500
|
||||
- PUT `/devices/uisprs/{id}/dhcp/servers/{serverName}` [id, serverName] — Update DHCP server configuration. [Deprecated in favor of route PUT /nms/api/v2.1/devices/{id}/configuration] → 200/400/401/403/404/500
|
||||
- DELETE `/devices/uisprs/{id}/dhcp/servers/{serverName}` [id, serverName] — Delete DHCP server. [Deprecated in favor of route PUT /nms/api/v2.1/devices/{id}/configuration] → 200/400/401/403/404/500
|
||||
- GET `/devices/uisprs/{id}/router/ospf/areas` [id] — All OSPF areas. [Deprecated in favor of route GET /nms/api/v2.1/devices/{id}/router/ospf/areas] → 200/400/401/403/404/500
|
||||
- POST `/devices/uisprs/{id}/router/ospf/areas` [id] — Create new OSPF area. [Deprecated in favor of route POST /nms/api/v2.1/devices/{id}/router/ospf/areas] → 200/400/401/403/404/500
|
||||
- GET `/devices/uisprs/{id}/router/ospf/interfaces` [id] — All OSPF Interface. [Deprecated in favor of route GET /nms/api/v2.1/devices/{deviceId}/interfaces] → 200/400/401/403/404/500
|
||||
- POST `/devices/authorize` — Authorize single or multiple devices. → 200/400/401/403/500
|
||||
- POST `/devices/backups` — Create and download a new multi device backup. → 400/401/403/500
|
||||
- POST `/devices/bulkdelete` — Delete devices. → 200/400/401/403/500
|
||||
- POST `/devices/bulkrestart` — Restart devices, devices action reboot. → 200/400/401/403/500
|
||||
- POST `/devices/endpoints-for-parallel-firmware-upgrade` — Returns endpoint devices for parallel firmware upgrade in groups. → 200/400/401/403/500
|
||||
- POST `/devices/get-configuration` — Get multiple devices configuration. → 200/400/401/403/404/500
|
||||
- POST `/devices/import` —
|
||||
Complex devices import which internally use discovery and creates blackboxes for unreachable and non-UBNT devices.
|
||||
→ 200/400/401/403/404/500
|
||||
- POST `/devices/merge` — Merge two devices. → 200/400/401/403/500
|
||||
- POST `/devices/preregistration` — Create a preregistered device, sort of a "placeholder" for a device to be adopted in the future → 200/400/401/403/500
|
||||
- POST `/devices/refresh` — Reset devices specific AES keys to universal AES keys. → 200/400/401/403/500
|
||||
- POST `/devices/update-configuration` — Update multiple devices and/or onus configuration. → 200/400/401/403/404/500
|
||||
- POST `/devices/airmaxes/stations` — Returns AirMax stations for AirMax access points. → 200/400/401/403/500
|
||||
- POST `/devices/blackboxes/config` — Create new BlackBox device config. → 201/400/401/403/404/409/500
|
||||
- POST `/devices/configuration-history/delete` — Delete saved history of configurations by configuration IDs. → 200/400/401/403/404/500
|
||||
- POST `/devices/connect/other` — Find and connect other device using IP address → 200/400/401/404/500
|
||||
- POST `/devices/connect/ubnt` — Find and connect UBNT device using IP and provided credentials. → 200/400/401/500
|
||||
- POST `/devices/maintenance/disable` — Disable maintenance mode on one or more devices. → 200/401/404/500
|
||||
- POST `/devices/maintenance/enable` — Enable maintenance mode on one or more devices. → 200/401/404/500
|
||||
- POST `/devices/{deviceId}/switch-static-to-dhcp-ip` [deviceId] — Switch static IP address to DHCP - gateway (route), DNS servers (system) and interface. → 200/400/401/403/500
|
||||
- POST `/devices/{id}/unassign` [id] — Unassign device. → 200/400/401/403/404/500
|
||||
- POST `/devices/{id}/refresh` [id] — Reset device specific AES key to universal AES key. → 200/400/401/403/500
|
||||
- POST `/devices/{id}/debug` [id] — Enable debug logging. → 200/400/401/403/500
|
||||
- POST `/devices/{id}/authorize` [id] — Authorize device. [Deprecated in favor of route POST /nms/api/v2.1/devices/authorize] → 200/400/401/403/500
|
||||
- POST `/devices/{id}/restart` [id] — Restart device, device action reboot. → 200/400/401/403/500
|
||||
- POST `/devices/{id}/upgrade-to-latest` [id] —
|
||||
Upgrade device FW to the latest FW version in UISP. It's possible to track upgrade process via /tasks API.
|
||||
→ 200/400/401/403/404/422/500
|
||||
- POST `/devices/{id}/update` [id] — Set update of device to realtime profile. → 200/400/401/403/404/500
|
||||
- POST `/devices/{id}/reset-link-score` [id] — Reset link score. → 200/400/401/403/500
|
||||
- POST `/devices/{id}/switch-dhcp-to-static-ip` [id] — Switch DHCP to static IP address - gateway (route), DNS servers (system) and interface. → 200/400/401/403/500
|
||||
- POST `/devices/onus/{id}/update` [id] — Set update of ONU to realtime detail. → 200/400/401/403/404/500
|
||||
- POST `/devices/system/unms/hostname` — Update devices UISP Key hostname and port. → 200/400/401/403/404/422/500
|
||||
- POST `/devices/system/unms/key` — Update devices UISP Key. → 200/400/401/403/404/422/500
|
||||
- POST `/devices/{deviceId}/speed-tests/start` [deviceId] — Execute speed test on device [device to internet, device to device]. → 200/400/401/403/422/500
|
||||
- POST `/devices/{deviceId}/interfaces/lag` [deviceId] — Create new Lag interface. → 200/400/401/403/404/500
|
||||
- POST `/devices/{deviceId}/interfaces/vlan` [deviceId] — Create new VLAN interface. → 200/400/401/403/404/500
|
||||
- POST `/devices/{deviceId}/interfaces/delete-with-ip-transfer` [deviceId] — Delete interface and transfer its IP configuration to another interface. → 200/400/401/403/404/500
|
||||
- POST `/devices/{id}/system/reset-total-power` [id] — Reset total power consumption. → 200/400/401/403/404/500
|
||||
- POST `/devices/{id}/system/power-cycle` [id] — Turns off selected output for a short time. → 200/400/401/403/404/500
|
||||
- POST `/devices/{deviceId}/interfaces/disablelag` [deviceId] — Disable link aggregation. → 200/400/401/403/404/500/501
|
||||
- POST `/devices/{id}/locate/stop` [id] — Stop locating indication on device. → 200/400/401/403/404/500
|
||||
- POST `/devices/{id}/iplink/redirect` [id] — Perform device authorization before opening a devices UI. → 200/400/401/403/500
|
||||
- POST `/devices/{id}/locate/start` [id] — Start locating indication on device. → 200/400/401/403/404/500
|
||||
- POST `/devices/{deviceId}/interfaces/enablelag` [deviceId] — Enable link aggregation. → 200/400/401/403/404/500/501
|
||||
- POST `/devices/{id}/system/reset-battery-status` [id] — Reset battery status. → 200/400/401/403/404/500
|
||||
- POST `/devices/{deviceId}/interfaces/bridge` [deviceId] — Create new Bridge interface. → 200/400/401/403/404/500
|
||||
- POST `/devices/{deviceId}/interfaces/pppoe` [deviceId] — Create new PPPoE interface. → 200/400/401/403/404/500
|
||||
- POST `/devices/{deviceId}/interfaces/{interfaceName}/reset` [deviceId, interfaceName] — Reset port. → 200/400/401/403/404/500
|
||||
- POST `/devices/{deviceId}/interfaces/{interfaceName}/unblock` [deviceId, interfaceName] — Unblock interface. → 200/400/401/403/404/500
|
||||
- POST `/devices/{id}/router/routes/unblock` [id] — Unblock static route. → 200/400/401/403/404/500
|
||||
- POST `/devices/{id}/router/routes/delete` [id] — Delete route. → 200/400/401/403/404/500
|
||||
- POST `/devices/{deviceId}/interfaces/{interfaceId}/resetstats` [deviceId, interfaceId] — Reset interface statistics. → 200/400/401/403/500
|
||||
- POST `/devices/{id}/router/routes/block` [id] — Block static route. → 200/400/401/403/404/500
|
||||
- POST `/devices/{id}/tools/sms/send` [id] — Sends SMS. → 200/400/401/403/404/500
|
||||
- POST `/devices/{deviceId}/backups/{backupId}/apply` [deviceId, backupId] — Restore the device configuration from a backup file (followed by a device restart if necessary). → 200/400/401/403/404/500
|
||||
- POST `/devices/{deviceId}/interfaces/{interfaceName}/block` [deviceId, interfaceName] — Block interface. → 200/400/401/403/404/500
|
||||
- POST `/devices/{deviceId}/interfaces/{interfaceName}/cable-test` [deviceId, interfaceName] — Cable test port. → 200/400/401/403/404/500
|
||||
- POST `/devices/erouters/{id}/router/routes/block` [id] — Block static route. [Deprecated in favor of route POST /nms/api/v2.1/devices/{id}/router/routes/block] → 200/400/401/403/404/500
|
||||
- POST `/devices/erouters/{id}/router/routes/delete` [id] — Delete route. [Deprecated in favor of route POST /nms/api/v2.1/devices/{id}/router/routes/delete] → 200/400/401/403/404/500
|
||||
- POST `/devices/erouters/{id}/router/routes/unblock` [id] — Unblock static route. [Deprecated in favor of route POST /nms/api/v2.1/devices/{id}/router/routes/unblock] → 200/400/401/403/404/500
|
||||
- POST `/devices/uisprlxcs/{id}/firewall/sets/set` [id] — Create firewall set. → 200/400/401/404/500
|
||||
- PUT `/devices/uisprlxcs/{id}/firewall/sets/set` [id, isComposeRequest?] — Updates firewall set. → 200/400/401/404/500
|
||||
- DELETE `/devices/uisprlxcs/{id}/firewall/sets/set` [id, name, type] — Deletes firewall set. → 200/400/401/404/500
|
||||
- POST `/devices/uisprlxcs/{id}/router/routes/unblock` [id] — Unblock static route. [Deprecated in favor of route POST /nms/api/v2.1/devices/{id}/router/routes/unblock] → 200/400/401/403/404/500
|
||||
- POST `/devices/uisprlxcs/{id}/router/routes/delete` [id] — Delete route. [Deprecated in favor of route POST /nms/api/v2.1/devices/{id}/router/routes/delete] → 200/400/401/403/404/500
|
||||
- POST `/devices/uisprlxcs/{id}/router/routes/block` [id] — Block static route. [Deprecated in favor of route POST /nms/api/v2.1/devices/{id}/router/routes/block] → 200/400/401/403/404/500
|
||||
- POST `/devices/uisprlxcs/{id}/router/ospf/interface` [id] — Create new OSPF Interface. [Deprecated in favor of route PUT /nms/api/v2.1/devices/{deviceId}/interfaces/{interfaceName}/ospf] → 200/400/401/403/404/500
|
||||
- PUT `/devices/uisprlxcs/{id}/router/ospf/interface` [id] — Update OSPF Interface. [Deprecated in favor of route PUT /nms/api/v2.1/devices/{deviceId}/interfaces/{interfaceName}/ospf] → 200/400/401/403/404/500
|
||||
- POST `/devices/uisprlxcs/{id}/firewall/nats/rule` [id] — Create firewall NAT rule. → 200/400/401/404/500
|
||||
- PUT `/devices/uisprlxcs/{id}/firewall/nats/rule` [id] — Updates firewall NAT rule. → 200/400/401/404/500
|
||||
- POST `/devices/uisprs/{id}/firewall/sets/set` [id] — Create firewall set. → 200/400/401/404/500
|
||||
- PUT `/devices/uisprs/{id}/firewall/sets/set` [id, isComposeRequest?] — Updates firewall set. → 200/400/401/404/500
|
||||
- DELETE `/devices/uisprs/{id}/firewall/sets/set` [id, name, type, isComposeRequest?] — Deletes firewall set. → 200/400/401/404/500
|
||||
- POST `/devices/uisprs/{id}/router/routes/unblock` [id] — Unblock static route. [Deprecated in favor of route POST /nms/api/v2.1/devices/{id}/router/routes/unblock] → 200/400/401/403/404/500
|
||||
- POST `/devices/uisprs/{id}/router/routes/delete` [id] — Delete route. [Deprecated in favor of route POST /nms/api/v2.1/devices/{id}/router/routes/delete] → 200/400/401/403/404/500
|
||||
- POST `/devices/uisprs/{id}/router/routes/block` [id] — Block static route. [Deprecated in favor of route POST /nms/api/v2.1/devices/{id}/router/routes/block] → 200/400/401/403/404/500
|
||||
- POST `/devices/uisprs/{id}/router/ospf/interface` [id] — Create new OSPF Interface. [Deprecated in favor of route PUT /nms/api/v2.1/devices/{deviceId}/interfaces/{interfaceName}/ospf] → 200/400/401/403/404/500
|
||||
- PUT `/devices/uisprs/{id}/router/ospf/interface` [id] — Update OSPF Interface. [Deprecated in favor of route PUT /nms/api/v2.1/devices/{deviceId}/interfaces/{interfaceName}/ospf] → 200/400/401/403/404/500
|
||||
- POST `/devices/uisprs/{id}/firewall/nats/rule` [id, isComposeRequest?] — Create firewall NAT rule. → 200/400/401/404/500
|
||||
- PUT `/devices/uisprs/{id}/firewall/nats/rule` [id, isComposeRequest?] — Updates firewall NAT rule. → 200/400/401/404/500
|
||||
- POST `/devices/{id}/system/unms/key/reachable` [id] — Checks if the UISP Key is reachable from the device. → 200/400/401/403/404/500
|
||||
- POST `/devices/{id}/system/unms/hostname/reachable` [id] — Checks if the hostname and port is reachable from the device. → 200/400/401/403/404/500
|
||||
- POST `/devices/erouters/{id}/dhcp/servers/{serverName}/block` [id, serverName] — Block DHCP server. → 200/400/401/403/404/500
|
||||
- POST `/devices/erouters/{id}/dhcp/servers/{serverName}/unblock` [id, serverName] — Unblock DHCP server. → 200/400/401/403/404/500
|
||||
- POST `/devices/uisprlxcs/{id}/firewall/mangles/{mangleName}/rule` [id, mangleName] — Create firewall mangles rule. → 200/400/401/404/500
|
||||
- PUT `/devices/uisprlxcs/{id}/firewall/mangles/{mangleName}/rule` [id, mangleName] — Updates firewall mangle rule. → 200/400/401/404/500
|
||||
- POST `/devices/uisprlxcs/{id}/dhcp/servers/{serverName}/block` [id, serverName] — Block DHCP server. → 200/400/401/403/404/500
|
||||
- POST `/devices/uisprlxcs/{id}/dhcp/servers/{serverName}/unblock` [id, serverName] — Unblock DHCP server. → 200/400/401/403/404/500
|
||||
- POST `/devices/uisprlxcs/{id}/firewall/filters/{filterName}/rule` [id, filterName, isComposeRequest?] — Create firewall filter rule. → 200/400/401/404/500
|
||||
- PUT `/devices/uisprlxcs/{id}/firewall/filters/{filterName}/rule` [id, filterName, isComposeRequest?] — Updates firewall filter rule. → 200/400/401/404/500
|
||||
- POST `/devices/uisprs/{id}/firewall/mangles/{mangleName}/rule` [id, mangleName] — Create firewall mangles rule. → 200/400/401/404/500
|
||||
- PUT `/devices/uisprs/{id}/firewall/mangles/{mangleName}/rule` [id, mangleName] — Updates firewall mangle rule. → 200/400/401/404/500
|
||||
- POST `/devices/uisprs/{id}/dhcp/servers/{serverName}/block` [id, serverName] — Block DHCP server. [Deprecated in favor of route PUT /nms/api/v2.1/devices/{id}/configuration] → 200/400/401/403/404/500
|
||||
- POST `/devices/uisprs/{id}/dhcp/servers/{serverName}/unblock` [id, serverName] — Unblock DHCP server. [Deprecated in favor of route PUT /nms/api/v2.1/devices/{id}/configuration] → 200/400/401/403/404/500
|
||||
- POST `/devices/uisprs/{id}/firewall/filters/{filterName}/rule` [id, filterName, isComposeRequest?] — Create firewall filter rule. → 200/400/401/404/500
|
||||
- PUT `/devices/uisprs/{id}/firewall/filters/{filterName}/rule` [id, filterName, isComposeRequest?] — Updates firewall filter rule. → 200/400/401/404/500
|
||||
- PUT `/devices/onus/{id}/system` [id] — Update an Onu's system settings. [Deprecated in favor of route "/nms/api/v2.1/devices/update-configuration"] → 200/400/401/403/404/500
|
||||
- PUT `/devices/{id}/system/users` [id] — Update device system users. → 200/400/401/403/404/500
|
||||
- PUT `/devices/{id}/compose/confirm` [id, composeId] — Confirm compose request → 200/400/401/403/404/500
|
||||
- PUT `/devices/airmaxes/{id}/system/users` [id] — Update AirMax system users. [Deprecated in favor of route PUT /nms/api/v2.1/devices/{id}/system] → 200/400/401/403/404/500
|
||||
- PUT `/devices/eswitches/{id}/system/users` [id] — Update EdgeSwitch system users. [Deprecated in favor of route PUT /nms/api/v2.1/devices/{id}/system] → 200/400/401/403/404/500
|
||||
- PUT `/devices/toughswitches/{id}/system/users` [id] — Update ToughSwitch system users. [Deprecated in favor of route PUT /nms/api/v2.1/devices/{id}/system] → 200/400/401/403/404/500
|
||||
- PUT `/devices/uispss/{id}/system/users` [id] — Update UISP Switch system users. [Deprecated in favor of route PUT /nms/api/v2.1/devices/{id}/system] → 200/400/401/403/404/500
|
||||
- PUT `/devices/{deviceId}/interfaces/{interfaceName}/ospf` [deviceId, interfaceName] — Set interface OSPF config. → 200/400/401/403/404/500
|
||||
- DELETE `/devices/{deviceId}/interfaces/{interfaceName}/ospf` [deviceId, interfaceName] — Unset interface OSPF config. → 200/400/401/403/404/500
|
||||
- PUT `/devices/uisprlxcs/{id}/firewall/filter/chain` [id, isComposeRequest?] — Update firewall filter chain. Useful for changing rules order. → 200/400/401/404/500
|
||||
- PUT `/devices/uisprlxcs/{id}/firewall/nats/rules` [id] — Updates firewall NAT rules. Useful for changing rules order. → 200/400/401/404/500
|
||||
- PUT `/devices/uisprs/{id}/firewall/filter/chain` [id, isComposeRequest?] — Update firewall filter chain. Useful for changing rules order. → 200/400/401/404/500
|
||||
- PUT `/devices/uisprs/{id}/firewall/nats/rules` [id, isComposeRequest?] — Updates firewall NAT rules. Useful for changing rules order. → 200/400/401/404/500
|
||||
- PUT `/devices/{id}/router/ospf/areas/{areaId}` [id, areaId] — Update OSPF area. → 200/400/401/403/404/500
|
||||
- DELETE `/devices/{id}/router/ospf/areas/{areaId}` [id, areaId] — Delete OSPF area. → 200/400/401/403/404/500
|
||||
- PUT `/devices/erouters/{id}/dhcp/leases/{serverName}/{leaseId}` [id, serverName, leaseId] — Update DHCP IP lease. → 200/400/401/403/404/500
|
||||
- DELETE `/devices/erouters/{id}/dhcp/leases/{serverName}/{leaseId}` [id, serverName, leaseId] — Update DHCP IP lease. → 200/400/401/403/404/500
|
||||
- PUT `/devices/erouters/{id}/router/ospf/areas/{areaId}` [id, areaId] — Update OSPF area. [Deprecated in favor of route PUT /nms/api/v2.1/devices/{id}/router/ospf/areas/{areaId}] → 200/400/401/403/404/500
|
||||
- DELETE `/devices/erouters/{id}/router/ospf/areas/{areaId}` [id, areaId] — Delete OSPF area. [Deprecated in favor of route DELETE /nms/api/v2.1/devices/{id}/router/ospf/areas/{areaId}] → 200/400/401/403/404/500
|
||||
- PUT `/devices/uisprlxcs/{id}/router/ospf/areas/{areaId}` [id, areaId] — Update OSPF area. [Deprecated in favor of route PUT /nms/api/v2.1/devices/{id}/router/ospf/areas/{areaId}] → 200/400/401/403/404/500
|
||||
- DELETE `/devices/uisprlxcs/{id}/router/ospf/areas/{areaId}` [id, areaId] — Delete OSPF area. [Deprecated in favor of route DELETE /nms/api/v2.1/devices/{id}/router/ospf/areas/{areaId}] → 200/400/401/403/404/500
|
||||
- PUT `/devices/uisprlxcs/{id}/dhcp/leases/{serverName}/{leaseId}` [id, serverName, leaseId] — Update DHCP IP lease. → 200/400/401/403/404/500
|
||||
- DELETE `/devices/uisprlxcs/{id}/dhcp/leases/{serverName}/{leaseId}` [id, serverName, leaseId] — Delete DHCP IP lease. → 200/400/401/403/404/500
|
||||
- PUT `/devices/uisprs/{id}/router/ospf/areas/{areaId}` [id, areaId] — Update OSPF area. [Deprecated in favor of route PUT /nms/api/v2.1/devices/{id}/router/ospf/areas/{areaId}] → 200/400/401/403/404/500
|
||||
- DELETE `/devices/uisprs/{id}/router/ospf/areas/{areaId}` [id, areaId] — Delete OSPF area. [Deprecated in favor of route DELETE /nms/api/v2.1/devices/{id}/router/ospf/areas/{areaId}] → 200/400/401/403/404/500
|
||||
- PUT `/devices/uisprs/{id}/dhcp/leases/{serverName}/{leaseId}` [id, serverName, leaseId] — Update DHCP IP lease. [Deprecated in favor of route PUT /nms/api/v2.1/devices/{id}/configuration] → 200/400/401/403/404/500
|
||||
- DELETE `/devices/uisprs/{id}/dhcp/leases/{serverName}/{leaseId}` [id, serverName, leaseId] — Delete DHCP IP lease. [Deprecated in favor of route PUT /nms/api/v2.1/devices/{id}/configuration] → 200/400/401/403/404/500
|
||||
- DELETE `/devices/unknown/{ipAddress}` [ipAddress] — Delete unknown client devices (based on detected network traffic). → 200/400/401/403/500
|
||||
- DELETE `/devices/{id}/stations` [id] — Delete station from this device. → 200/400/401/403/404/500
|
||||
- DELETE `/devices/{id}/vlans/{vlanId}` [id, vlanId, isComposeRequest?] — Delete a device's VLAN. → 200/400/401/403/500
|
||||
- DELETE `/devices/uisprlxcs/{id}/firewall/nats/rule/{ruleId}` [id, ruleId] — Deletes firewall NAT rule. → 200/400/401/404/500
|
||||
- DELETE `/devices/uisprlxcs/{id}/router/ospf/interfaces/{interfaceName}` [id, interfaceName] — Delete OSPF Interface. [Deprecated in favor of route DELETE /nms/api/v2.1/devices/{deviceId}/interfaces/{interfaceName}/ospf] → 200/400/401/403/404/500
|
||||
- DELETE `/devices/uisprs/{id}/firewall/nats/rule/{ruleId}` [id, ruleId, isComposeRequest?] — Deletes firewall NAT rule. → 200/400/401/404/500
|
||||
- DELETE `/devices/uisprs/{id}/router/ospf/interfaces/{interfaceName}` [id, interfaceName] — Delete OSPF Interface. [Deprecated in favor of route DELETE /nms/api/v2.1/devices/{deviceId}/interfaces/{interfaceName}/ospf] → 200/400/401/403/404/500
|
||||
- DELETE `/devices/uisprlxcs/{id}/firewall/filters/{filterName}/rule/{ruleId}` [id, filterName, ruleId, isComposeRequest?] — Deletes firewall filter rule. → 200/400/401/404/500
|
||||
- DELETE `/devices/uisprlxcs/{id}/firewall/mangles/{mangleName}/rule/{ruleId}` [id, mangleName, ruleId] — Deletes firewall mangle rule. → 200/400/401/404/500
|
||||
- DELETE `/devices/uisprs/{id}/firewall/filters/{filterName}/rule/{ruleId}` [id, filterName, ruleId, isComposeRequest?] — Deletes firewall filter rule. → 200/400/401/404/500
|
||||
- DELETE `/devices/uisprs/{id}/firewall/mangles/{mangleName}/rule/{ruleId}` [id, mangleName, ruleId] — Deletes firewall mangle rule. → 200/400/401/404/500
|
||||
|
||||
## Discovery — _Scan for devices and connect them to UISP._
|
||||
|
||||
- GET `/discovery/scan-status` — Get current scan status (payload is WIP). → 200/400/401/500
|
||||
- GET `/discovery/status/{deviceId}` — Get device's discovery status. → 200/400/401/404/500
|
||||
- POST `/discovery/import` — Import devices to discovery. → 200/400/401/500
|
||||
- POST `/discovery/rescan` — Restart scanning process. → 200/400/401/500
|
||||
- POST `/discovery/connect/other` — Start connect process for discovered other devices. → 200/400/401/500
|
||||
- POST `/discovery/connect/ubnt` — Start connect process for discovered UBNT devices. → 200/400/401/500
|
||||
|
||||
## Export — _Client data export._
|
||||
|
||||
- GET `/gdpr/clients/{id}` [id] — Download GDPR Client Report. → 400/401/403/404/500
|
||||
|
||||
## Firmware — _Manage firmware files in UISP._
|
||||
|
||||
- GET `/firmwares` — Fetch available firmware. → 200/401/403/500
|
||||
- POST `/firmwares` — Upload new firmware image. → 200/401/403/500
|
||||
- GET `/firmwares-per-devices` — Fetches current firmware statuses and available firmwares for all devices. → 200/401/403/500
|
||||
- POST `/firmwares/delete` — Batch firmware delete. → 200/401/403/500
|
||||
- POST `/firmwares/download` — Batch firmware download. → 200/401/403/500
|
||||
|
||||
## Gateways — _Setup network device gateways._
|
||||
|
||||
- GET `/gateways` — Get all gateways. → 200/401/403/500
|
||||
- POST `/gateways` — Create a new gateway. → 200/400/401/403/500
|
||||
- GET `/gateways/{id}` — Get gateway detail → 200/401/403/404/500
|
||||
- PUT `/gateways/{id}` [id] — Update a gateway. → 200/400/401/403/404/500
|
||||
- DELETE `/gateways/{id}` [id] — Delete a gateway. → 200/401/403/404/500
|
||||
- GET `/gateways/{id}/speed` [id] — Get current and last 24-hour peak of up/down speed of a gateway → 200/401/403/404/500
|
||||
|
||||
## Logs — _View devices log lines._
|
||||
|
||||
- GET `/logs` [count, page, siteId?, deviceId?, start?, level?, tag?, period?, query?] — List of all log items. → 200/400/401/403/500
|
||||
- POST `/logs/end-alerts` [ids?] — End alerts for log items by log ids. → 200/400/401/403/500
|
||||
|
||||
## Outages — _View devices outages._
|
||||
|
||||
- GET `/outages` [count, page, deviceId?, siteId?, start?, period?, query?, type?, inProgress?, haveEnded?, grouped?] — List of all network outages for last month. → 200/400/401/403/404/500
|
||||
|
||||
## Server — _UISP settings with SMTP configuration, SSL and backups configuration._
|
||||
|
||||
- GET `/nms/address` — Get IP address of the UISP server, resolve hostname if necessary. → 200/401/403/500
|
||||
- GET `/nms/changed` [since, ucrm?] — List of items in UISP that changed since given timestamp. → 200/401/403/500
|
||||
- GET `/nms/cloud-config` — Supply UISP instance cloud config, i.e. notifications, current tier and list of tiers. → 200/401/403/406/500
|
||||
- GET `/nms/connection` — Return UISP Key for UISP server. → 200/401/403/500
|
||||
- GET `/nms/enums` — Return UISP enumerations. → 200/401/403/500
|
||||
- GET `/nms/heartbeat` — Liveness check. → 200/500
|
||||
- GET `/nms/info` [ip?] — Return UISP info. → 200/400/403/405/500/503
|
||||
- GET `/nms/log-verbosity` — Get current server log verbosity. → 200/401/403/500
|
||||
- POST `/nms/log-verbosity` — Change current server log verbosity and generate profile. → 200/401/403/500
|
||||
- GET `/nms/mailserver` — Fetch mail server settings. → 200/401/403/500
|
||||
- PUT `/nms/mailserver` — Update mail server settings. → 200/401/403/500
|
||||
- GET `/nms/notifications` — Get UISP instance notifications. → 200/401/403/412/422/500
|
||||
- PUT `/nms/notifications` — Supply UISP instance notifications. → 200/401/403/412/422/500
|
||||
- GET `/nms/search` [query?, count, page] — Search UISP. → 200/401/403/500
|
||||
- GET `/nms/server-config` — Return UISP server configuration. → 200/500
|
||||
- GET `/nms/server-time` — Get server time of the UISP server. → 200/401/403/500
|
||||
- GET `/nms/settings` — Get UISP settings. → 200/401/403/500
|
||||
- PUT `/nms/settings` — Update UISP settings. → 200/401/403/412/422/500
|
||||
- GET `/nms/setup` — Return status of UISP setup. → 200/500
|
||||
- POST `/nms/setup` — Setup UISP instance. → 200/403/500
|
||||
- GET `/nms/statistics` [interval?, start?, period?] — Get UISP Network statistics. → 200/401/403/406/500
|
||||
- GET `/nms/subscriber` — Get subscriber detail with QoS and device list → 200/400/401/403/404/500
|
||||
- GET `/nms/summary` [outagesTimestamp?, logsTimestamp?, logsLevel, firmwaresTimestamp?] — Various badge-count like values, e.g. unread logs count. → 200/401/403/500
|
||||
- GET `/nms/traffic` — Return netflow traffic status. → 200/401/403/500
|
||||
- GET `/nms/update` — Get UISP update status. → 200/401/403/500/503
|
||||
- PUT `/nms/update` — Request UISP update. → 200/401/403/500/503
|
||||
- GET `/nms/version` — Get UISP version. → 200/500
|
||||
- GET `/nms/dashboard/data` — Various data for dashboard. → 200/401/403/500
|
||||
- GET `/nms/maintenance/backup` — Download data backup. → 401/403/500
|
||||
- PUT `/nms/maintenance/backup` — Upload data backup. → 200/401/403/500
|
||||
- GET `/nms/maintenance/supportinfo` [period] — Download UISP support file. → 401/403/500
|
||||
- GET `/nms/questionnaires/active` — Get currently active questionnaire. → 200/400/401/403/500
|
||||
- GET `/nms/speed/report` [siteId?, sortBy?, sortDesc?, count?, page?] — Results of speed report. → 200/405/500
|
||||
- POST `/nms/speed/report` — Endpoint for reporting speed. Mobile application WiFiman can share speed result for example. → 200/400/401/403/404/405/500
|
||||
- GET `/nms/traffic/blacklist` — Get subnets that are ignored by traffic collection. → 200/401/403/500
|
||||
- POST `/nms/traffic/blacklist` — Set subnets that are ignored by traffic collection. → 200/401/403/500
|
||||
- GET `/nms/traffic/subnets` — Get subnets that are relevant for traffic collection. → 200/401/403/500
|
||||
- POST `/nms/traffic/subnets` — Set subnets that are relevant for traffic collection. → 200/401/403/500
|
||||
- GET `/nms/update/log` — Get latest update log. → 200/401/403/500/503
|
||||
- GET `/nms/version/latest` — Get latest UISP version. → 200/403/500
|
||||
- GET `/nms/maintenance/backup/restore` — Restores uploaded UISP backup file. → 200/401/403/500
|
||||
- DELETE `/nms/maintenance/backup/restore` — Clears uploaded UISP backup file. → 200/401/403/500
|
||||
- GET `/nms/statistics/throughput/{type}/{deviceId}` [deviceId?, type, interval?, start?, period?] — Get Gateway(s) and Olt(s) network activity data for dashboard. → 200/401/403/500
|
||||
- POST `/nms/migrate` — Start migration to enable transfer. → 200/401/403/500
|
||||
- POST `/nms/mailserver/test` — Test mail server settings by sending email. → 200/401/403/500
|
||||
- POST `/nms/setup/finish` — Set UISP setup finished. → 200/500
|
||||
- POST `/nms/setup/start` — Set UISP setup started. → 200/500
|
||||
- POST `/nms/setup/survey` — Submit setup survey. → 200/500
|
||||
- POST `/nms/questionnaires/{id}/touch` [id] — Mark the questionnaire as visited. It will pop up later if it is not submitted. → 200/400/401/403/500
|
||||
- POST `/nms/questionnaires/{id}/submit` [id] — Submit answers to questionnaire. → 200/400/401/403/500
|
||||
- POST `/nms/speed/report/bulkdelete` — Bulk delete speed reports. → 200/400/401/500
|
||||
- POST `/nms/subscriber/device/{deviceId}` [deviceId] — Set device information possessed by subscriber → 200/400/401/403/404/500
|
||||
- POST `/nms/subscriber/station/{mac}` [mac] — Set station information possessed by subscriber → 200/400/401/403/404/500
|
||||
- PUT `/nms/refresh-certificate` — Refresh UISP certificate. → 200/401/403/500
|
||||
- PUT `/nms/settings/allow-unms-beta` — Update UISP allowUnmsBetaVersion settings. → 200/401/403/412/422/500
|
||||
- DELETE `/nms/speed/report/{id}` [id] — Delete speed report. → 200/400/401/403/404/500
|
||||
|
||||
## Sites — _Manage sites and clients (former endpoints), their pictures and network structure._
|
||||
|
||||
- GET `/sites` [id?, ip?, deviceId?, type?, ucrm?, ucrmDetails?] — List of sites in UISP. Only some combinations of query parameters are valid. → 200/400/401/403/500
|
||||
- POST `/sites` — Create new site. → 200/400/401/403/500
|
||||
- GET `/sites-status` — List of sites status. → 200/400/401/403/500
|
||||
- GET `/sites/search` [query?, count, page, type?, ucrm?, latitude?, longitude?] — Search sites based on name, address, MAC address or IP address. → 200/400/401/403/404/500
|
||||
- GET `/sites/traffic` [from, to, granularity] — Get traffic from each site between two points in time. → 200/400/401/403/500
|
||||
- GET `/sites/{id}` [id, ucrmDetails?] — Return a site's detail. → 200/400/401/403/404/500
|
||||
- PUT `/sites/{id}` [id] — Update site. → 200/400/401/403/404/500
|
||||
- DELETE `/sites/{id}` [id] — Delete site. It's possible to call only on empty site. → 200/400/401/403/404/500
|
||||
- GET `/sites/nominatim/proxy` [apiurl?] — Search map position nominatim API proxy. → 200/400/401/403/404/500
|
||||
- GET `/sites/subscribers/statistics` — Get all subscribers statistics → 200/400/401/403/404/500
|
||||
- GET `/sites/{siteId}/historicalStatistics` [siteId, interval, start?, period?, tableLimit?, tablePage?, sortBy?, sortOrder?, type?] — Get historical stats for site graphs. → 200/400/401/403/404/500
|
||||
- GET `/sites/{siteId}/statistics` [siteId, interval] — Get upload and download between site and its parent site → 200/400/401/403/404/500
|
||||
- GET `/sites/{siteId}/traffic` [siteId, from, to, granularity] — Get site traffic between two points in time. → 200/400/401/403/500
|
||||
- GET `/sites/{id}/clients` [id, recursive?] — List of all client site ids belonging to the given site or to the given site's subtree. → 200/400/401/403/404/500
|
||||
- GET `/sites/{id}/uplink-devices` [id, withStatistics?, interval] — Return a site's uplink devices with scores. → 200/400/401/403/404/500
|
||||
- GET `/sites/{id}/images` [id] — Return all site images sorted by image order. → 200/400/401/403/500
|
||||
- POST `/sites/{id}/images` [id] — Upload new image and create image thumbnail. → 200/400/401/403/500
|
||||
- GET `/sites/{siteId}/qos` [siteId] — Get client Traffic Shaping. → 200/400/401/403/404/500
|
||||
- PUT `/sites/{siteId}/qos` [siteId] — Update client Traffic Shaping. → 200/400/401/403/404/500
|
||||
- GET `/sites/{siteId}/traffic/summary` [siteId, interval] — Get site total upload and download for specified interval up to now. → 200/400/401/403/500
|
||||
- GET `/sites/{siteId}/images/{imageId}` [siteId, imageId] — Return image file. → 400/401/403/500
|
||||
- DELETE `/sites/{siteId}/images/{imageId}` [siteId, imageId] — Delete image. → 200/400/401/403/500
|
||||
- PATCH `/sites/{siteId}/images/{imageId}` [siteId, imageId] — Update image. → 200/400/401/403/500
|
||||
- GET `/sites/{siteId}/traffic/interval` [siteId, interval, granularity] — Get site traffic for specified interval up to now. → 200/400/401/403/500
|
||||
- POST `/sites/authorize-onu-bulk` — Create subscriber for every ONU and authorize. → 200/400/401/403/500
|
||||
- POST `/sites/bulkdelete` — Delete sites. It's possible to call only on empty sites. → 200/400/401/403/500
|
||||
- POST `/sites/devicesiterelations` [forceCreate?] — Import sites and their devices relations. → 200/400/401/403/500
|
||||
- DELETE `/sites/devicesiterelations` — Import sites/endpoints and their devices relations. → 200/400/401/403/500
|
||||
- POST `/sites/devicesubscriberrelations` [forceCreate?] — Import subscribers and their devices relations. → 200/400/401/403/500
|
||||
- POST `/sites/bulkupdate/notifications` — Update sites notifications. → 200/400/401/403/500
|
||||
- POST `/sites/ucrm/bindings` — Import UISP sites to UCRM services relations description. → 200/400/401/403/500
|
||||
- POST `/sites/{siteId}/unsuspend` [siteId] — Unsuspend client. → 200/400/401/403/404/500
|
||||
- POST `/sites/{subscriberId}/preregister` [subscriberId] — Set subscriber to MAC/IP address pairing for auto-authorize functionality. → 200/400/401/403/500
|
||||
- POST `/sites/{siteId}/suspend` [siteId] — Suspend client. → 200/400/401/403/404/500
|
||||
- POST `/sites/{siteId}/ucrm/unbind` [siteId] — Unbind UCRM services and UISP site. → 200/400/401/403/500
|
||||
- POST `/sites/{siteId}/ucrm/bind` [siteId] — Bind UCRM services and UISP site. → 200/400/401/403/500
|
||||
- POST `/sites/{siteId}/images/{imageId}/reorder` [siteId, imageId] — Change image order. → 200/400/401/403/500
|
||||
- POST `/sites/{siteId}/images/{imageId}/rotateleft` [siteId, imageId] — Rotate the image 90 degrees to left. → 200/400/401/403/500
|
||||
- POST `/sites/{siteId}/images/{imageId}/rotateright` [siteId, imageId] — Rotate the image 90 degrees to right. → 200/400/401/403/500
|
||||
|
||||
## Speed Test — _Speedtest between device to device or device to internet._
|
||||
|
||||
- GET `/speed-tests` — Return detail about running speedtests. → 200/401/403/500
|
||||
- GET `/devices/{deviceId}/speed-tests/{testId}` [deviceId, testId] — Return detail about running speedtest. → 200/401/403/422/500
|
||||
- DELETE `/devices/{deviceId}/speed-tests/{testId}` [deviceId, testId] — Stop speed test. → 200/400/401/403/404/422/500
|
||||
- POST `/speed-tests/start` — Execute speed test between two devices. → 200/400/401/403/500
|
||||
- POST `/devices/{deviceId}/speed-tests/start` [deviceId] — Execute speed test on device [device to internet, device to device]. → 200/400/401/403/422/500
|
||||
- DELETE `/speed-tests/{id}` [id] — Stop speed test between two devices. → 200/400/401/403/404/500
|
||||
|
||||
## Tasks — _View, start or cancel UISP background tasks, for example firmware upgrade._
|
||||
|
||||
- GET `/tasks` [count, page, status?, period?] — List all tasks. → 200/401/403/500
|
||||
- POST `/tasks` — Start FW upgrade task for a group of devices. → 200/400/401/403/404/500
|
||||
- GET `/tasks/device-status-numbers-by-roles` — Return number of devices firmware upgrade status by roles. → 200/401/403/500
|
||||
- GET `/tasks/in-progress` — Return number of tasks in progress state. → 200/401/403/500
|
||||
- GET `/tasks/prepare-auto-updates` — Construct tasks for auto updates. → 200/401/403/500
|
||||
- GET `/tasks/{batchId}` [batchId] — Returns a mass upgrade task inner task items. → 200/400/401/403/404/500
|
||||
- POST `/tasks/cancel-for-device/{deviceId}` [deviceId] — Cancel a task for device. → 200/400/401/403/404/500
|
||||
- POST `/tasks/{batchId}/cancel` [batchId] — Cancel a task. → 200/400/401/403/404/500
|
||||
|
||||
## Token — _Manage access tokens._
|
||||
|
||||
- GET `/token` — Get all API tokens. → 200/401/403/409/500
|
||||
- POST `/token` — Create new API token. → 200/400/401/403/500
|
||||
- GET `/token/{tokenId}` [tokenId] — Get API token by ID. → 200/401/403/404/409/500
|
||||
- DELETE `/token/{tokenId}` [tokenId] — Delete API token. → 200/400/401/403/409/500
|
||||
|
||||
## Traffic — _Devices and clients traffic statistics generated thanks to NetFlow._
|
||||
|
||||
- GET `/devices/unknown` [minTraffic?] — Get unknown client devices (based on detected network traffic) ordered by total traffic. → 200/400/401/403/500
|
||||
- GET `/nms/traffic` — Return netflow traffic status. → 200/401/403/500
|
||||
- GET `/sites/traffic` [from, to, granularity] — Get traffic from each site between two points in time. → 200/400/401/403/500
|
||||
- GET `/nms/traffic/blacklist` — Get subnets that are ignored by traffic collection. → 200/401/403/500
|
||||
- POST `/nms/traffic/blacklist` — Set subnets that are ignored by traffic collection. → 200/401/403/500
|
||||
- GET `/nms/traffic/subnets` — Get subnets that are relevant for traffic collection. → 200/401/403/500
|
||||
- POST `/nms/traffic/subnets` — Set subnets that are relevant for traffic collection. → 200/401/403/500
|
||||
- GET `/sites/{siteId}/traffic` [siteId, from, to, granularity] — Get site traffic between two points in time. → 200/400/401/403/500
|
||||
- GET `/sites/{siteId}/traffic/summary` [siteId, interval] — Get site total upload and download for specified interval up to now. → 200/400/401/403/500
|
||||
- GET `/sites/{siteId}/traffic/interval` [siteId, interval, granularity] — Get site traffic for specified interval up to now. → 200/400/401/403/500
|
||||
- POST `/nms/migrate` — Start migration to enable transfer. → 200/401/403/500
|
||||
- DELETE `/devices/unknown/{ipAddress}` [ipAddress] — Delete unknown client devices (based on detected network traffic). → 200/400/401/403/500
|
||||
|
||||
## Users — _Manage UISP users and their profiles._
|
||||
|
||||
- GET `/user` — Get the authenticated user. → 200/401/403/500
|
||||
- PUT `/user` — Updates authenticated user. → 200/400/401/403/500
|
||||
- GET `/users` — Return list of all users. → 200/401/403/500
|
||||
- GET `/nms/keep-alive` — Extend validity of user token. → 200/500
|
||||
- GET `/user/notifications/push` — Read user push notifications settings route. → 200/401/403/500
|
||||
- PATCH `/user/notifications/push` — Save user push notifications settings route. → 200/400/401/403/500
|
||||
- GET `/user/offline-passwords/requested` — Show status if offline passwords request is present for user. → 200/401/403/404/500
|
||||
- GET `/user/password/is-token-valid` [token] — Checks if token for password reset is valid. → 200/400/403/500
|
||||
- POST `/user/check-credentials` — Check user credentials. → 200/400/401/403/500
|
||||
- POST `/user/check-session` — Check that the session token and cookie are valid. → 200/401/403/500
|
||||
- POST `/user/location` — Updates user's location. → 200/400/401/403/500
|
||||
- POST `/user/offline-passwords` — Generates random offline passwords for user. → 200/401/403/500
|
||||
- POST `/users/invite` — Invite new user. → 200/400/401/403/500
|
||||
- POST `/user/offline-passwords/confirm` — Confirms request to generate random offline passwords for authenticated user. → 200/401/403/404/500
|
||||
- POST `/user/password/requestreset` — Request password reset. → 200/400/403/500
|
||||
- POST `/user/password/reset` — Reset user password. → 200/400/401/500
|
||||
- POST `/users/{id}/reinvite` [id] — Reinvites user by email. → 200/400/401/403/500
|
||||
- POST `/users/{id}/reinvite/link` [id] — Generates new invitation link. → 200/400/401/403/500
|
||||
- PUT `/user/preferences` — Updates authenticated user's preferences. → 200/400/401/403/500
|
||||
- PUT `/users/{id}` [id] — Update user. → 200/400/401/403/500
|
||||
- DELETE `/users/{id}` [id, notifyUser?] — Delete user. → 200/400/401/403/404/500
|
||||
|
||||
## Vault — _Device credentials vault._
|
||||
|
||||
- GET `/vault/credentials` — Get credentials vault status. → 200/401/403/500
|
||||
- POST `/vault/credentials` — Update credentials vault status. → 200/400/401/403/404/500
|
||||
- GET `/vault/{deviceId}/credentials` [deviceId] — Get device credentials. → 200/400/401/403/500
|
||||
- POST `/vault/credentials/bulk-regenerate` — Bulk set new passwords for devices. → 200/400/401/403/404/412/500
|
||||
- POST `/vault/credentials/devices` — Get devices' credentials → 200/400/401/403/500
|
||||
- POST `/vault/credentials/regenerate` — Generate new password for vault. Returns status. → 200/400/401/403/404/412/500
|
||||
- POST `/vault/credentials/unlock` — Unlock private or cloud pgp key. → 200/400/401/403/404/500
|
||||
- POST `/vault/{deviceId}/credentials/change` [deviceId] — Changing vault device password for mobile app. → 200/400/401/403/404/412/500
|
||||
- POST `/vault/{deviceId}/credentials/regenerate` [deviceId] — Generate or set new password for device. → 200/400/401/403/404/412/500
|
||||
93
INDEX_api_used.md
Executable file
93
INDEX_api_used.md
Executable file
@ -0,0 +1,93 @@
|
||||
# INDEX_api_used.md — Llamadas API que el plugin ya hace
|
||||
> Referencia rápida de todas las llamadas API usadas en `public.php`, `Plugin.php` y sus dependencias.
|
||||
> Para bugs o modificaciones en llamadas existentes, este archivo evita leer los archivos de referencia API completos.
|
||||
|
||||
---
|
||||
|
||||
## API UCRM (CRM v1.0)
|
||||
**Base URL:** `https://{ipserver}/crm/api/v1.0/`
|
||||
**Auth:** Header `X-Auth-App-Key: {apitoken}` (SDK) o `X-Auth-Token: {apitoken}` (Guzzle directo)
|
||||
|
||||
| Endpoint | Método | Usado en | Parámetros / Body |
|
||||
|---|---|---|---|
|
||||
| `clients` | GET | public.php, PaymentIntentService | `query, limit, offset` |
|
||||
| `clients/{id}` | GET | Plugin.php, Facades, PaymentIntentService | — |
|
||||
| `clients/{id}` | PATCH | AbstractMessageNotifierFacade | `{attributes: [{value, customAttributeId}]}` |
|
||||
| `clients/services` | GET | AbstractMessageNotifierFacade | `?clientId={id}` |
|
||||
| `users/admins` | GET | public.php | — |
|
||||
| `users/admins/{id}` | GET | AbstractMessageNotifierFacade | — |
|
||||
| `payments` | GET | public.php | `clientId, limit, order, direction` |
|
||||
| `payments/{id}` | GET | public.php (resend_payment) | — |
|
||||
| `payments` | POST | AbstractStripeOperationsFacade | `{clientId, amount, currencyCode, methodId, note}` |
|
||||
| `payment-methods` | GET | public.php | — |
|
||||
| `scheduling/jobs` | GET | public.php | `assignedUserId, statuses[], limit` |
|
||||
| `scheduling/jobs/{id}` | GET | public.php (resend_job) | — |
|
||||
| `scheduling/jobs/{id}` | PATCH | Plugin.php, AbstractMessageNotifierFacade | `{title}` |
|
||||
| `client-attributes` | GET | AbstractStripeOperationsFacade | — (busca IDs de atributos custom) |
|
||||
| `invoices/{id}` | GET | AbstractStripeOperationsFacade | — |
|
||||
|
||||
---
|
||||
|
||||
## API NMS/UNMS (v2.1)
|
||||
**Base URL:** `https://{ipserver}/nms/api/v2.1/`
|
||||
**Auth:** Header `X-Auth-Token: {unmsApiToken}`
|
||||
|
||||
| Endpoint | Método | Usado en | Parámetros / Body |
|
||||
|---|---|---|---|
|
||||
| `user/login` | POST | public.php (nms_login) | `{username, password}` |
|
||||
| `user/login/totpauth` | POST | public.php (nms_login_totp) | `{twoFactorToken, totpCode}` |
|
||||
| `user` | GET | public.php (nms_verify_session) | Header `x-auth-token` |
|
||||
| `devices` | GET | AbstractMessageNotifierFacade | `?siteId={id}` |
|
||||
| `vault/{deviceId}/credentials` | GET | AbstractMessageNotifierFacade | Header `X-Auth-Token` |
|
||||
| `vault/{deviceId}/credentials/regenerate` | POST | AbstractMessageNotifierFacade | `[{username, password, readOnly}]` |
|
||||
|
||||
---
|
||||
|
||||
## API Stripe
|
||||
**Lib:** `stripe/stripe-php` SDK
|
||||
**Auth:** `stripeApiKey` (del config)
|
||||
|
||||
| Recurso Stripe | Operación | Usado en | Parámetros relevantes |
|
||||
|---|---|---|---|
|
||||
| `paymentIntents.create` | POST | PaymentIntentService, AbstractStripeOperationsFacade | `amount, currency, customer, payment_method_types, metadata` |
|
||||
| `paymentIntents.all` | GET | PaymentIntentService | `customer, limit, expand:[data.charges]` |
|
||||
| `paymentIntents.retrieve` | GET | AbstractStripeOperationsFacade | `id` |
|
||||
| `customers.create` | POST | AbstractStripeOperationsFacade | `name, email, metadata:{clientId}` |
|
||||
| `customers.retrieve` | GET | AbstractStripeOperationsFacade | `id` |
|
||||
| `customers.update` | POST | AbstractStripeOperationsFacade | `name, email` |
|
||||
| `customers.retrieveCashBalance` | GET | PaymentIntentService | `stripeCustomerId` |
|
||||
| `customers.createFundingInstructions` | POST | AbstractStripeOperationsFacade | `currency, funding_type, bank_transfer:{type:mx_bank_transfer}` |
|
||||
|
||||
---
|
||||
|
||||
## API Callbell
|
||||
**Base URL:** `https://api.callbell.eu/v1/`
|
||||
**Auth:** Header `Authorization: Bearer {tokencallbell}`
|
||||
**Usado en:** `ClientCallBellAPI.php`
|
||||
|
||||
| Endpoint | Método | Descripción |
|
||||
|---|---|---|
|
||||
| `contacts` | GET | Busca contacto por teléfono |
|
||||
| `contacts/{uuid}` | PATCH | Actualiza datos del contacto (nombre, custom fields) |
|
||||
| `messages/send` | POST | Envía mensaje / plantilla WhatsApp |
|
||||
|
||||
---
|
||||
|
||||
## Llamadas HTTP directas (cURL/Guzzle sin SDK)
|
||||
|
||||
| Destino | Método | Usado en | Descripción |
|
||||
|---|---|---|---|
|
||||
| `self URL` (loopback) | POST | public.php `resend_payment`, `resend_job_notification` | Simula webhook reenviando JSON al mismo `public.php` |
|
||||
| `http://{ipPuppeteer}:{portPuppeteer}/generate` | POST | AbstractOxxoOperationsFacade | Genera imagen de voucher OXXO via Puppeteer |
|
||||
| MinIO presigned URL | PUT | MinioStorageService | Sube imagen del voucher generado |
|
||||
|
||||
---
|
||||
|
||||
## Atributos Custom de Cliente en UCRM que el plugin usa
|
||||
| Clave (`key`) | Nombre en UI | Usado para |
|
||||
|---|---|---|
|
||||
| `stripeCustomerId` | Stripe Customer ID | ID del customer en Stripe |
|
||||
| `clabeInterbancaria` | Clabe Interbancaria | CLABE para transferencias MX |
|
||||
| `passwordAntenaCliente` | Password Antena Cliente | Contraseña de la antena del cliente (desde UNMS vault) |
|
||||
| `antenaSectorial` | Antena Sectorial | Tipo de antena (usado en audit de passwords) |
|
||||
| `site` | Site | ID del sitio UNMS asociado al servicio |
|
||||
230
INDEX_deps.md
Executable file
230
INDEX_deps.md
Executable file
@ -0,0 +1,230 @@
|
||||
# INDEX_deps.md — Facades y Services
|
||||
> Firmas y propósito de todas las dependencias usadas por `public.php` y `Plugin.php`
|
||||
|
||||
---
|
||||
|
||||
## src/Facade/
|
||||
|
||||
### AbstractMessageNotifierFacade (abstract) — L.1–537
|
||||
`src/Facade/AbstractMessageNotifierFacade.php`
|
||||
Base de todas las facades. Maneja lógica de notificación via Callbell/WhatsApp.
|
||||
|
||||
**Constantes:**
|
||||
- `SUBJECT_OF_INSTALLER_CHANGE[]` — textos para notificar cambio/desasignación de técnico
|
||||
- `ADDITIONAL_CHANGE_DATA[]` — datos adicionales del cambio de técnico
|
||||
|
||||
**Constructor:** `(Logger, MessageTextFactory, SmsNumberProvider)` + carga `$ucrmApi` desde config
|
||||
|
||||
**Métodos públicos:**
|
||||
| Método | Descripción |
|
||||
|---|---|
|
||||
| `verifyPaymentActionToDo(NotificationData): void` | Itera teléfonos por tipo (whatsapp/whatsnotifica/whatsactualiza) y llama notify/update |
|
||||
| `verifyClientActionToDo(NotificationData): void` | Solo `onlyUpdate()` para tipos whatsapp/whatsactualiza |
|
||||
| `verifyServiceActionToDo(NotificationData): void` | `onlyUpdateService()` para tipos whatsapp/whatsactualiza |
|
||||
| `verifyJobActionToDo($jsonData, $reprog, $changeInstaller): void` | Notifica instalador anterior, cliente y técnico nuevo; gestiona título del job |
|
||||
| `verifyInvoiceActionToDo(NotificationData): void` | `onlyUpdate()` sin mostrar balance |
|
||||
| `notify(NotificationData, $phone): void` | Envía notificación de pago vía Callbell (texto o plantilla) |
|
||||
| `notifyAndUpdate(NotificationData, $phone): void` | Notifica + hace PATCH en Callbell |
|
||||
| `notifyOverDue(NotificationData): void` | Notifica factura vencida/por vencer |
|
||||
| `onlyUpdate(NotificationData, $phone): void` | Solo actualiza contacto en Callbell (sin enviar mensaje) |
|
||||
| `onlyUpdateService(NotificationData, $phone): void` | Actualiza status de servicio en Callbell |
|
||||
|
||||
**Métodos protegidos:**
|
||||
| Método | Descripción |
|
||||
|---|---|
|
||||
| `getVaultCredentialsByClientId($clientId): string` | Obtiene pass de antena desde UNMS vault; sincroniza en CRM. Usa `GET /nms/api/v2.1/devices?siteId=` y `GET /nms/api/v2.1/vault/{deviceId}/credentials` |
|
||||
| `syncPasswordWithCrm(int $clientId, string $pass): void` | PATCH atributo `passwordAntenaCliente` en CRM si difiere |
|
||||
| `generateStrongPassword(int $length=16): string` | Genera contraseña segura (lower+upper+digits+@#) |
|
||||
| `patchClientCustomAttribute(int $clientId, int $attributeId, string $value): bool` | PATCH `clients/{id}` con atributo custom |
|
||||
| `comparePasswords(?string $crm, ?string $vault): string` | Prioriza vault, luego crm, luego mensaje de advertencia |
|
||||
| `validarNumeroTelefono($n): string` | Normaliza teléfono a formato internacional 521XXXXXXXXXX |
|
||||
|
||||
**Abstracto:** `sendWhatsApp(NotificationData, string $phone): void`
|
||||
|
||||
---
|
||||
|
||||
### PluginNotifierFacade extends AbstractStripeOperationsFacade
|
||||
`src/Facade/PluginNotifierFacade.php` — L.1–152
|
||||
|
||||
**Herencia:** `PluginNotifierFacade → AbstractStripeOperationsFacade → AbstractOxxoOperationsFacade → AbstractMessageNotifierFacade`
|
||||
|
||||
**Constructor:** `(Logger, MessageTextFactory, SmsNumberProvider, OptionsManager)` — carga `$pluginData`
|
||||
|
||||
**Métodos propios:**
|
||||
| Método | Descripción |
|
||||
|---|---|
|
||||
| `updatePasswordAntenaIfNeeded(int $clientId, array $jsonData): void` | Llama `getVaultCredentialsByClientId()` — sincroniza pass antena |
|
||||
| `processClientPasswordAntenna(int $clientId, array $clientEntity): void` | Procesa tag "OBTENER PASSWORD ANTENA": incluye `scripts-uisp/audit_client_passwords.php`, llama `fixClientData()`, remueve tag |
|
||||
| `sendWhatsApp(NotificationData, string $phone): void` | Implementación mock (solo log) |
|
||||
|
||||
**Métodos heredados de AbstractStripeOperationsFacade** (ver abajo):
|
||||
- `createPaymentIntent()`, `registerPaymentFromWebhook()`, `registerPaymentFromIntent()`
|
||||
- `ensureStripePaymentAttribute()`, `createStripeClient()`, `syncStripeCustomerData()`
|
||||
- `createClabeForClient()`, `removeTagFromClient()`
|
||||
|
||||
---
|
||||
|
||||
### AbstractStripeOperationsFacade (abstract)
|
||||
`src/Facade/AbstractStripeOperationsFacade.php` — ~45KB
|
||||
|
||||
Hereda de `AbstractOxxoOperationsFacade`. Maneja toda la integración con Stripe y registro de pagos en UCRM.
|
||||
|
||||
**Métodos clave** (firmas aproximadas):
|
||||
| Método | Descripción |
|
||||
|---|---|
|
||||
| `createPaymentIntent(array $jsonData): void` | Crea PaymentIntent en Stripe desde webhook `customer_cash_balance_transaction.funded` |
|
||||
| `registerPaymentFromWebhook(array $jsonData): void` | Registra pago en UCRM desde webhook `applied_to_payment` |
|
||||
| `registerPaymentFromIntent(array $piData): void` | Registra pago en UCRM desde `payment_intent.succeeded` |
|
||||
| `ensureStripePaymentAttribute(NotificationData $n): void` | Determina si el pago Stripe es OXXO, Transferencia o Tarjeta revisando metadata |
|
||||
| `createStripeClient(NotificationData $n, string $tag, bool $createClabe): void` | Crea cliente en Stripe + opcionalmente genera CLABE |
|
||||
| `syncStripeCustomerData(int $clientId, string $name, ?string $email): void` | Actualiza nombre/email del customer en Stripe |
|
||||
| `removeTagFromClient(int $clientId, string $tagName): void` | Elimina tag del cliente en UCRM |
|
||||
|
||||
---
|
||||
|
||||
### AbstractOxxoOperationsFacade (abstract)
|
||||
`src/Facade/AbstractOxxoOperationsFacade.php` — ~31KB
|
||||
|
||||
Maneja la integración OXXO Pay con Stripe y generación de vouchers.
|
||||
|
||||
**Métodos clave:**
|
||||
| Método | Descripción |
|
||||
|---|---|
|
||||
| `createStripeReference(array $jsonData, ?float $amount): array` | Crea PaymentIntent OXXO en Stripe. Retorna `{hasError, data:{oxxo_reference, url, clientID, clientFullName, amount}}` |
|
||||
| `createOxxoOrder(array $oxxoData): array` | Guarda orden OXXO en storage local. Retorna `{order_id, oxxo_reference, url, ...}` |
|
||||
| `generateOxxoVoucher(array $responseOxxo, bool $background): void` | Llama a Puppeteer para generar imagen del voucher y subirla a MinIO |
|
||||
| `getOxxoOrderStatus(string $orderId): array` | Retorna estado actual de la orden OXXO |
|
||||
| `createOxxoPaymentIntent(array $clientData, float $amount, bool $notify): array` | Flujo completo: crea PI Stripe OXXO + orden + voucher |
|
||||
|
||||
---
|
||||
|
||||
### PluginOxxoNotifierFacade extends AbstractOxxoOperationsFacade
|
||||
`src/Facade/PluginOxxoNotifierFacade.php` — pequeño
|
||||
|
||||
Solo implementa los métodos abstractos. No agrega lógica propia relevante.
|
||||
|
||||
---
|
||||
|
||||
### TwilioNotifierFacade extends AbstractMessageNotifierFacade
|
||||
`src/Facade/TwilioNotifierFacade.php` — ~2KB
|
||||
|
||||
Implementa `sendWhatsApp()` usando Twilio (legacy, en desuso). Métodos notificación estándar delegados a la clase base.
|
||||
|
||||
---
|
||||
|
||||
### ClientCallBellAPI
|
||||
`src/Facade/ClientCallBellAPI.php` — ~81KB
|
||||
|
||||
Cliente completo de la API de Callbell. Usado internamente por las facades vía `new ClientCallBellAPI($apitoken, $ipserver, $tokencallbell)`.
|
||||
|
||||
**Métodos clave relevantes para el plugin:**
|
||||
| Método | Descripción |
|
||||
|---|---|
|
||||
| `sendPaymentNotificationWhatsApp($phone, NotificationData): bool` | Envía plantilla de pago con template de Callbell |
|
||||
| `sendTextPaymentNotificationWhatsApp($phone, NotificationData): bool` | Envía texto plano de pago |
|
||||
| `sendOverdueNotificationWhatsApp($phone, NotificationData): bool` | Notificación de factura vencida |
|
||||
| `sendJobNotificationWhatsAppToClient($phone, array $data, $reprog, $changeInst): bool` | Notificación de job al cliente |
|
||||
| `sendJobNotificationWhatsAppToInstaller($phone, array $data, $reprog, $changeInst): void` | Notificación de job al técnico |
|
||||
| `getContactWhatsapp($phone): string` | GET contacto en Callbell por teléfono → JSON |
|
||||
| `patchWhatsapp(array $contact, NotificationData): void` | PATCH datos del contacto en Callbell |
|
||||
| `patchServiceStatusWhatsApp(array $contact, NotificationData): void` | PATCH status de servicio en Callbell |
|
||||
|
||||
---
|
||||
|
||||
## src/Service/
|
||||
|
||||
### PaymentIntentService
|
||||
`src/Service/PaymentIntentService.php` — 282 líneas
|
||||
|
||||
Usado directamente en `public.php` (no via DI). Constructor: `($ucrmApi, $stripeApiKey, $logger=null)`
|
||||
|
||||
| Método | Descripción |
|
||||
|---|---|
|
||||
| `searchClients($query): array` | UCRM `GET clients?query=q&limit=5` — retorna array simplificado |
|
||||
| `getClientDetails($clientId): array` | UCRM `GET clients/{id}` — retorna datos + stripeCustomerId + clabeInterbancaria |
|
||||
| `createPaymentIntent($clientId, $amount, $stripeCustomerId, $adminId): array` | Crea PI Stripe tipo `customer_balance/bank_transfer/mx_bank_transfer` |
|
||||
| `getLastPayments($stripeCustomerId, $limit=10): array` | Stripe `paymentIntents.all` filtrado a bank_transfer — últimos N |
|
||||
| `getLastOxxoPayments($stripeCustomerId, $limit=5): array` | Stripe `paymentIntents.all` filtrado a OXXO — últimos N |
|
||||
| `getCustomerCashBalance($stripeCustomerId): float` | Stripe `customers.retrieveCashBalance` → MXN |
|
||||
|
||||
---
|
||||
|
||||
### SmsNumberProvider
|
||||
`src/Service/SmsNumberProvider.php` — 160 líneas
|
||||
|
||||
| Método | Descripción |
|
||||
|---|---|
|
||||
| `getUcrmClientNumber(NotificationData): ?string` | Primer contacto con tipo aplicable al evento |
|
||||
| `getUcrmClientNumbers(NotificationData?, array?): array` | Retorna `['whatsapp'=>[phones], 'whatsnotifica'=>[phones], 'whatsactualiza'=>[phones]]` |
|
||||
| `getAllUcrmClientNumbers(array): array` | Todos los teléfonos del cliente sin filtrar por tipo |
|
||||
|
||||
**Tipos de contacto reconocidos:**
|
||||
- `whatsapp` — recibe notificación + actualización en Callbell
|
||||
- `whatsnotifica` — solo recibe notificación (no actualiza Callbell)
|
||||
- `whatsactualiza` — solo actualiza Callbell (no notifica)
|
||||
|
||||
---
|
||||
|
||||
### Logger (`src/Service/Logger.php`)
|
||||
Wrapper de PSR-3. Métodos: `debug()`, `info()`, `warning()`, `error()`. Nivel controlado por config `logging_level` / `debugMode`.
|
||||
|
||||
### OptionsManager (`src/Service/OptionsManager.php`)
|
||||
Carga config del plugin. Método: `load(): PluginData`
|
||||
|
||||
### PluginDataValidator (`src/Service/PluginDataValidator.php`)
|
||||
Valida que la configuración esté completa. Método: `validate(): bool`
|
||||
|
||||
### MinioStorageService (`src/Service/MinioStorageService.php`)
|
||||
Sube vouchers OXXO a MinIO. Usado por `AbstractOxxoOperationsFacade`.
|
||||
|
||||
### CurlExecutor (`src/Service/CurlExecutor.php`)
|
||||
Wrapper de cURL para la `UcrmApi` interna del plugin.
|
||||
|
||||
---
|
||||
|
||||
## src/Data/
|
||||
|
||||
### PluginData (extends UcrmData)
|
||||
`src/Data/PluginData.php` — Propiedades de configuración del plugin:
|
||||
|
||||
| Propiedad | Tipo | Descripción |
|
||||
|---|---|---|
|
||||
| `$ipserver` | string | IP/hostname del servidor UISP |
|
||||
| `$apitoken` | string | Token API UCRM |
|
||||
| `$unmsApiToken` | string | Token API UNMS/NMS |
|
||||
| `$tokencallbell` | string | Token API Callbell |
|
||||
| `$tokenstripe` | string | API Key Stripe |
|
||||
| `$ipPuppeteer` | string | IP del microservicio Puppeteer |
|
||||
| `$portPuppeteer` | string | Puerto del microservicio Puppeteer |
|
||||
| `$idPaymentAdminCRM` | string | ID admin para registrar pagos |
|
||||
| `$cashPaymentMethodId` | bool | Habilitar notif. efectivo |
|
||||
| `$courtesyPaymentMethodId` | bool | Habilitar notif. cortesía |
|
||||
| `$bankTransferPaymentMethodId` | bool | Habilitar notif. transferencia |
|
||||
| `$oxxoPayPaymentMethodId` | bool | Habilitar notif. OXXO |
|
||||
| `$creditCardStripePaymentMethodId` | bool | Habilitar notif. tarjeta Stripe |
|
||||
| `$stripeSubscriptionCreditCardPaymentMethodId` | bool | Habilitar notif. suscripción Stripe |
|
||||
| `$notificationTypeText` | bool | true=texto plano, false=plantilla Callbell |
|
||||
| `$installersDataWhatsApp` | string | JSON de instaladores |
|
||||
| `$debugMode` | bool | Activa logging DEBUG |
|
||||
| `$logging_level` | bool | Nivel verbose de log |
|
||||
| `$twilioAccountSid` | string\|null | Legacy Twilio |
|
||||
| `$twilioAuthToken` | string\|null | Legacy Twilio |
|
||||
| `$twilioSmsNumber` | string\|null | Legacy Twilio |
|
||||
|
||||
### NotificationData
|
||||
`src/Data/NotificationData.php`
|
||||
DTO con propiedades: `$uuid`, `$changeType`, `$entity`, `$entityId`, `$eventName`, `$clientId`, `$clientData[]`, `$paymentData[]`, `$invoiceData[]`
|
||||
|
||||
---
|
||||
|
||||
## src/Factory/
|
||||
|
||||
### NotificationDataFactory
|
||||
`src/Factory/NotificationDataFactory.php` — 5.8KB
|
||||
| Método | Descripción |
|
||||
|---|---|
|
||||
| `getObject(array $jsonData): NotificationData` | Construye `NotificationData` desde el payload del webhook UCRM, cargando datos adicionales de la API |
|
||||
|
||||
### MessageTextFactory
|
||||
`src/Factory/MessageTextFactory.php` — 3.7KB
|
||||
Genera textos de mensajes WhatsApp. Usado por las facades para construir el contenido de notificaciones.
|
||||
112
INDEX_plugin.md
Executable file
112
INDEX_plugin.md
Executable file
@ -0,0 +1,112 @@
|
||||
# INDEX_plugin.md — Plugin.php
|
||||
> **Archivo:** `src/Plugin.php` | 672 líneas | Entry point del plugin UCRM
|
||||
|
||||
---
|
||||
|
||||
## Propósito
|
||||
Clase orquestadora principal. UCRM la invoca en cada evento (hook). Detecta si viene de HTTP o CLI y delega al handler correspondiente.
|
||||
|
||||
## Namespace & Dependencias
|
||||
```
|
||||
namespace SmsNotifier
|
||||
Depende de: PluginNotifierFacade, PluginOxxoNotifierFacade, TwilioNotifierFacade,
|
||||
NotificationDataFactory, Logger, OptionsManager, PluginDataValidator, UcrmApi
|
||||
```
|
||||
|
||||
## Propiedades
|
||||
| Propiedad | Tipo | Descripción |
|
||||
|---|---|---|
|
||||
| `$logger` | Logger | Logger del plugin |
|
||||
| `$optionsManager` | OptionsManager | Carga config del plugin |
|
||||
| `$pluginDataValidator` | PluginDataValidator | Valida configuración |
|
||||
| `$pluginNotifierFacade` | PluginNotifierFacade | Fachada Stripe + Callbell |
|
||||
| `$pluginOxxoNotifierFacade` | PluginOxxoNotifierFacade | Fachada OXXO |
|
||||
| `$notifierFacade` | TwilioNotifierFacade | Fachada notificaciones base |
|
||||
| `$notificationDataFactory` | NotificationDataFactory | Crea objetos NotificationData |
|
||||
| `$ucrmApi` | UcrmApi (SDK) | Cliente API UCRM |
|
||||
|
||||
## Métodos
|
||||
| Método | Línea | Descripción |
|
||||
|---|---|---|
|
||||
| `__construct(...)` | 58 | Inicializa dependencias + UcrmApi con config |
|
||||
| `run(): void` | 84 | Entry point: detecta SAPI (fpm/cli) y delega |
|
||||
| `processCli(): void` | 96 | CLI: solo valida config |
|
||||
| `processHttpRequest(): void` | 104 | HTTP: procesa payload JSON del webhook |
|
||||
|
||||
---
|
||||
|
||||
## Flujo de `processHttpRequest()` (L.104–670)
|
||||
|
||||
### Paso 1 — Detectar tipo de payload (L.111–268)
|
||||
Lee `php://input`. Si **no tiene `uuid`** → es webhook externo (Stripe/OXXO):
|
||||
|
||||
| `type` en JSON | Línea | Acción |
|
||||
|---|---|---|
|
||||
| `customer_cash_balance_transaction.created` → `funded` | 133 | `pluginNotifierFacade->createPaymentIntent()` |
|
||||
| `customer_cash_balance_transaction.created` → `applied_to_payment` | 139 | `pluginNotifierFacade->registerPaymentFromWebhook()` |
|
||||
| `customer_cash_balance_transaction.created` → `unapplied_from_payment` | 142 | Log de transferencia cancelada |
|
||||
| `payment_intent.succeeded` | 166 | `pluginNotifierFacade->registerPaymentFromIntent()` |
|
||||
| `oxxo.retrieve` | 172 | `pluginOxxoNotifierFacade->getOxxoOrderStatus()` → responde JSON |
|
||||
| `oxxo.request` | 188 | Flujo async: `createStripeReference()` → `createOxxoOrder()` → responde → `generateOxxoVoucher()` en background |
|
||||
| `payout.failed` | 150 | Solo log |
|
||||
| `payment_intent.partially_funded` | 155 | Solo log |
|
||||
| `cash_balance.funds_available` | 163 | Solo log |
|
||||
|
||||
### Paso 2 — Payload con `uuid` → Webhook UCRM (L.270–670)
|
||||
Construye `NotificationData` via factory, luego switch por `eventName`:
|
||||
|
||||
| `eventName` | Línea | Acción |
|
||||
|---|---|---|
|
||||
| `payment.add` | 297 | Switch por `methodId` UUID → `notifierFacade->verifyPaymentActionToDo()` |
|
||||
| `payment.delete/unmatch/edit` | 418 | `notifierFacade->verifyClientActionToDo()` |
|
||||
| `client.edit` | 423 | Detecta cambios de tags/datos → `updatePasswordAntenaIfNeeded()`, `createStripeClient()`, `syncStripeCustomerData()`, `verifyClientActionToDo()` |
|
||||
| `client.add` | 539 | Solo log |
|
||||
| `service.edit` | 542 | `notifierFacade->verifyServiceActionToDo()` + `updatePasswordAntenaIfNeeded()` |
|
||||
| `service.suspend` | 552 | `notifierFacade->verifyServiceActionToDo()` |
|
||||
| `service.suspend_cancel` | 555 | `notifierFacade->verifyServiceActionToDo()` |
|
||||
| `service.postpone` | 558 | `notifierFacade->verifyServiceActionToDo()` |
|
||||
| `invoice.near_due` | 561 | `notifierFacade->notifyOverDue()` |
|
||||
| `invoice.overdue` | 564 | `notifierFacade->notifyOverDue()` |
|
||||
| `invoice.add` | 569 | `notifierFacade->verifyInvoiceActionToDo()` |
|
||||
| `invoice.edit` | 579 | `notifierFacade->verifyInvoiceActionToDo()` |
|
||||
| `invoice.add_draft` | 582 | `notifierFacade->verifyInvoiceActionToDo()` |
|
||||
| `invoice.draft_approved` | 585 | `notifierFacade->verifyInvoiceActionToDo()` |
|
||||
| `invoice.delete` | 588 | `notifierFacade->verifyInvoiceActionToDo()` |
|
||||
| `job.add` | 591 | PATCH title en UCRM con prefijo `[NOTIFICACION-PENDIENTE]` |
|
||||
| `job.edit` | 599 | Detecta cambios status/técnico/fecha → `notifierFacade->verifyJobActionToDo()` |
|
||||
|
||||
---
|
||||
|
||||
## UUIDs de Métodos de Pago (L.309–416)
|
||||
| UUID | Método |
|
||||
|---|---|
|
||||
| `11721cdf-...` | Cheque |
|
||||
| `6efe0fa8-...` | Efectivo |
|
||||
| `4145b5f5-...` | Transferencia bancaria |
|
||||
| `78e84000-...` | PayPal |
|
||||
| `6da98bb9-...` | Tarjeta de crédito PayPal |
|
||||
| `1dd098fa-...` | Stripe Credit Card (detecta sub-tipo por metadata) |
|
||||
| `b9e1e9d1-...` | Suscripción Stripe (tarjeta) |
|
||||
| `939f7701-...` | Suscripción PayPal |
|
||||
| `1c963e35-...` | MercadoPago |
|
||||
| `d8c1eae9-...` | Personalizado |
|
||||
| `72271b72-...` | Cortesía |
|
||||
| `b01c0b35-...` | OXXO Pay |
|
||||
| `93814765-...` | Tarjeta de crédito/débito |
|
||||
|
||||
---
|
||||
|
||||
## Tags de Cliente que disparan acciones (L.460–492)
|
||||
| Tag | Acción |
|
||||
|---|---|
|
||||
| `CREAR CLABE STRIPE` | `pluginNotifierFacade->createStripeClient(..., true)` |
|
||||
| `CREAR CLIENTE STRIPE` | `pluginNotifierFacade->createStripeClient(..., false)` |
|
||||
| `OBTENER PASSWORD ANTENA` | `pluginNotifierFacade->processClientPasswordAntenna()` |
|
||||
| `isLead: true→false` | Auto-crea cliente en Stripe |
|
||||
|
||||
---
|
||||
|
||||
## Notas de implementación
|
||||
- `job.edit` con `statusAfter==1` y `$isPending` en título dispara notificación
|
||||
- El flujo `oxxo.request` usa `fastcgi_finish_request()` para responder antes de generar el voucher
|
||||
- `client.edit` refresca datos del cliente vía UCRM API antes de sincronizar con CallBell
|
||||
153
INDEX_public.md
Executable file
153
INDEX_public.md
Executable file
@ -0,0 +1,153 @@
|
||||
# INDEX_public.md — public.php
|
||||
> **Archivo:** `public.php` | 2978 líneas | Portal web administrativo + endpoint público HTTP
|
||||
|
||||
---
|
||||
|
||||
## Propósito
|
||||
Archivo dual:
|
||||
1. **Endpoint REST/webhook** — recibe webhooks de Stripe, solicitudes OXXO, y llamadas AJAX del portal
|
||||
2. **SPA PHP** — interfaz web administrativa con 4 módulos (Instaladores, Notificaciones, Stripe, OXXO)
|
||||
|
||||
---
|
||||
|
||||
## Variables globales inicializadas (L.1–65)
|
||||
| Variable | Descripción |
|
||||
|---|---|
|
||||
| `$config` | Config del plugin cargada de `data/config.json` |
|
||||
| `$ucrmApi` | `UcrmApi` (SDK) con base_uri UCRM y apitoken |
|
||||
| `$paymentIntentService` | `PaymentIntentService` con stripeApiKey |
|
||||
| `$admins` | Array de admins UCRM `[id, nombre]` |
|
||||
| `$defaultStripeAdminId` | ID del admin "stripe" o primero de la lista |
|
||||
| `$nmsBaseUrl` | `https://{ipserver}/nms/api/v2.1` |
|
||||
| `$installersData` | JSON de instaladores desde config |
|
||||
|
||||
---
|
||||
|
||||
## Mapa de Endpoints / Actions
|
||||
|
||||
### POST con JSON body (L.22–35) — Webhook delegado a Plugin::run()
|
||||
| Condición | Acción |
|
||||
|---|---|
|
||||
| `isset($jsonData['uuid']) || isset($jsonData['eventName']) || isset($jsonData['type'])` | Instancia `Plugin` via DI container y llama `run()` |
|
||||
|
||||
---
|
||||
|
||||
### POST `?action=nms_login` (L.80–117) — Login NMS
|
||||
- **Body:** `{username, password}`
|
||||
- **Respuesta 200:** `{success, token, user}`
|
||||
- **Respuesta 201:** `{requires2FA, twoFactorToken}` → sigue con `nms_login_totp`
|
||||
- **Guarda token en:** `sessionStorage('nms_auth_token')` (frontend)
|
||||
|
||||
### POST `?action=nms_login_totp` (L.120–146) — Login TOTP 2FA
|
||||
- **Body:** `{twoFactorToken, ..., totpCode}`
|
||||
- **Respuesta 200:** `{success, token, user}`
|
||||
|
||||
### GET `?action=nms_verify_session` (L.148–173) — Verificar sesión NMS
|
||||
- **Header:** `x-auth-token`
|
||||
- **Llama:** `GET {nmsBaseUrl}/user`
|
||||
|
||||
---
|
||||
|
||||
### POST `$_POST['action']` (L.176–291)
|
||||
|
||||
| action | Línea | Params | Descripción |
|
||||
|---|---|---|---|
|
||||
| `save_installers` | 177 | `installers_data` (JSON) | Guarda JSON en config.json |
|
||||
| `resend_payment` | 191 | `paymentId` | Obtiene pago+cliente UCRM, hace loopback POST a sí mismo simulando webhook |
|
||||
| `resend_job_notification` | 238 | `jobId` | Simula webhook `job.edit` con status 0→1 y prefijo `[NOTIFICACION-PENDIENTE]` |
|
||||
| `create_intent` | 443 | `clientId, amount, stripeCustomerId, adminId` | `PaymentIntentService->createPaymentIntent()` |
|
||||
| `create_oxxo_intent` | 463 | `clientId, amount` | `PluginOxxoNotifierFacade->createOxxoPaymentIntent()` via DI |
|
||||
|
||||
---
|
||||
|
||||
### GET `?action=...` (L.293–438)
|
||||
|
||||
| action | Línea | Params GET | Descripción |
|
||||
|---|---|---|---|
|
||||
| `search_clients` | 296 | `q` | UCRM `GET clients?query=q&limit=6` |
|
||||
| `get_payments` | 307 | `clientId` | UCRM `GET payments?clientId=...&limit=20` + names de métodos |
|
||||
| `search_stripe` | 323 | `q` | `PaymentIntentService->searchClients(q)` |
|
||||
| `get_stripe_details` | 329 | `id` (clientId UCRM) | `PaymentIntentService->getClientDetails(id)` |
|
||||
| `get_stripe_history` | 339 | `stripeCustomerId` | Balance cash + últimos 10 PIs de transferencia |
|
||||
| `get_oxxo_history` | 355 | `stripeCustomerId` | Últimos 5 PIs OXXO de Stripe |
|
||||
| `get_installer_jobs` | 365 | `installerId` | UCRM `GET scheduling/jobs?assignedUserId=...&statuses=[0,1]&limit=50` |
|
||||
| `image` / `get_image` | 413 | `file` o `name` | Sirve imágenes de `/img/`, `/img/webp/`, `/vouchers_oxxo/` |
|
||||
|
||||
---
|
||||
|
||||
## HTML/UI — Estructura (L.481–2064)
|
||||
|
||||
### Variables PHP→JS inyectadas (L.2066–2075)
|
||||
```javascript
|
||||
NEEDS_LOGIN = true/false // Si sesión UCRM activa
|
||||
SYSTEM_USER_ID = null|int // ID usuario actual
|
||||
store.installers = [...] // Array de instaladores desde config
|
||||
store.crmUrl = 'https://...' // URL base API UCRM
|
||||
store.publicUrl = 'https://...'// URL pública CRM
|
||||
store.defaultStripeAdminId = '' // ID admin Stripe por defecto
|
||||
```
|
||||
|
||||
### Módulos de la UI (tabs)
|
||||
| Tab ID | Sección HTML | Descripción |
|
||||
|---|---|---|
|
||||
| `instaladores` | `#section-instaladores` | Tabla instaladores + jobs activos del instalador |
|
||||
| `notificaciones` | `#section-notificaciones` | Búsqueda cliente + tabla pagos + botón reenviar |
|
||||
| `pagos-spei` | `#section-pagos-spei` (en `views/stripe.php`) | Generador Stripe + historial |
|
||||
| `pagos-oxxo` | `#section-pagos-oxxo` (en `views/oxxo.php`) | Generador OXXO + historial |
|
||||
|
||||
### Funciones JS principales (L.2065+)
|
||||
| Función | Descripción |
|
||||
|---|---|
|
||||
| `toggleTheme()` | Cambia light/dark en `data-theme` + localStorage |
|
||||
| `showDashboard()` | Muestra menú principal, oculta módulos |
|
||||
| `showModule(id)` | Activa módulo por ID (mapea 'stripe'→'pagos-spei', etc.) |
|
||||
| `switchTab(tabName)` | Cambia tab activa y sección visible |
|
||||
| `showToast(msg, err)` | Toast temporal 3s |
|
||||
| `setupSearch(inputId, resultId, action, onSelect)` | Search debounced 300ms → fetch `?action=...` |
|
||||
| `renderRichSearchResults(container, data, query, cb)` | Renderiza resultados de búsqueda con highlight |
|
||||
| `highlightMatch(text, query)` | Resalta coincidencias en texto |
|
||||
| `loadPayments(id)` | Fetch `?action=get_payments&clientId=id` → tabla |
|
||||
| `refreshClientPayments()` | Recarga pagos del cliente actual |
|
||||
| `resendPayment(id)` | POST `action=resend_payment&paymentId=id` |
|
||||
| `loadOxxoHistory(stripeCustomerId)` | Fetch `?action=get_oxxo_history` → tabla |
|
||||
| `handleLogin()` | POST `?action=nms_login` → guarda token en sessionStorage |
|
||||
| `handleTotpLogin()` | POST `?action=nms_login_totp` |
|
||||
| `handleLogout()` | Limpia sessionStorage + reload |
|
||||
|
||||
### Funciones JS Instaladores
|
||||
| Función | Descripción |
|
||||
|---|---|
|
||||
| `openInstallerModal()` | Abre modal de nuevo instalador |
|
||||
| `fillInstallerData(select)` | Rellena campos desde select de admin |
|
||||
| `loadInstallerJobs(installerId)` | Fetch `?action=get_installer_jobs&installerId=...` |
|
||||
| `resendJobNotification(jobId)` | POST `action=resend_job_notification` |
|
||||
| `renderInstallersTable()` | Renderiza tabla desde `store.installers` |
|
||||
|
||||
---
|
||||
|
||||
## Includes externos (L.1992–1993)
|
||||
```php
|
||||
include __DIR__ . '/views/stripe.php'; // Sección y JS del módulo Stripe
|
||||
include __DIR__ . '/views/oxxo.php'; // Sección y JS del módulo OXXO
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## Archivos que sirve el endpoint `image`
|
||||
- `/img/*.{png,webp,jpg}`
|
||||
- `/img/webp/*.{webp}`
|
||||
- `/vouchers_oxxo/*.{png,webp,jpg}`
|
||||
|
||||
## Login overlay (L.1711–1750)
|
||||
- Se muestra si `NEEDS_LOGIN = true` (usuario sin sesión UCRM activa)
|
||||
- Pide credenciales NMS (UISP), no UCRM
|
||||
- Soporta 2FA TOTP
|
||||
- Token guardado en `sessionStorage('nms_auth_token')`
|
||||
|
||||
---
|
||||
|
||||
## Notas de implementación
|
||||
- `resend_payment` hace un **loopback cURL** a sí mismo simulando webhook UCRM
|
||||
- `create_intent` usa `PaymentIntentService` que llama a Stripe SDK directo
|
||||
- El CSS (~1200 líneas) está inline en el archivo, soporta dark/light mode vía `data-theme`
|
||||
- Las vistas `stripe.php` y `oxxo.php` tienen su propio JS, leer esos archivos para modificar esos módulos
|
||||
160
PLUGIN_INDEX.md
Executable file
160
PLUGIN_INDEX.md
Executable file
@ -0,0 +1,160 @@
|
||||
# PLUGIN_INDEX.md — Índice Maestro
|
||||
> Plugin: **siip-whatsapp-notifications** | Versión actual: ver `manifest.json`
|
||||
> Este archivo es el punto de entrada para cualquier agente IA que trabaje en este plugin.
|
||||
|
||||
---
|
||||
|
||||
## 🧭 Guía rápida: ¿Qué índice leer?
|
||||
|
||||
| Tarea | Índices a leer | Tokens est. |
|
||||
|---|---|---|
|
||||
| Modificar lógica de hooks UCRM | `INDEX_plugin.md` + `INDEX_deps.md` | ~4,500 |
|
||||
| Agregar/modificar endpoint en el portal web | `INDEX_public.md` | ~3,000 |
|
||||
| Modificar módulo Stripe del portal | `INDEX_public.md` + leer `views/stripe.php` directamente | ~3,500 |
|
||||
| Modificar módulo OXXO del portal | `INDEX_public.md` + leer `views/oxxo.php` directamente | ~3,500 |
|
||||
| Nueva feature que usa API UCRM | `INDEX_api_used.md` + `INDEX_api_ucrm.md` | ~3,500 |
|
||||
| Nueva feature que usa API UNMS | `INDEX_api_used.md` + `INDEX_api_unms.md` | ~5,000 |
|
||||
| Bug en llamada API existente | `INDEX_api_used.md` solo | ~1,500 |
|
||||
| Modificar notificaciones WhatsApp | `INDEX_deps.md` (sección Facades) | ~2,000 |
|
||||
| Cambiar flujo de pago OXXO/Stripe | `INDEX_plugin.md` + `INDEX_deps.md` | ~4,500 |
|
||||
|
||||
> ⚡ **Tip:** Después de leer el índice correspondiente, usa `StartLine/EndLine` para leer solo el fragmento del archivo fuente que necesitas modificar, en lugar de leer el archivo completo.
|
||||
|
||||
---
|
||||
|
||||
## 📁 Estructura del Plugin
|
||||
|
||||
```
|
||||
siip-whatsapp-notifications/
|
||||
│
|
||||
├── 📄 public.php (2978 líneas) — Portal web + endpoint HTTP público
|
||||
├── 📄 src/Plugin.php (672 líneas) — Entry point de hooks UCRM
|
||||
│
|
||||
├── src/
|
||||
│ ├── Facade/
|
||||
│ │ ├── AbstractMessageNotifierFacade.php — Base notificaciones WhatsApp
|
||||
│ │ ├── AbstractStripeOperationsFacade.php — Lógica Stripe + registro pagos UCRM
|
||||
│ │ ├── AbstractOxxoOperationsFacade.php — Lógica OXXO Pay + vouchers
|
||||
│ │ ├── PluginNotifierFacade.php — Facade principal (extiende Stripe)
|
||||
│ │ ├── PluginOxxoNotifierFacade.php — Facade OXXO
|
||||
│ │ ├── TwilioNotifierFacade.php — Legacy Twilio
|
||||
│ │ └── ClientCallBellAPI.php — Cliente Callbell (81KB)
|
||||
│ │
|
||||
│ ├── Service/
|
||||
│ │ ├── PaymentIntentService.php — Stripe SDK: PIs, historial, balance
|
||||
│ │ ├── SmsNumberProvider.php — Extrae teléfonos WhatsApp de contactos UCRM
|
||||
│ │ ├── Logger.php — PSR-3 logger
|
||||
│ │ ├── OptionsManager.php — Carga config → PluginData
|
||||
│ │ ├── MinioStorageService.php — Sube vouchers a MinIO
|
||||
│ │ ├── CurlExecutor.php — Wrapper cURL
|
||||
│ │ └── PluginDataValidator.php — Valida configuración
|
||||
│ │
|
||||
│ ├── Data/
|
||||
│ │ ├── PluginData.php — DTO config del plugin
|
||||
│ │ ├── NotificationData.php — DTO payload webhook UCRM
|
||||
│ │ └── UcrmData.php — Base DTO
|
||||
│ │
|
||||
│ └── Factory/
|
||||
│ ├── NotificationDataFactory.php — Construye NotificationData desde JSON
|
||||
│ └── MessageTextFactory.php — Genera textos de mensajes WhatsApp
|
||||
│
|
||||
├── views/
|
||||
│ ├── stripe.php (17KB) — HTML+JS del módulo Stripe del portal
|
||||
│ └── oxxo.php (12KB) — HTML+JS del módulo OXXO del portal
|
||||
│
|
||||
├── scripts-uisp/ — Scripts auxiliares UNMS (audit_client_passwords.php, etc.)
|
||||
├── data/ — config.json, logs, ordenes OXXO
|
||||
├── vendor/ — Dependencias Composer
|
||||
├── img/ — Imágenes del portal (logos, íconos)
|
||||
└── vouchers_oxxo/ — Vouchers OXXO generados
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## 📚 Archivos de Índice
|
||||
|
||||
| Archivo | Describe | Tamaño |
|
||||
|---|---|---|
|
||||
| [`INDEX_plugin.md`](INDEX_plugin.md) | `src/Plugin.php`: flujos, eventos UCRM, UUIDs de métodos de pago | ~5KB |
|
||||
| [`INDEX_public.md`](INDEX_public.md) | `public.php`: todos los endpoints, acciones JS, módulos UI | ~6KB |
|
||||
| [`INDEX_deps.md`](INDEX_deps.md) | Facades y Services: firmas de métodos y propósito | ~7KB |
|
||||
| [`INDEX_api_used.md`](INDEX_api_used.md) | Todas las llamadas API reales que hace el plugin | ~4KB |
|
||||
| [`INDEX_api_ucrm.md`](INDEX_api_ucrm.md) | Catálogo de 162 endpoints UCRM CRM v1.0 | ~10KB |
|
||||
| [`INDEX_api_unms.md`](INDEX_api_unms.md) | Catálogo de 560 endpoints UNMS NMS v2.1 | ~74KB |
|
||||
|
||||
---
|
||||
|
||||
## 🔧 Scripts de utilidad
|
||||
|
||||
| Script | Uso |
|
||||
|---|---|
|
||||
| `.agent/scripts/gen_index_unms_swagger.php` | `php gen_index_unms_swagger.php` — regenera `INDEX_api_unms.md` desde `unms-swagger.json` |
|
||||
| `.agent/scripts/gen_index_ucrm_apib.php` | `php gen_index_ucrm_apib.php` — regenera `INDEX_api_ucrm.md` desde `unmscrm.apib` |
|
||||
|
||||
---
|
||||
|
||||
## ⚙️ Configuración del Plugin (claves en `data/config.json`)
|
||||
|
||||
| Clave | Tipo | Descripción |
|
||||
|---|---|---|
|
||||
| `ipserver` | string | IP/hostname del servidor UISP |
|
||||
| `apitoken` | string | Token API UCRM |
|
||||
| `unmsApiToken` | string | Token API UNMS/NMS |
|
||||
| `tokencallbell` | string | Token API Callbell |
|
||||
| `tokenstripe` | string | API Key Stripe |
|
||||
| `ipPuppeteer` | string | IP microservicio Puppeteer para vouchers |
|
||||
| `portPuppeteer` | string | Puerto microservicio Puppeteer |
|
||||
| `idPaymentAdminCRM` | string | ID admin UCRM para registrar pagos |
|
||||
| `installersDataWhatsApp` | JSON string | `{"instaladores":[{id, nombre, whatsapp}]}` |
|
||||
| `notificationTypeText` | bool | `true`=texto plano, `false`=plantilla Callbell |
|
||||
| `debugMode` | bool | Activa logging DEBUG |
|
||||
| `cashPaymentMethodId` | bool | Habilitar notif. efectivo |
|
||||
| `bankTransferPaymentMethodId` | bool | Habilitar notif. transferencia bancaria |
|
||||
| `oxxoPayPaymentMethodId` | bool | Habilitar notif. OXXO |
|
||||
| `creditCardStripePaymentMethodId` | bool | Habilitar notif. tarjeta Stripe |
|
||||
| *(más métodos de pago)* | bool | Ver `PluginData.php` para lista completa |
|
||||
|
||||
---
|
||||
|
||||
## 🔄 Flujos principales resumidos
|
||||
|
||||
### Flujo: Pago registrado en UCRM
|
||||
```
|
||||
UCRM → POST public.php (uuid presente) → Plugin::run() → processHttpRequest()
|
||||
→ NotificationDataFactory::getObject() → event: payment.add
|
||||
→ switch(methodId) → notifierFacade::verifyPaymentActionToDo()
|
||||
→ SmsNumberProvider::getUcrmClientNumbers() → ClientCallBellAPI::sendPaymentNotificationWhatsApp()
|
||||
```
|
||||
|
||||
### Flujo: Transferencia bancaria Stripe (SPEI)
|
||||
```
|
||||
Stripe → POST public.php (type: customer_cash_balance_transaction.created → funded)
|
||||
→ Plugin::run() → pluginNotifierFacade::createPaymentIntent()
|
||||
→ AbstractStripeOperationsFacade: crea PI en Stripe + registra pago en UCRM
|
||||
```
|
||||
|
||||
### Flujo: Solicitud OXXO Pay
|
||||
```
|
||||
Bot/Cliente → POST public.php (type: oxxo.request)
|
||||
→ Plugin::run() → pluginOxxoNotifierFacade::createStripeReference()
|
||||
→ createOxxoOrder() → responde inmediatamente → fastcgi_finish_request()
|
||||
→ [background] generateOxxoVoucher() → Puppeteer → MinIO
|
||||
```
|
||||
|
||||
### Flujo: Tarea de Instalador
|
||||
```
|
||||
UCRM → POST public.php (uuid, event: job.edit, status 0→1)
|
||||
→ notifierFacade::verifyJobActionToDo()
|
||||
→ ClientCallBellAPI: notifica cliente + técnico vía WhatsApp
|
||||
→ PATCH job title en UCRM (remueve/actualiza prefijo [NOTIFICACION-PENDIENTE])
|
||||
```
|
||||
|
||||
### Flujo: Obtener Password Antena
|
||||
```
|
||||
UCRM client.edit + tag "OBTENER PASSWORD ANTENA" agregado
|
||||
→ Plugin::processHttpRequest() → pluginNotifierFacade::processClientPasswordAntenna()
|
||||
→ AbstractMessageNotifierFacade::getVaultCredentialsByClientId()
|
||||
→ UNMS GET devices?siteId → GET vault/{id}/credentials
|
||||
→ UCRM PATCH clients/{id} (atributo passwordAntenaCliente)
|
||||
→ removeTagFromClient("OBTENER PASSWORD ANTENA")
|
||||
```
|
||||
15
README.md
15
README.md
@ -1,12 +1,25 @@
|
||||
# SIIP - WhatsApp Notifications & Integrated Payment Portal
|
||||
|
||||

|
||||

|
||||

|
||||

|
||||

|
||||
|
||||
Este plugin es una solución integral que transforma tu UCRM en un **Portal Administrativo de Última Generación**. No solo automatiza la comunicación por WhatsApp, sino que integra un Dashboard completo para la gestión de pagos online (Stripe/OXXO), visualización de comprobantes y coordinación de equipos técnicos.
|
||||
|
||||
## ✨ Novedades v4.7.4 (Offline CPE Password Preservation Hotfix)
|
||||
|
||||
- **🔑 Preservación de Clave de Antena Desconectada**: Se añadió una capa de validación que detecta si el CPE del cliente en UISP está fuera de línea. Si ya existía una contraseña válida en UCRM, el script evita sobrescribirla con la leyenda de error por desconexión. Esto preserva la credencial de acceso para que los instaladores puedan conectarse físicamente al equipo y alinearlo o repararlo en sitio.
|
||||
|
||||
## ✨ Novedades v4.7.3 (Antenna Password Tag Fixes, Overwrite Protections & Sync)
|
||||
|
||||
- **🔄 Sincronización CallBell Inmediata**: Los datos del cliente se refrescan de forma activa en el objeto de notificación antes de llamar a la sincronización, garantizando que el nuevo Site y contraseña de la antena se actualicen en CallBell inmediatamente en el mismo evento del webhook.
|
||||
- **🏷️ Robustez en Detección de Etiquetas**: Modificada la detección de tags en `client.edit` (`OBTENER PASSWORD ANTENA`, etc.) para leer directamente del objeto `$notification->clientData['tags']`, logrando compatibilidad con los webhooks estándar de producción en UCRM (los cuales no proveen la clave `extraData`).
|
||||
- **🛡️ Protección contra Sobrescrituras de Red**: Agregadas validaciones inteligentes en los actualizadores (`audit_client_passwords.php` y `ejemplo_script_actualizador.php`) para evitar que caídas de red o errores de asociación de la API de UISP reemplacen atributos del CRM con valores genéricos destructivos (como `"Sin SITE"` o `"REPETIDOR"`) si ya existían datos de sector válidos.
|
||||
- **📝 Integración de Log de Errores**: Integrado el logger principal del plugin con el script de auditoría de UISP para mostrar de forma amigable cualquier error de conexión con la API en el panel del plugin de UCRM (`data/plugin.log`).
|
||||
- **📡 Resolución Inteligente de Site (AP Fallback)**: En redes de UISP sin jerarquías Padre-Hijo estructuradas (donde no hay parent site directo en el dispositivo del cliente), el plugin ahora recupera y asocia dinámicamente el Site de la Torre a partir del AP (Access Point) al que está conectada la antena.
|
||||
|
||||
|
||||
## ✨ Novedades v4.7.1 (Robustness & Scheduling Filters)
|
||||
|
||||
- **🛡️ Robustez de UI de Pestañas**: Se eliminó la búsqueda y dependencias en los eventos `onclick` inline (que se bloqueaban por CSP o eran alterados por minificadores de HTML de UCRM en producción) y se implementó un sistema basado en atributos nativos `data-tab` para la navegación segura entre los módulos del portal.
|
||||
|
||||
0
comprobantes/.gitkeep
Normal file → Executable file
0
comprobantes/.gitkeep
Normal file → Executable file
3455
data/plugin.log
3455
data/plugin.log
File diff suppressed because one or more lines are too long
@ -5,13 +5,28 @@
|
||||
"displayName": "SIIP - Procesador de Pagos en línea con Stripe, Oxxo y Transferencia, Sincronizador de CallBell y Envío de Notificaciones y comprobantes vía WhatsApp",
|
||||
"description": "Este plugin sincroniza los clientes del sistema UISP CRM con los contactos de WhatsApp en CallBell, además procesa pagos de Stripe como las trasferencias bancarias y genera referencias de pago vía OXXO, además envía comprobantes de pago en formato imagen PNG o texto vía Whatsapp a los clientes",
|
||||
"url": "https://siip.mx/",
|
||||
"version": "4.7.1",
|
||||
"version": "4.7.4",
|
||||
"unmsVersionCompliancy": {
|
||||
"min": "2.1.0",
|
||||
"max": null
|
||||
},
|
||||
"author": "SIIP INTERNET",
|
||||
"changelog": [
|
||||
{
|
||||
"version": "4.7.4",
|
||||
"date": "2026-07-15",
|
||||
"changes": "Corrección: Preservación de contraseñas de antena válidas en UCRM cuando el dispositivo se encuentra desconectado (offline) en UISP, evitando que la clave se sobrescriba por un mensaje de error y garantizando que el instalador pueda recibirla en las notificaciones."
|
||||
},
|
||||
{
|
||||
"version": "4.7.3",
|
||||
"date": "2026-07-13",
|
||||
"changes": "Actualización y Corrección: Detección robusta de etiquetas (OBTENER PASSWORD ANTENA) utilizando clientData en producción para compatibilidad con webhooks estándar. Integración del logger del plugin con el script de auditoría de UISP. Prevención de sobrescritura de datos de Site/Antena por genéricos ante caídas de la API. Refresco en tiempo real del objeto de notificación previo a la sincronización con CallBell. Resolución de Site (Torre) UISP mediante fallback del Punto de Acceso (AP) para redes sin jerarquías Padre-Hijo."
|
||||
},
|
||||
{
|
||||
"version": "4.7.2",
|
||||
"date": "2026-06-10",
|
||||
"changes": "Actualización: Ordenamiento descendente (de más reciente a más antiguo) de la fecha en la tabla de tareas/tickets del instalador."
|
||||
},
|
||||
{
|
||||
"version": "4.7.1",
|
||||
"date": "2026-06-05",
|
||||
|
||||
48
public.php
48
public.php
@ -1,5 +1,53 @@
|
||||
<?php
|
||||
|
||||
// Endpoint de Autodetección de Módulos (para portal unificado siip-cashier-tools-ui)
|
||||
if (isset($_GET['action']) && $_GET['action'] === 'get_modules_list') {
|
||||
header('Content-Type: application/json');
|
||||
echo json_encode([
|
||||
'success' => true,
|
||||
'plugin' => 'whatsapp',
|
||||
'modules' => [
|
||||
[
|
||||
'key' => 'notifications',
|
||||
'title' => '💬 Notificaciones WhatsApp',
|
||||
'sub' => 'SIIP WhatsApp Notifications',
|
||||
'description' => 'Re-envía notificaciones de pago e instaladores vía WhatsApp.',
|
||||
'image' => '?action=get_image&name=whatsapp-logo.png',
|
||||
'tab' => 'notifications',
|
||||
'plugin' => 'whatsapp'
|
||||
],
|
||||
[
|
||||
'key' => 'installers',
|
||||
'title' => '🔧 Administrar Instaladores',
|
||||
'sub' => 'SIIP WhatsApp Notifications',
|
||||
'description' => 'Gestiona los datos de los instaladores para el envío de notificaciones WhatsApp.',
|
||||
'image' => '?action=get_image&name=installers-management.png',
|
||||
'tab' => 'installers',
|
||||
'plugin' => 'whatsapp'
|
||||
],
|
||||
[
|
||||
'key' => 'stripe',
|
||||
'title' => '💳 Pagos SPEI / Stripe',
|
||||
'sub' => 'SIIP WhatsApp Notifications',
|
||||
'description' => 'Genera intenciones de pago en línea personalizadas para clientes.',
|
||||
'image' => '?action=get_image&name=stripe-logo.png',
|
||||
'tab' => 'stripe',
|
||||
'plugin' => 'whatsapp'
|
||||
],
|
||||
[
|
||||
'key' => 'oxxo',
|
||||
'title' => '🏪 Pagos OXXO',
|
||||
'sub' => 'SIIP WhatsApp Notifications',
|
||||
'description' => 'Genera fichas de pago OXXO Pay para cobranza en caja.',
|
||||
'image' => '?action=get_image&name=oxxo-logo.png',
|
||||
'tab' => 'oxxo',
|
||||
'plugin' => 'whatsapp'
|
||||
]
|
||||
]
|
||||
]);
|
||||
exit;
|
||||
}
|
||||
|
||||
require_once __DIR__ . '/vendor/autoload.php';
|
||||
|
||||
chdir(__DIR__);
|
||||
|
||||
@ -141,7 +141,7 @@ function generateStrongPassword($length = 16)
|
||||
* - Service status Ended(2) or Obsolete(5) → password = 'Servicio Finalizado'
|
||||
* - Device disconnected → password = 'Antena desconectada al momento de obtener la contraseña'
|
||||
*/
|
||||
function fixClientData($clientId, $ucrmApi, $unmsClient, $attributeIds, $config, $currentPassword)
|
||||
function fixClientData($clientId, $ucrmApi, $unmsClient, $attributeIds, $config, $currentPassword, $logger = null)
|
||||
{
|
||||
$passwordAttributeId = $attributeIds['password'];
|
||||
$siteAttributeId = $attributeIds['site'] ?? null;
|
||||
@ -153,34 +153,61 @@ function fixClientData($clientId, $ucrmApi, $unmsClient, $attributeIds, $config,
|
||||
'deviceInfo' => null,
|
||||
];
|
||||
|
||||
// Local helper for unified logging
|
||||
$logMsg = function ($msg, $level = 'info') use ($logger, $clientId) {
|
||||
$fullMsg = "[Client $clientId] " . $msg;
|
||||
logMessage($fullMsg);
|
||||
if ($logger) {
|
||||
$logger->log($level, $fullMsg);
|
||||
}
|
||||
};
|
||||
|
||||
try {
|
||||
$isTest = isTestEnvironment($config);
|
||||
|
||||
// ── Edge Case 1: Check client tags for "NS REPETIDOR" ──
|
||||
// Fetch client attributes from CRM to check current site & antenna details
|
||||
$currentSite = null;
|
||||
$currentAntenna = null;
|
||||
try {
|
||||
$clientData = $ucrmApi->get("clients/$clientId");
|
||||
$clientTags = $clientData['tags'] ?? [];
|
||||
|
||||
foreach ($clientData['attributes'] ?? [] as $attr) {
|
||||
if ($attr['key'] === 'site' || $attr['customAttributeId'] == $siteAttributeId) {
|
||||
$currentSite = trim((string)$attr['value']);
|
||||
}
|
||||
if ($attr['key'] === 'antenaSectorial' || $attr['customAttributeId'] == $antenaSectorialAttributeId) {
|
||||
$currentAntenna = trim((string)$attr['value']);
|
||||
}
|
||||
}
|
||||
|
||||
// ── Edge Case 1: Check client tags for "NS REPETIDOR" ──
|
||||
foreach ($clientTags as $tag) {
|
||||
if (stripos($tag['name'] ?? '', 'NS REPETIDOR') !== false) {
|
||||
$msg = 'Este cliente funciona como Repetidor';
|
||||
$result['password'] = $msg;
|
||||
$result['deviceInfo'] = 'REPETIDOR';
|
||||
|
||||
$attrUpdates = [];
|
||||
if ($currentPassword !== $msg) {
|
||||
$attrUpdates = [$passwordAttributeId => $msg];
|
||||
if ($antenaSectorialAttributeId) {
|
||||
$attrUpdates[$antenaSectorialAttributeId] = 'REPETIDOR';
|
||||
}
|
||||
$attrUpdates[$passwordAttributeId] = $msg;
|
||||
}
|
||||
if ($antenaSectorialAttributeId && $currentAntenna !== 'REPETIDOR') {
|
||||
$attrUpdates[$antenaSectorialAttributeId] = 'REPETIDOR';
|
||||
}
|
||||
|
||||
if (!empty($attrUpdates)) {
|
||||
patchClientAttributes($ucrmApi, $clientId, $attrUpdates);
|
||||
$result['changed'] = true;
|
||||
} else {
|
||||
$result['changed'] = false;
|
||||
}
|
||||
logMessage("Client $clientId: Tag NS REPETIDOR detected → skipping");
|
||||
$logMsg("Tag NS REPETIDOR detected → skipping");
|
||||
return $result;
|
||||
}
|
||||
}
|
||||
} catch (\Exception $e) {
|
||||
logMessage("Warning: Could not fetch client tags for $clientId: " . $e->getMessage());
|
||||
$logMsg("Warning: Could not fetch client details/tags: " . $e->getMessage(), 'warning');
|
||||
}
|
||||
|
||||
// ── Get Services ──
|
||||
@ -197,6 +224,7 @@ function fixClientData($clientId, $ucrmApi, $unmsClient, $attributeIds, $config,
|
||||
} else {
|
||||
$result['changed'] = false;
|
||||
}
|
||||
$logMsg($msg, 'warning');
|
||||
return $result;
|
||||
}
|
||||
|
||||
@ -214,13 +242,14 @@ function fixClientData($clientId, $ucrmApi, $unmsClient, $attributeIds, $config,
|
||||
// ── Edge Case 2: Service Ended (2) or Obsolete (5) ──
|
||||
if ($serviceStatus === 2 || $serviceStatus === 5) {
|
||||
$passwordValue = 'Servicio Finalizado';
|
||||
logMessage("Client $clientId: Service " . ($index + 1) . " has status $serviceStatus (Ended/Obsolete)");
|
||||
$logMsg("Service " . ($index + 1) . " has status $serviceStatus (Ended/Obsolete)");
|
||||
$allServicePasswords[] = trim("$label $passwordValue");
|
||||
continue;
|
||||
}
|
||||
|
||||
if (!$siteId) {
|
||||
$passwordValue = "⚠️ Sin sitio";
|
||||
$logMsg("Service " . ($index + 1) . " has no unmsClientSiteId", 'warning');
|
||||
} else {
|
||||
if ($isTest) {
|
||||
// Test Env Logic: Preserve existing if valid
|
||||
@ -244,22 +273,11 @@ function fixClientData($clientId, $ucrmApi, $unmsClient, $attributeIds, $config,
|
||||
// Static Test Data
|
||||
$siteName = 'VENUS';
|
||||
$deviceInfo = 'Sectorial de pruebas 172.16.5.134';
|
||||
logMessage("Test Env: Generated new password for Client $clientId (Service $index) and set static network data.");
|
||||
$logMsg("Test Env: Generated new password (Service $index) and set static network data.");
|
||||
} else {
|
||||
// Even if password exists, we might want to ensure static data is set if missing?
|
||||
// User request implies "when generating that password... it should also fill".
|
||||
// Let's safe-set it if we are touching the client.
|
||||
// Actually, if we found it in CRM, we preserve existing password.
|
||||
// But maybe we should update the network data anyway?
|
||||
// The user said "when generating". So only on new generation seems safer/stricter to request,
|
||||
// but usually test env data should be consistent.
|
||||
// Let's set it always in Test Env if we are in this block?
|
||||
// No, let's stick to "when generating" or if meaningful to update.
|
||||
// If we are strictly "Testing", we might want to overwrite "Real" data with "Test" data to avoid confusion?
|
||||
// But let's stick to the generation block for now as requested.
|
||||
$siteName = 'VENUS';
|
||||
$deviceInfo = 'Sectorial de pruebas 172.16.5.134';
|
||||
logMessage("Test Env: Preserved existing password for Client $clientId but ensured static network data.");
|
||||
$logMsg("Test Env: Preserved existing password but ensured static network data.");
|
||||
}
|
||||
} else {
|
||||
// Production Logic
|
||||
@ -269,66 +287,97 @@ function fixClientData($clientId, $ucrmApi, $unmsClient, $attributeIds, $config,
|
||||
|
||||
if (empty($devs)) {
|
||||
$passwordValue = "⚠️ Sin antena";
|
||||
$logMsg("No devices found for siteId: $siteId", 'warning');
|
||||
} else {
|
||||
$passVault = null;
|
||||
$passVault = null;
|
||||
|
||||
// Find first client-like device or fallback to first device
|
||||
$firstDev = null;
|
||||
foreach ($devs as $d) {
|
||||
$role = $d['identification']['role'] ?? '';
|
||||
if ($role === 'station' || $role === 'cpe' || $role === 'client') {
|
||||
$firstDev = $d;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if ($firstDev === null) {
|
||||
$firstDev = $devs[0];
|
||||
}
|
||||
|
||||
// Extract network data (always execute for first device if index is 0)
|
||||
if ($firstDev && $index === 0) {
|
||||
$siteName = $firstDev['identification']['site']['parent']['name'] ?? null;
|
||||
$apDeviceName = $firstDev['attributes']['apDevice']['name'] ?? null;
|
||||
$apDeviceId = $firstDev['attributes']['apDevice']['id'] ?? null;
|
||||
|
||||
if ($apDeviceName && $apDeviceId) {
|
||||
try {
|
||||
$respApDev = $unmsClient->get("devices/$apDeviceId");
|
||||
$apDevData = json_decode($respApDev->getBody()->getContents(), true);
|
||||
$apDeviceIP = $apDevData['ipAddress'] ?? '';
|
||||
$deviceInfo = trim("$apDeviceName $apDeviceIP");
|
||||
|
||||
// AP Device Site Name Fallback:
|
||||
if (empty($siteName)) {
|
||||
$siteName = $apDevData['identification']['site']['name'] ?? null;
|
||||
}
|
||||
} catch (\Exception $e) {
|
||||
$deviceInfo = $apDeviceName;
|
||||
$logMsg("Warning: Could not fetch AP device IP for $apDeviceId: " . $e->getMessage(), 'warning');
|
||||
}
|
||||
} elseif (!$apDeviceName) {
|
||||
$deviceInfo = 'REPETIDOR';
|
||||
}
|
||||
}
|
||||
|
||||
// ── Extraer contraseña previa de este servicio en el CRM si existe ──
|
||||
$prevServicePassword = null;
|
||||
$hasValidPrevPassword = false;
|
||||
if (!empty($currentPassword)) {
|
||||
if ($numServices > 1) {
|
||||
if (preg_match('/Servicio ' . ($index + 1) . ':\s*([^⚠️\s]+)/', $currentPassword, $matches)) {
|
||||
$tempPass = trim($matches[1]);
|
||||
// Validar que no sea una leyenda de error conocida o un emoji
|
||||
if (stripos($tempPass, 'desconectada') === false &&
|
||||
stripos($tempPass, 'Finalizado') === false &&
|
||||
stripos($tempPass, 'Error') === false &&
|
||||
stripos($tempPass, 'Repetidor') === false &&
|
||||
stripos($tempPass, 'sin') === false) {
|
||||
$prevServicePassword = $tempPass;
|
||||
$hasValidPrevPassword = true;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
$tempPass = trim($currentPassword);
|
||||
if (strpos($tempPass, '⚠️') === false &&
|
||||
strpos($tempPass, 'Servicio') === false &&
|
||||
stripos($tempPass, 'desconectada') === false &&
|
||||
stripos($tempPass, 'Finalizado') === false &&
|
||||
stripos($tempPass, 'Error') === false &&
|
||||
stripos($tempPass, 'Repetidor') === false &&
|
||||
stripos($tempPass, 'sin') === false) {
|
||||
$prevServicePassword = $tempPass;
|
||||
$hasValidPrevPassword = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// ── Edge Case 3: Check if device is disconnected ──
|
||||
$deviceStatus = $firstDev['overview']['status'] ?? 'unknown';
|
||||
if ($deviceStatus === 'disconnected') {
|
||||
if ($hasValidPrevPassword) {
|
||||
// Preservamos la contraseña real para que el instalador pueda usarla
|
||||
$passwordValue = $prevServicePassword;
|
||||
$logMsg("Device is disconnected (siteId=$siteId), but preserved existing valid password from CRM: '$passwordValue'.");
|
||||
} else {
|
||||
$passwordValue = 'Antena desconectada al momento de obtener la contraseña';
|
||||
$logMsg("Device is disconnected (siteId=$siteId) and no valid password was found in CRM.", 'warning');
|
||||
}
|
||||
$allServicePasswords[] = trim("$label $passwordValue");
|
||||
continue; // Skip vault check for this service
|
||||
}
|
||||
|
||||
$firstDeviceId = null;
|
||||
|
||||
// ── Edge Case 3: Check if device is disconnected ──
|
||||
$firstDev = $devs[0] ?? null;
|
||||
$deviceStatus = $firstDev['overview']['status'] ?? 'unknown';
|
||||
|
||||
if ($deviceStatus === 'disconnected') {
|
||||
$passwordValue = 'Antena desconectada al momento de obtener la contraseña';
|
||||
logMessage("Client $clientId: Device is disconnected (siteId=$siteId)");
|
||||
|
||||
// Still extract network data even if disconnected
|
||||
if ($firstDev && $index === 0) {
|
||||
$siteName = $firstDev['identification']['site']['parent']['name'] ?? null;
|
||||
$apDeviceName = $firstDev['attributes']['apDevice']['name'] ?? null;
|
||||
$apDeviceId = $firstDev['attributes']['apDevice']['id'] ?? null;
|
||||
if ($apDeviceName && $apDeviceId) {
|
||||
try {
|
||||
$respApDev = $unmsClient->get("devices/$apDeviceId");
|
||||
$apDevData = json_decode($respApDev->getBody()->getContents(), true);
|
||||
$apDeviceIP = $apDevData['ipAddress'] ?? '';
|
||||
$deviceInfo = trim("$apDeviceName $apDeviceIP");
|
||||
} catch (\Exception $e) {
|
||||
$deviceInfo = $apDeviceName;
|
||||
}
|
||||
} elseif (!$apDeviceName) {
|
||||
$deviceInfo = 'REPETIDOR';
|
||||
}
|
||||
}
|
||||
$allServicePasswords[] = trim("$label $passwordValue");
|
||||
continue; // Skip vault/regenerate for this service
|
||||
}
|
||||
// $firstDev already set above (line 258)
|
||||
if ($firstDev && $index === 0) {
|
||||
// Site name from parent site
|
||||
$siteName = $firstDev['identification']['site']['parent']['name'] ?? null;
|
||||
|
||||
// AP Device name and IP
|
||||
$apDeviceName = $firstDev['attributes']['apDevice']['name'] ?? null;
|
||||
$apDeviceId = $firstDev['attributes']['apDevice']['id'] ?? null;
|
||||
|
||||
if ($apDeviceName && $apDeviceId) {
|
||||
// Fetch AP device IP
|
||||
try {
|
||||
$respApDev = $unmsClient->get("devices/$apDeviceId");
|
||||
$apDevData = json_decode($respApDev->getBody()->getContents(), true);
|
||||
$apDeviceIP = $apDevData['ipAddress'] ?? '';
|
||||
$deviceInfo = trim("$apDeviceName $apDeviceIP");
|
||||
} catch (\Exception $e) {
|
||||
$deviceInfo = $apDeviceName;
|
||||
logMessage("Warning: Could not fetch AP device IP for $apDeviceId: " . $e->getMessage());
|
||||
}
|
||||
} elseif (!$apDeviceName) {
|
||||
// No apDevice = possibly a repeater
|
||||
$deviceInfo = 'REPETIDOR';
|
||||
logMessage("Client $clientId: Device is a repeater (no apDevice)");
|
||||
}
|
||||
}
|
||||
|
||||
foreach ($devs as $dev) {
|
||||
$deviceId = $dev['identification']['id'] ?? null;
|
||||
if (!$deviceId) continue;
|
||||
@ -342,6 +391,7 @@ function fixClientData($clientId, $ucrmApi, $unmsClient, $attributeIds, $config,
|
||||
break;
|
||||
}
|
||||
} catch (\Exception $e) {
|
||||
$logMsg("Could not fetch credentials from device $deviceId: " . $e->getMessage(), 'debug');
|
||||
continue;
|
||||
}
|
||||
}
|
||||
@ -356,16 +406,19 @@ function fixClientData($clientId, $ucrmApi, $unmsClient, $attributeIds, $config,
|
||||
'json' => [['username' => 'ubnt', 'password' => $newPass, 'readOnly' => true]]
|
||||
]);
|
||||
$passwordValue = $newPass;
|
||||
logMessage("Prod Env: Regenerated password on UNMS Device $firstDeviceId");
|
||||
$logMsg("Regenerated password on UNMS Device $firstDeviceId");
|
||||
} catch (\Exception $e) {
|
||||
$passwordValue = "⚠️ Error Regenerating: " . $e->getMessage();
|
||||
$logMsg("Error regenerating password on device $firstDeviceId: " . $e->getMessage(), 'error');
|
||||
}
|
||||
} else {
|
||||
$passwordValue = "⚠️ Sin dispositivo válido";
|
||||
$logMsg("No valid device ID for credentials", 'warning');
|
||||
}
|
||||
}
|
||||
} catch (\Exception $e) {
|
||||
$passwordValue = "⚠️ Error API UNMS: " . $e->getMessage();
|
||||
$logMsg("Exception during UNMS API query: " . $e->getMessage(), 'error');
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -385,25 +438,60 @@ function fixClientData($clientId, $ucrmApi, $unmsClient, $attributeIds, $config,
|
||||
$attrUpdates[$passwordAttributeId] = $finalValue;
|
||||
}
|
||||
|
||||
// Site: patch if we got data and attribute ID exists
|
||||
if ($siteName !== null && $siteAttributeId) {
|
||||
$attrUpdates[$siteAttributeId] = $siteName;
|
||||
// Site: patch if we got data and it is different
|
||||
if ($siteAttributeId) {
|
||||
if ($siteName !== null) {
|
||||
if (!empty($siteName) || empty($currentSite)) {
|
||||
if ($siteName !== $currentSite) {
|
||||
$attrUpdates[$siteAttributeId] = $siteName;
|
||||
$logMsg("Site to update resolved: '$siteName' (previous was: '" . ($currentSite ?: 'empty') . "')");
|
||||
} else {
|
||||
$logMsg("Site name matches current CRM value '$currentSite'. Patch skipped.");
|
||||
}
|
||||
} else {
|
||||
$logMsg("Site name resolved from UISP is empty and CRM already has a value '$currentSite'. Prevented overwriting with empty value.");
|
||||
}
|
||||
} else {
|
||||
$logMsg("UISP did not return a parent site name (siteName is null).");
|
||||
}
|
||||
} else {
|
||||
$logMsg("Site attribute ID ('site') was not resolved.");
|
||||
}
|
||||
|
||||
// Antena/Sectorial: patch if we got data and attribute ID exists
|
||||
if ($deviceInfo !== null && $antenaSectorialAttributeId) {
|
||||
$attrUpdates[$antenaSectorialAttributeId] = $deviceInfo;
|
||||
// Antena/Sectorial: patch if we got data and it is different
|
||||
if ($antenaSectorialAttributeId) {
|
||||
if ($deviceInfo !== null) {
|
||||
$isNewValueRepeater = (strtoupper($deviceInfo) === 'REPETIDOR');
|
||||
$isCurrentValueValuable = (!empty($currentAntenna) && strtoupper($currentAntenna) !== 'REPETIDOR' && stripos($currentAntenna, '⚠️') === false);
|
||||
|
||||
// Only update if we're not overwriting a valid sector name with a generic 'REPETIDOR'
|
||||
if (!($isNewValueRepeater && $isCurrentValueValuable)) {
|
||||
if ($deviceInfo !== $currentAntenna) {
|
||||
$attrUpdates[$antenaSectorialAttributeId] = $deviceInfo;
|
||||
$logMsg("Antenna/Sectorial to update resolved: '$deviceInfo' (previous was: '" . ($currentAntenna ?: 'empty') . "')");
|
||||
} else {
|
||||
$logMsg("Antenna info matches current CRM value '$currentAntenna'. Patch skipped.");
|
||||
}
|
||||
} else {
|
||||
$logMsg("Prevented overwriting valuable CRM antenna sector '$currentAntenna' with generic 'REPETIDOR'.");
|
||||
}
|
||||
} else {
|
||||
$logMsg("UISP did not return antenna info (deviceInfo is null).");
|
||||
}
|
||||
} else {
|
||||
$logMsg("Antenna attribute ID ('antenaSectorial') was not resolved.");
|
||||
}
|
||||
|
||||
if (!empty($attrUpdates)) {
|
||||
patchClientAttributes($ucrmApi, $clientId, $attrUpdates);
|
||||
logMessage("Client $clientId: Patched " . count($attrUpdates) . " attribute(s)");
|
||||
$logMsg("Patched " . count($attrUpdates) . " attribute(s): " . json_encode($attrUpdates));
|
||||
}
|
||||
|
||||
$result['changed'] = ($finalValue !== $currentPassword) || !empty($attrUpdates);
|
||||
|
||||
return $result;
|
||||
} catch (\Exception $e) {
|
||||
$logMsg("Fatal error in fixClientData: " . $e->getMessage(), 'error');
|
||||
$result['password'] = "Error fixing: " . $e->getMessage();
|
||||
return $result;
|
||||
}
|
||||
|
||||
0
scripts-uisp/audit_incomplete_pi.php
Normal file → Executable file
0
scripts-uisp/audit_incomplete_pi.php
Normal file → Executable file
0
scripts-uisp/clean_incomplete_pi.php
Normal file → Executable file
0
scripts-uisp/clean_incomplete_pi.php
Normal file → Executable file
@ -4,60 +4,60 @@ chdir(__DIR__ . '/../');
|
||||
|
||||
require_once __DIR__ . '/../vendor/autoload.php';
|
||||
|
||||
use Ubnt\UcrmPluginSdk\Service\UcrmApi;
|
||||
use Ubnt\UcrmPluginSdk\Service\PluginConfigManager;
|
||||
use GuzzleHttp\Client;
|
||||
|
||||
$config = PluginConfigManager::create()->loadConfig();
|
||||
$ipServer = $config['ipserver'] ?? 'localhost';
|
||||
$apiUrl = "https://$ipServer/crm/api/v1.0/";
|
||||
$token = $config['apitoken'] ?? '';
|
||||
$unmsToken = $config['unmsApiToken'] ?? '';
|
||||
|
||||
$client = new Client([
|
||||
'base_uri' => $apiUrl,
|
||||
if (empty($unmsToken)) {
|
||||
echo "Error: UNMS API Token is missing.\n";
|
||||
exit(1);
|
||||
}
|
||||
|
||||
$unmsClient = new Client([
|
||||
'base_uri' => "https://{$ipServer}/nms/api/v2.1/",
|
||||
'verify' => false,
|
||||
'headers' => [
|
||||
'X-Auth-App-Key' => $token,
|
||||
'Content-Type' => 'application/json',
|
||||
],
|
||||
'X-Auth-Token' => $unmsToken
|
||||
]
|
||||
]);
|
||||
$ucrmApi = new UcrmApi($client, $token);
|
||||
|
||||
$ids = [18, 20];
|
||||
$customAttributeKey = 'passwordAntenaCliente';
|
||||
|
||||
foreach ($ids as $id) {
|
||||
try {
|
||||
$data = $ucrmApi->get("clients/$id");
|
||||
echo "Client ID: $id\n";
|
||||
echo "IsArchived: " . ($data['isArchived'] ? 'Yes' : 'No') . "\n";
|
||||
|
||||
echo "All Attributes:\n";
|
||||
foreach ($data['attributes'] as $attr) {
|
||||
echo " - {$attr['key']} (ID: {$attr['customAttributeId']}): [{$attr['value']}]\n";
|
||||
}
|
||||
flush();
|
||||
|
||||
$passVal = null;
|
||||
$foundKey = false;
|
||||
foreach ($data['attributes'] as $attr) {
|
||||
if ($attr['key'] === $customAttributeKey) {
|
||||
$passVal = $attr['value'];
|
||||
$foundKey = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if ($foundKey) {
|
||||
echo "Attribute '$customAttributeKey' FOUND.\n";
|
||||
echo "Value: [" . $passVal . "]\n";
|
||||
echo "Type: " . gettype($passVal) . "\n";
|
||||
echo "Empty? " . (empty($passVal) ? 'Yes' : 'No') . "\n";
|
||||
try {
|
||||
echo "=== FETCHING DEVICES FROM UISP ===\n";
|
||||
$response = $unmsClient->get("devices");
|
||||
$devices = json_decode($response->getBody()->getContents(), true);
|
||||
|
||||
echo "Total devices retrieved: " . count($devices) . "\n\n";
|
||||
|
||||
$count = 0;
|
||||
foreach ($devices as $idx => $dev) {
|
||||
if ($count >= 10) break;
|
||||
$count++;
|
||||
|
||||
echo "Device #$idx:\n";
|
||||
echo " - Name: " . ($dev['identification']['name'] ?? 'N/A') . "\n";
|
||||
echo " - Role: " . ($dev['identification']['role'] ?? 'N/A') . "\n";
|
||||
echo " - Site ID: " . ($dev['identification']['site']['id'] ?? 'N/A') . "\n";
|
||||
echo " - Site Name: " . ($dev['identification']['site']['name'] ?? 'N/A') . "\n";
|
||||
|
||||
// Parent Site structure
|
||||
if (isset($dev['identification']['site']['parent'])) {
|
||||
echo " - Parent Site Name: " . ($dev['identification']['site']['parent']['name'] ?? 'N/A') . "\n";
|
||||
} else {
|
||||
echo "Attribute '$customAttributeKey' NOT FOUND in attributes list.\n";
|
||||
echo " - Parent Site structure: NOT PRESENT\n";
|
||||
}
|
||||
|
||||
// apDevice structure
|
||||
if (isset($dev['attributes']['apDevice'])) {
|
||||
echo " - apDevice Name: " . ($dev['attributes']['apDevice']['name'] ?? 'N/A') . "\n";
|
||||
echo " - apDevice ID: " . ($dev['attributes']['apDevice']['id'] ?? 'N/A') . "\n";
|
||||
} else {
|
||||
echo " - apDevice structure: NOT PRESENT\n";
|
||||
}
|
||||
echo "--------------------------------------\n";
|
||||
} catch (\Exception $e) {
|
||||
echo "Error fetching $id: " . $e->getMessage() . "\n";
|
||||
}
|
||||
} catch (\Exception $e) {
|
||||
echo "Error calling UISP API: " . $e->getMessage() . "\n";
|
||||
}
|
||||
|
||||
@ -961,6 +961,34 @@ function getClientDataNetwork($clientId, $authToken): array
|
||||
]);
|
||||
|
||||
|
||||
$currentSite = 'Sin SITE';
|
||||
$currentDevice = 'REPETIDOR';
|
||||
|
||||
try {
|
||||
// Fetch current attributes from CRM to avoid destructive overwrites
|
||||
$responseClient = $clientUcrm->get('clients/' . $clientId, [
|
||||
'headers' => [
|
||||
'X-Auth-Token' => $authToken,
|
||||
'Content-Type: application/json'
|
||||
]
|
||||
]);
|
||||
if ($responseClient->getStatusCode() === 200) {
|
||||
$clientInfo = json_decode($responseClient->getBody()->getContents(), true);
|
||||
foreach ($clientInfo['attributes'] ?? [] as $attr) {
|
||||
if ($attr['key'] === 'site') {
|
||||
$val = trim((string)$attr['value']);
|
||||
if (!empty($val)) $currentSite = $val;
|
||||
}
|
||||
if ($attr['key'] === 'antenaSectorial') {
|
||||
$val = trim((string)$attr['value']);
|
||||
if (!empty($val)) $currentDevice = $val;
|
||||
}
|
||||
}
|
||||
}
|
||||
} catch (\Exception $e) {
|
||||
// Ignore fallback fetch error
|
||||
}
|
||||
|
||||
try {
|
||||
//Obtener id del sitio por medio del servicio
|
||||
$responseServices = $clientUcrm->get('clients/services?clientId=' . $clientId, [
|
||||
@ -980,7 +1008,11 @@ function getClientDataNetwork($clientId, $authToken): array
|
||||
echo "No se encontró la clave 'unmsClientSiteId' en la respuesta." . PHP_EOL;
|
||||
$logMessage = "No se encontró la clave 'unmsClientSiteId' en la respuesta." . PHP_EOL;
|
||||
log_message($logMessage);
|
||||
return $networkData;
|
||||
return array(
|
||||
"siteName" => $currentSite,
|
||||
"device" => $currentDevice,
|
||||
"ipDevice" => 'Sin IP de cliente'
|
||||
);
|
||||
}
|
||||
//print_r('responseServices: ' . json_encode($dataServices) . PHP_EOL);
|
||||
|
||||
@ -988,7 +1020,11 @@ function getClientDataNetwork($clientId, $authToken): array
|
||||
echo "Error en la solicitud. Código de estado HTTP: " . $responseServices->getStatusCode() . PHP_EOL;
|
||||
$logMessage = "Error en la solicitud. Código de estado HTTP: " . $responseServices->getStatusCode() . PHP_EOL;
|
||||
log_message($logMessage);
|
||||
return $networkData;
|
||||
return array(
|
||||
"siteName" => $currentSite,
|
||||
"device" => $currentDevice,
|
||||
"ipDevice" => 'Sin IP de cliente'
|
||||
);
|
||||
}
|
||||
|
||||
$responseDevicesBySite = $clientUnms->request('GET', 'devices?siteId=' . $unmsSiteID, [
|
||||
@ -1013,8 +1049,8 @@ function getClientDataNetwork($clientId, $authToken): array
|
||||
log_message($logMessage);
|
||||
|
||||
$networkData = array(
|
||||
"siteName" => 'Sin SITE',
|
||||
"device" => 'REPETIDOR',
|
||||
"siteName" => $currentSite,
|
||||
"device" => $currentDevice,
|
||||
"ipDevice" => 'Sin IP de cliente'
|
||||
);
|
||||
|
||||
|
||||
@ -525,20 +525,25 @@ abstract class AbstractStripeOperationsFacade
|
||||
$clientData = $this->ucrmApi->get("clients/$clientId");
|
||||
|
||||
$passCRM = '';
|
||||
$attributeId = 17; // ID real para 'passwordAntenaCliente'
|
||||
$attributeId = $this->resolveAttributeId('passwordAntenaCliente');
|
||||
|
||||
if (isset($clientData['attributes'])) {
|
||||
foreach ($clientData['attributes'] as $attr) {
|
||||
if ($attr['key'] === 'passwordAntenaCliente') {
|
||||
$passCRM = $attr['value'] ?? '';
|
||||
$attributeId = $attr['customAttributeId'];
|
||||
$attributeId = $attr['customAttributeId'] ?? $attributeId;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if ($attributeId <= 0) {
|
||||
$this->logger->error("No se pudo resolver el ID de atributo para 'passwordAntenaCliente'. Omitiendo sincronización para cliente $clientId.");
|
||||
return;
|
||||
}
|
||||
|
||||
if (empty($passCRM) || $passCRM !== $passVault) {
|
||||
$this->logger->info("Sincronizando contraseña en CRM para cliente $clientId. [" . ($passCRM ?: 'VACIO') . "] -> [$passVault]");
|
||||
$this->logger->info("Sincronizando contraseña en CRM para cliente $clientId. [" . ($passCRM ?: 'VACIO') . "] -> [$passVault] (Atributo ID: $attributeId)");
|
||||
$this->patchClientCustomAttribute($clientId, (int)$attributeId, $passVault);
|
||||
}
|
||||
} catch (\Exception $e) {
|
||||
@ -621,6 +626,21 @@ abstract class AbstractStripeOperationsFacade
|
||||
return 0;
|
||||
}
|
||||
|
||||
private function resolvePaymentAttributeId(string $key): int
|
||||
{
|
||||
try {
|
||||
$attrs = $this->ucrmApi->get('custom-attributes', ['attributeType' => 'payment']);
|
||||
foreach ($attrs as $attr) {
|
||||
if ($attr['key'] === $key) {
|
||||
return (int)$attr['id'];
|
||||
}
|
||||
}
|
||||
} catch (\Exception $e) {
|
||||
$this->logger->error("Error resolving payment custom attribute '$key': " . $e->getMessage());
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
protected function comparePasswords(?string $crm, ?string $vault): string
|
||||
{
|
||||
if ($crm && strpos($crm, 'Error') !== 0) return $crm;
|
||||
@ -871,13 +891,17 @@ abstract class AbstractStripeOperationsFacade
|
||||
// Actually, Metadata keys are stronger than manual edits if the flow is automatic.
|
||||
// But let's respect existing valid attributes if metadata is missing.
|
||||
|
||||
$paymentAttributeId = $this->resolvePaymentAttributeId('tipoPagoStripe');
|
||||
$payment = $this->ucrmApi->get('payments/' . $paymentId); // Re-fetch in case changed? Or Use previous result.
|
||||
$currentValue = null;
|
||||
$hasAttribute = false;
|
||||
foreach ($payment['attributes'] as $attr) {
|
||||
if ($attr['key'] === 'tipoPagoStripe' || $attr['customAttributeId'] == 20) {
|
||||
if ($attr['key'] === 'tipoPagoStripe' || ($paymentAttributeId > 0 && $attr['customAttributeId'] == $paymentAttributeId)) {
|
||||
$hasAttribute = true;
|
||||
$currentValue = $attr['value'];
|
||||
if ($paymentAttributeId <= 0) {
|
||||
$paymentAttributeId = $attr['customAttributeId'];
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
@ -923,24 +947,24 @@ abstract class AbstractStripeOperationsFacade
|
||||
}
|
||||
|
||||
// 5. Apply Update
|
||||
if ($targetValue) {
|
||||
if ($targetValue && $paymentAttributeId > 0) {
|
||||
// Check redundancy
|
||||
if ($hasAttribute && $currentValue === $targetValue) {
|
||||
$this->logger->debug("Attribute already matches target '$targetValue'. Skipping patch.");
|
||||
return;
|
||||
}
|
||||
|
||||
$this->logger->info("PATCHING Payment $paymentId: Setting tipoPagoStripe = '$targetValue'");
|
||||
$this->logger->info("PATCHING Payment $paymentId: Setting tipoPagoStripe = '$targetValue' (Atributo ID: $paymentAttributeId)");
|
||||
$this->ucrmApi->patch('payments/' . $paymentId, [
|
||||
'attributes' => [
|
||||
[
|
||||
'customAttributeId' => 20,
|
||||
'customAttributeId' => $paymentAttributeId,
|
||||
'value' => $targetValue
|
||||
]
|
||||
]
|
||||
]);
|
||||
} else {
|
||||
$this->logger->debug("No se pudo determinar el tipoPagoStripe.");
|
||||
$this->logger->debug("No se pudo determinar el tipoPagoStripe o no se resolvió el ID del atributo.");
|
||||
}
|
||||
} catch (\Throwable $e) {
|
||||
$this->logger->error("Error in ensureStripePaymentAttribute: " . $e->getMessage());
|
||||
|
||||
@ -112,8 +112,13 @@ class PluginNotifierFacade extends AbstractStripeOperationsFacade
|
||||
|
||||
// 6. Fix Data
|
||||
try {
|
||||
$fixResult = \fixClientData($clientId, $this->ucrmApi, $unmsClientInstance, $attributeIds, $ucrmConfig, $currentPassword);
|
||||
$fixResult = \fixClientData($clientId, $this->ucrmApi, $unmsClientInstance, $attributeIds, $ucrmConfig, $currentPassword, $this->logger);
|
||||
$this->logger->info("Password fix result for client $clientId: " . json_encode($fixResult));
|
||||
|
||||
$passwordVal = $fixResult['password'] ?? '';
|
||||
if (stripos($passwordVal, 'Error') !== false || stripos($passwordVal, '⚠️') !== false) {
|
||||
$this->logger->error("Fallo detectado al obtener la contraseña de la antena del cliente $clientId: $passwordVal");
|
||||
}
|
||||
} catch (\Exception $e) {
|
||||
$this->logger->error("Error executing fixClientData: " . $e->getMessage());
|
||||
}
|
||||
|
||||
130
src/Plugin.php
130
src/Plugin.php
@ -440,12 +440,12 @@ class Plugin
|
||||
|
||||
//ejemplo de json_data: {"uuid":"17e043a7-03b5-4312-ab81-a7818124a77e","changeType":"edit","entity":"client","entityId":"158","eventName":"client.edit","extraData":{"entity":{"id":158,"userIdent":null,"previousIsp":null,"isLead":false,"clientType":1,"companyName":null,"companyRegistrationNumber":null,"companyTaxId":null,"companyWebsite":null,"street1":"23 San Luis","street2":null,"city":"Dolores Hidalgo Cuna de la Independencia Nacional","countryId":173,"stateId":null,"zipCode":"37804","fullAddress":"San Luis 23, Guadalupe, Dolores Hidalgo Cuna de la Independencia Nacional, Gto., M\u00e9xico","invoiceStreet1":null,"invoiceStreet2":null,"invoiceCity":null,"invoiceStateId":null,"invoiceCountryId":null,"invoiceZipCode":null,"invoiceAddressSameAsContact":true,"note":null,"sendInvoiceByPost":null,"invoiceMaturityDays":null,"stopServiceDue":null,"stopServiceDueDays":null,"organizationId":1,"tax1Id":null,"tax2Id":null,"tax3Id":null,"registrationDate":"2025-01-06T00:00:00-0600","leadConvertedAt":"2025-02-09T03:15:49-0600","companyContactFirstName":null,"companyContactLastName":null,"isActive":false,"firstName":"Luis","lastName":"Guti\u00e9rrez","username":null,"contacts":[{"id":162,"clientId":158,"email":null,"phone":null,"name":null,"isBilling":true,"isContact":true,"types":[{"id":1,"name":"Billing"},{"id":2,"name":"General"}]}],"attributes":[],"accountBalance":0,"accountCredit":0,"accountOutstanding":0,"currencyCode":"MXN","organizationName":"SIIP Pruebas","bankAccounts":[],"tags":[],"invitationEmailSentDate":null,"avatarColor":"#2196f3","addressGpsLat":21.153272,"addressGpsLon":-100.9134508,"isArchived":false,"generateProformaInvoices":null,"usesProforma":false,"hasOverdueInvoice":false,"hasOutage":false,"hasSuspendedService":false,"hasServiceWithoutDevices":false,"referral":null,"hasPaymentSubscription":false,"hasAutopayCreditCard":false},"entityBeforeEdit":{"id":158,"userIdent":null,"previousIsp":null,"isLead":true,"clientType":1,"companyName":null,"companyRegistrationNumber":null,"companyTaxId":null,"companyWebsite":null,"street1":"23 San Luis","street2":null,"city":"Dolores Hidalgo Cuna de la Independencia Nacional","countryId":173,"stateId":null,"zipCode":"37804","fullAddress":"San Luis 23, Guadalupe, Dolores Hidalgo Cuna de la Independencia Nacional, Gto., M\u00e9xico","invoiceStreet1":null,"invoiceStreet2":null,"invoiceCity":null,"invoiceStateId":null,"invoiceCountryId":null,"invoiceZipCode":null,"invoiceAddressSameAsContact":true,"note":null,"sendInvoiceByPost":null,"invoiceMaturityDays":null,"stopServiceDue":null,"stopServiceDueDays":null,"organizationId":1,"tax1Id":null,"tax2Id":null,"tax3Id":null,"registrationDate":"2025-01-06T00:00:00-0600","leadConvertedAt":null,"companyContactFirstName":null,"companyContactLastName":null,"isActive":false,"firstName":"Luis","lastName":"Guti\u00e9rrez","username":null,"contacts":[{"id":162,"clientId":158,"email":null,"phone":null,"name":null,"isBilling":true,"isContact":true,"types":[{"id":1,"name":"Billing"},{"id":2,"name":"General"}]}],"attributes":[],"accountBalance":0,"accountCredit":0,"accountOutstanding":0,"currencyCode":"MXN","organizationName":"SIIP Pruebas","bankAccounts":[],"tags":[],"invitationEmailSentDate":null,"avatarColor":"#2196f3","addressGpsLat":21.153272,"addressGpsLon":-100.9134508,"isArchived":false,"generateProformaInvoices":null,"usesProforma":false,"hasOverdueInvoice":false,"hasOutage":false,"hasSuspendedService":false,"hasServiceWithoutDevices":false,"referral":null,"hasPaymentSubscription":false,"hasAutopayCreditCard":false}}}
|
||||
|
||||
if (isset($jsonData['extraData']['entityBeforeEdit'], $jsonData['extraData']['entity'])) {
|
||||
$entityBeforeEdit = $jsonData['extraData']['entityBeforeEdit'];
|
||||
$entity = $jsonData['extraData']['entity'];
|
||||
$entity = $notification->clientData ?? null;
|
||||
if ($entity) {
|
||||
$entityBeforeEdit = $jsonData['extraData']['entityBeforeEdit'] ?? null;
|
||||
|
||||
if (isset($entityBeforeEdit['isLead'], $entity['isLead'])) {
|
||||
$isLeadBefore = $entityBeforeEdit['isLead'];
|
||||
if (isset($entity['isLead'])) {
|
||||
$isLeadBefore = $entityBeforeEdit['isLead'] ?? null;
|
||||
$isLeadAfter = $entity['isLead'];
|
||||
|
||||
if ($isLeadBefore === true && $isLeadAfter === false) {
|
||||
@ -454,75 +454,85 @@ class Plugin
|
||||
}
|
||||
}
|
||||
|
||||
if (isset($entity['tags'], $entityBeforeEdit['tags'])) {
|
||||
$tags = $entity['tags'];
|
||||
$tagsBefore = $entityBeforeEdit['tags'];
|
||||
$tags = $entity['tags'] ?? [];
|
||||
$tagsBefore = $entityBeforeEdit['tags'] ?? [];
|
||||
|
||||
$clabeTagExistsBefore = false;
|
||||
$stripeTagExistsBefore = false;
|
||||
$passwordAntenaTagExistsBefore = false;
|
||||
$clabeTagExistsBefore = false;
|
||||
$stripeTagExistsBefore = false;
|
||||
$passwordAntenaTagExistsBefore = false;
|
||||
|
||||
$clabeTagExists = false;
|
||||
$stripeTagExists = false;
|
||||
$passwordAntenaTagExists = false;
|
||||
$clabeTagExists = false;
|
||||
$stripeTagExists = false;
|
||||
$passwordAntenaTagExists = false;
|
||||
|
||||
foreach ($tagsBefore as $tag) {
|
||||
if ($tag['name'] === 'CREAR CLABE STRIPE') $clabeTagExistsBefore = true;
|
||||
if ($tag['name'] === 'CREAR CLIENTE STRIPE') $stripeTagExistsBefore = true;
|
||||
if ($tag['name'] === 'OBTENER PASSWORD ANTENA') $passwordAntenaTagExistsBefore = true;
|
||||
}
|
||||
foreach ($tagsBefore as $tag) {
|
||||
if (($tag['name'] ?? '') === 'CREAR CLABE STRIPE') $clabeTagExistsBefore = true;
|
||||
if (($tag['name'] ?? '') === 'CREAR CLIENTE STRIPE') $stripeTagExistsBefore = true;
|
||||
if (($tag['name'] ?? '') === 'OBTENER PASSWORD ANTENA') $passwordAntenaTagExistsBefore = true;
|
||||
}
|
||||
|
||||
foreach ($tags as $tag) {
|
||||
if ($tag['name'] === 'CREAR CLABE STRIPE') $clabeTagExists = true;
|
||||
if ($tag['name'] === 'CREAR CLIENTE STRIPE') $stripeTagExists = true;
|
||||
if ($tag['name'] === 'OBTENER PASSWORD ANTENA') $passwordAntenaTagExists = true;
|
||||
}
|
||||
foreach ($tags as $tag) {
|
||||
if (($tag['name'] ?? '') === 'CREAR CLABE STRIPE') $clabeTagExists = true;
|
||||
if (($tag['name'] ?? '') === 'CREAR CLIENTE STRIPE') $stripeTagExists = true;
|
||||
if (($tag['name'] ?? '') === 'OBTENER PASSWORD ANTENA') $passwordAntenaTagExists = true;
|
||||
}
|
||||
|
||||
if ($clabeTagExists && !$clabeTagExistsBefore) {
|
||||
$this->logger->debug('La etiqueta CREAR CLABE STRIPE se agregó al cliente');
|
||||
$this->pluginNotifierFacade->createStripeClient($notification, 'CREAR CLABE STRIPE', true);
|
||||
}
|
||||
if ($clabeTagExists && !$clabeTagExistsBefore) {
|
||||
$this->logger->debug('La etiqueta CREAR CLABE STRIPE se agregó al cliente o está presente');
|
||||
$this->pluginNotifierFacade->createStripeClient($notification, 'CREAR CLABE STRIPE', true);
|
||||
}
|
||||
|
||||
if ($stripeTagExists && !$stripeTagExistsBefore) {
|
||||
$this->logger->debug('La etiqueta CREAR CLIENTE STRIPE se agregó al cliente');
|
||||
$this->pluginNotifierFacade->createStripeClient($notification, 'CREAR CLIENTE STRIPE', false);
|
||||
}
|
||||
if ($stripeTagExists && !$stripeTagExistsBefore) {
|
||||
$this->logger->debug('La etiqueta CREAR CLIENTE STRIPE se agregó al cliente o está presente');
|
||||
$this->pluginNotifierFacade->createStripeClient($notification, 'CREAR CLIENTE STRIPE', false);
|
||||
}
|
||||
|
||||
if ($passwordAntenaTagExists && !$passwordAntenaTagExistsBefore) {
|
||||
$this->logger->debug('La etiqueta OBTENER PASSWORD ANTENA se agregó al cliente');
|
||||
$this->pluginNotifierFacade->processClientPasswordAntenna($clientID, $entity);
|
||||
}
|
||||
if ($passwordAntenaTagExists && !$passwordAntenaTagExistsBefore) {
|
||||
$this->logger->debug('La etiqueta OBTENER PASSWORD ANTENA se agregó al cliente o está presente');
|
||||
$this->pluginNotifierFacade->processClientPasswordAntenna((int)$clientID, $entity);
|
||||
}
|
||||
|
||||
// Automatización: Sincronizar cambios de Nombre o Email con Stripe
|
||||
$nameBefore = trim(($entityBeforeEdit['firstName'] ?? '') . ' ' . ($entityBeforeEdit['lastName'] ?? ''));
|
||||
if (empty($nameBefore)) $nameBefore = $entityBeforeEdit['companyName'] ?? '';
|
||||
if ($entityBeforeEdit) {
|
||||
$nameBefore = trim(($entityBeforeEdit['firstName'] ?? '') . ' ' . ($entityBeforeEdit['lastName'] ?? ''));
|
||||
if (empty($nameBefore)) $nameBefore = $entityBeforeEdit['companyName'] ?? '';
|
||||
|
||||
$nameAfter = trim(($entity['firstName'] ?? '') . ' ' . ($entity['lastName'] ?? ''));
|
||||
if (empty($nameAfter)) $nameAfter = $entity['companyName'] ?? '';
|
||||
$nameAfter = trim(($entity['firstName'] ?? '') . ' ' . ($entity['lastName'] ?? ''));
|
||||
if (empty($nameAfter)) $nameAfter = $entity['companyName'] ?? '';
|
||||
|
||||
$emailBefore = null;
|
||||
foreach ($entityBeforeEdit['contacts'] ?? [] as $contact) {
|
||||
if ($contact['isBilling'] || $contact['isContact']) {
|
||||
$emailBefore = $contact['email'] ?? null;
|
||||
if ($emailBefore) break;
|
||||
$emailBefore = null;
|
||||
foreach ($entityBeforeEdit['contacts'] ?? [] as $contact) {
|
||||
if ($contact['isBilling'] || $contact['isContact']) {
|
||||
$emailBefore = $contact['email'] ?? null;
|
||||
if ($emailBefore) break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$emailAfter = null;
|
||||
foreach ($entity['contacts'] ?? [] as $contact) {
|
||||
if ($contact['isBilling'] || $contact['isContact']) {
|
||||
$emailAfter = $contact['email'] ?? null;
|
||||
if ($emailAfter) break;
|
||||
$emailAfter = null;
|
||||
foreach ($entity['contacts'] ?? [] as $contact) {
|
||||
if ($contact['isBilling'] || $contact['isContact']) {
|
||||
$emailAfter = $contact['email'] ?? null;
|
||||
if ($emailAfter) break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if ($nameBefore !== $nameAfter || $emailBefore !== $emailAfter) {
|
||||
$this->logger->info("Detectado cambio en datos básicos del cliente $clientID. Sincronizando con Stripe...");
|
||||
$this->pluginNotifierFacade->syncStripeCustomerData((int)$clientID, $nameAfter, $emailAfter);
|
||||
if ($nameBefore !== $nameAfter || $emailBefore !== $emailAfter) {
|
||||
$this->logger->info("Detectado cambio en datos básicos del cliente $clientID. Sincronizando con Stripe...");
|
||||
$this->pluginNotifierFacade->syncStripeCustomerData((int)$clientID, $nameAfter, $emailAfter);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
$this->logger->warning('Los datos entityBeforeEdit o entity no están presentes en extraData');
|
||||
$this->logger->warning('Los datos del cliente no pudieron recuperarse en clientData');
|
||||
}
|
||||
|
||||
try {
|
||||
$this->logger->info("Refrescando datos del cliente $clientID desde UCRM antes de sincronizar con CallBell...");
|
||||
$refreshedClientData = $this->ucrmApi->get("clients/$clientID");
|
||||
if ($refreshedClientData) {
|
||||
$notification->clientData = $refreshedClientData;
|
||||
}
|
||||
} catch (\Exception $e) {
|
||||
$this->logger->warning("No se pudieron refrescar los datos del cliente $clientID para CallBell: " . $e->getMessage());
|
||||
}
|
||||
|
||||
$this->notifierFacade->verifyClientActionToDo($notification);
|
||||
@ -533,8 +543,12 @@ class Plugin
|
||||
$this->logger->debug('Se editó el servicio a un cliente' . PHP_EOL);
|
||||
$this->notifierFacade->verifyServiceActionToDo($notification);
|
||||
//ejemplo de json_data: {"uuid":"06d281ca-d78e-4f0a-a282-3a6b77d25da0","changeType":"edit","entity":"service","entityId":"155","eventName":"service.edit","extraData":{"entity":{"id":155,"prepaid":false,"clientId":171,"status":1,"name":"Basico 300","fullAddress":"Campeche 56, Dolores Hidalgo, 37800","street1":"Campeche 56","street2":null,"city":"Dolores Hidalgo","countryId":173,"stateId":null,"zipCode":"37800","note":null,"addressGpsLat":21.1572461,"addressGpsLon":-100.9377137,"servicePlanId":6,"servicePlanPeriodId":26,"price":300,"hasIndividualPrice":false,"totalPrice":300,"currencyCode":"MXN","invoiceLabel":null,"contractId":null,"contractLengthType":1,"minimumContractLengthMonths":null,"activeFrom":"2025-05-21T00:00:00-0600","activeTo":null,"contractEndDate":null,"discountType":0,"discountValue":null,"discountInvoiceLabel":"Descuento","discountFrom":null,"discountTo":null,"tax1Id":null,"tax2Id":null,"tax3Id":null,"invoicingStart":"2025-05-21T00:00:00-0600","invoicingPeriodType":1,"invoicingPeriodStartDay":1,"nextInvoicingDayAdjustment":10,"invoicingProratedSeparately":true,"invoicingSeparately":false,"sendEmailsAutomatically":null,"useCreditAutomatically":true,"servicePlanName":"Basico 300","servicePlanPrice":300,"servicePlanPeriod":1,"servicePlanType":"Internet","downloadSpeed":8,"uploadSpeed":8,"hasOutage":false,"unmsClientSiteStatus":null,"fccBlockId":null,"lastInvoicedDate":null,"unmsClientSiteId":"359cb58d-e64f-453a-890e-23d5abb4f116","attributes":[],"addressData":null,"suspensionReasonId":null,"serviceChangeRequestId":null,"setupFeePrice":null,"earlyTerminationFeePrice":null,"downloadSpeedOverride":null,"uploadSpeedOverride":null,"trafficShapingOverrideEnd":null,"trafficShapingOverrideEnabled":false,"servicePlanGroupId":null,"suspensionPeriods":[],"surcharges":[]},"entityBeforeEdit":{"id":155,"prepaid":false,"clientId":171,"status":1,"name":"Basico 300","fullAddress":"Campeche 56, Dolores Hidalgo, 37800","street1":"Campeche 56","street2":null,"city":"Dolores Hidalgo","countryId":173,"stateId":null,"zipCode":"37800","note":null,"addressGpsLat":21.1572461,"addressGpsLon":-100.9377137,"servicePlanId":6,"servicePlanPeriodId":26,"price":300,"hasIndividualPrice":false,"totalPrice":300,"currencyCode":"MXN","invoiceLabel":null,"contractId":null,"contractLengthType":1,"minimumContractLengthMonths":null,"activeFrom":"2025-05-21T00:00:00-0600","activeTo":null,"contractEndDate":null,"discountType":0,"discountValue":null,"discountInvoiceLabel":"Descuento","discountFrom":null,"discountTo":null,"tax1Id":null,"tax2Id":null,"tax3Id":null,"invoicingStart":"2025-05-21T00:00:00-0600","invoicingPeriodType":1,"invoicingPeriodStartDay":1,"nextInvoicingDayAdjustment":10,"invoicingProratedSeparately":true,"invoicingSeparately":false,"sendEmailsAutomatically":null,"useCreditAutomatically":true,"servicePlanName":"Basico 300","servicePlanPrice":300,"servicePlanPeriod":1,"servicePlanType":"Internet","downloadSpeed":8,"uploadSpeed":8,"hasOutage":false,"unmsClientSiteStatus":null,"fccBlockId":null,"lastInvoicedDate":null,"unmsClientSiteId":"359cb58d-e64f-453a-890e-23d5abb4f116","attributes":[],"addressData":null,"suspensionReasonId":null,"serviceChangeRequestId":null,"setupFeePrice":null,"earlyTerminationFeePrice":null,"downloadSpeedOverride":null,"uploadSpeedOverride":null,"trafficShapingOverrideEnd":null,"trafficShapingOverrideEnabled":false,"servicePlanGroupId":null,"suspensionPeriods":[],"surcharges":[]}}}
|
||||
$clientID = $jsonData['extraData']['entity']['clientId'];
|
||||
$this->pluginNotifierFacade->updatePasswordAntenaIfNeeded($clientID, $jsonData);
|
||||
$clientID = $jsonData['extraData']['entity']['clientId'] ?? $notification->clientId ?? null;
|
||||
if ($clientID) {
|
||||
$this->pluginNotifierFacade->updatePasswordAntenaIfNeeded((int)$clientID, $jsonData);
|
||||
} else {
|
||||
$this->logger->warning('No se pudo resolver el ID de cliente en service.edit para updatePasswordAntenaIfNeeded');
|
||||
}
|
||||
} else if ($notification->eventName === 'service.suspend') {
|
||||
$this->logger->debug('Se suspendió el servicio a un cliente' . PHP_EOL);
|
||||
$this->notifierFacade->verifyServiceActionToDo($notification);
|
||||
|
||||
0
test_patch.php
Normal file → Executable file
0
test_patch.php
Normal file → Executable file
0
test_script.php
Normal file → Executable file
0
test_script.php
Normal file → Executable file
0
test_script2.php
Normal file → Executable file
0
test_script2.php
Normal file → Executable file
0
test_stripe.php
Normal file → Executable file
0
test_stripe.php
Normal file → Executable file
90014
unms-swagger.json
90014
unms-swagger.json
File diff suppressed because it is too large
Load Diff
8392
unmscrm.apib
8392
unmscrm.apib
File diff suppressed because it is too large
Load Diff
0
vendor/aws/aws-crt-php/CODE_OF_CONDUCT.md
vendored
Normal file → Executable file
0
vendor/aws/aws-crt-php/CODE_OF_CONDUCT.md
vendored
Normal file → Executable file
0
vendor/aws/aws-crt-php/LICENSE
vendored
Normal file → Executable file
0
vendor/aws/aws-crt-php/LICENSE
vendored
Normal file → Executable file
0
vendor/aws/aws-crt-php/NOTICE
vendored
Normal file → Executable file
0
vendor/aws/aws-crt-php/NOTICE
vendored
Normal file → Executable file
0
vendor/aws/aws-crt-php/README.md
vendored
Normal file → Executable file
0
vendor/aws/aws-crt-php/README.md
vendored
Normal file → Executable file
0
vendor/aws/aws-crt-php/composer.json
vendored
Normal file → Executable file
0
vendor/aws/aws-crt-php/composer.json
vendored
Normal file → Executable file
0
vendor/aws/aws-crt-php/src/AWS/CRT/Auth/AwsCredentials.php
vendored
Normal file → Executable file
0
vendor/aws/aws-crt-php/src/AWS/CRT/Auth/AwsCredentials.php
vendored
Normal file → Executable file
0
vendor/aws/aws-crt-php/src/AWS/CRT/Auth/CredentialsProvider.php
vendored
Normal file → Executable file
0
vendor/aws/aws-crt-php/src/AWS/CRT/Auth/CredentialsProvider.php
vendored
Normal file → Executable file
0
vendor/aws/aws-crt-php/src/AWS/CRT/Auth/Signable.php
vendored
Normal file → Executable file
0
vendor/aws/aws-crt-php/src/AWS/CRT/Auth/Signable.php
vendored
Normal file → Executable file
0
vendor/aws/aws-crt-php/src/AWS/CRT/Auth/SignatureType.php
vendored
Normal file → Executable file
0
vendor/aws/aws-crt-php/src/AWS/CRT/Auth/SignatureType.php
vendored
Normal file → Executable file
0
vendor/aws/aws-crt-php/src/AWS/CRT/Auth/SignedBodyHeaderType.php
vendored
Normal file → Executable file
0
vendor/aws/aws-crt-php/src/AWS/CRT/Auth/SignedBodyHeaderType.php
vendored
Normal file → Executable file
0
vendor/aws/aws-crt-php/src/AWS/CRT/Auth/Signing.php
vendored
Normal file → Executable file
0
vendor/aws/aws-crt-php/src/AWS/CRT/Auth/Signing.php
vendored
Normal file → Executable file
0
vendor/aws/aws-crt-php/src/AWS/CRT/Auth/SigningAlgorithm.php
vendored
Normal file → Executable file
0
vendor/aws/aws-crt-php/src/AWS/CRT/Auth/SigningAlgorithm.php
vendored
Normal file → Executable file
0
vendor/aws/aws-crt-php/src/AWS/CRT/Auth/SigningConfigAWS.php
vendored
Normal file → Executable file
0
vendor/aws/aws-crt-php/src/AWS/CRT/Auth/SigningConfigAWS.php
vendored
Normal file → Executable file
0
vendor/aws/aws-crt-php/src/AWS/CRT/Auth/SigningResult.php
vendored
Normal file → Executable file
0
vendor/aws/aws-crt-php/src/AWS/CRT/Auth/SigningResult.php
vendored
Normal file → Executable file
0
vendor/aws/aws-crt-php/src/AWS/CRT/Auth/StaticCredentialsProvider.php
vendored
Normal file → Executable file
0
vendor/aws/aws-crt-php/src/AWS/CRT/Auth/StaticCredentialsProvider.php
vendored
Normal file → Executable file
0
vendor/aws/aws-crt-php/src/AWS/CRT/CRT.php
vendored
Normal file → Executable file
0
vendor/aws/aws-crt-php/src/AWS/CRT/CRT.php
vendored
Normal file → Executable file
0
vendor/aws/aws-crt-php/src/AWS/CRT/HTTP/Headers.php
vendored
Normal file → Executable file
0
vendor/aws/aws-crt-php/src/AWS/CRT/HTTP/Headers.php
vendored
Normal file → Executable file
0
vendor/aws/aws-crt-php/src/AWS/CRT/HTTP/Message.php
vendored
Normal file → Executable file
0
vendor/aws/aws-crt-php/src/AWS/CRT/HTTP/Message.php
vendored
Normal file → Executable file
0
vendor/aws/aws-crt-php/src/AWS/CRT/HTTP/Request.php
vendored
Normal file → Executable file
0
vendor/aws/aws-crt-php/src/AWS/CRT/HTTP/Request.php
vendored
Normal file → Executable file
0
vendor/aws/aws-crt-php/src/AWS/CRT/HTTP/Response.php
vendored
Normal file → Executable file
0
vendor/aws/aws-crt-php/src/AWS/CRT/HTTP/Response.php
vendored
Normal file → Executable file
0
vendor/aws/aws-crt-php/src/AWS/CRT/IO/EventLoopGroup.php
vendored
Normal file → Executable file
0
vendor/aws/aws-crt-php/src/AWS/CRT/IO/EventLoopGroup.php
vendored
Normal file → Executable file
0
vendor/aws/aws-crt-php/src/AWS/CRT/IO/InputStream.php
vendored
Normal file → Executable file
0
vendor/aws/aws-crt-php/src/AWS/CRT/IO/InputStream.php
vendored
Normal file → Executable file
0
vendor/aws/aws-crt-php/src/AWS/CRT/Internal/Encoding.php
vendored
Normal file → Executable file
0
vendor/aws/aws-crt-php/src/AWS/CRT/Internal/Encoding.php
vendored
Normal file → Executable file
0
vendor/aws/aws-crt-php/src/AWS/CRT/Internal/Extension.php
vendored
Normal file → Executable file
0
vendor/aws/aws-crt-php/src/AWS/CRT/Internal/Extension.php
vendored
Normal file → Executable file
0
vendor/aws/aws-crt-php/src/AWS/CRT/Log.php
vendored
Normal file → Executable file
0
vendor/aws/aws-crt-php/src/AWS/CRT/Log.php
vendored
Normal file → Executable file
0
vendor/aws/aws-crt-php/src/AWS/CRT/NativeResource.php
vendored
Normal file → Executable file
0
vendor/aws/aws-crt-php/src/AWS/CRT/NativeResource.php
vendored
Normal file → Executable file
0
vendor/aws/aws-crt-php/src/AWS/CRT/Options.php
vendored
Normal file → Executable file
0
vendor/aws/aws-crt-php/src/AWS/CRT/Options.php
vendored
Normal file → Executable file
0
vendor/aws/aws-sdk-php/CODE_OF_CONDUCT.md
vendored
Normal file → Executable file
0
vendor/aws/aws-sdk-php/CODE_OF_CONDUCT.md
vendored
Normal file → Executable file
0
vendor/aws/aws-sdk-php/CRT_INSTRUCTIONS.md
vendored
Normal file → Executable file
0
vendor/aws/aws-sdk-php/CRT_INSTRUCTIONS.md
vendored
Normal file → Executable file
0
vendor/aws/aws-sdk-php/LICENSE
vendored
Normal file → Executable file
0
vendor/aws/aws-sdk-php/LICENSE
vendored
Normal file → Executable file
0
vendor/aws/aws-sdk-php/NOTICE
vendored
Normal file → Executable file
0
vendor/aws/aws-sdk-php/NOTICE
vendored
Normal file → Executable file
0
vendor/aws/aws-sdk-php/THIRD-PARTY-LICENSES
vendored
Normal file → Executable file
0
vendor/aws/aws-sdk-php/THIRD-PARTY-LICENSES
vendored
Normal file → Executable file
0
vendor/aws/aws-sdk-php/composer.json
vendored
Normal file → Executable file
0
vendor/aws/aws-sdk-php/composer.json
vendored
Normal file → Executable file
0
vendor/aws/aws-sdk-php/src/ACMPCA/ACMPCAClient.php
vendored
Normal file → Executable file
0
vendor/aws/aws-sdk-php/src/ACMPCA/ACMPCAClient.php
vendored
Normal file → Executable file
0
vendor/aws/aws-sdk-php/src/ACMPCA/Exception/ACMPCAException.php
vendored
Normal file → Executable file
0
vendor/aws/aws-sdk-php/src/ACMPCA/Exception/ACMPCAException.php
vendored
Normal file → Executable file
0
vendor/aws/aws-sdk-php/src/AIOps/AIOpsClient.php
vendored
Normal file → Executable file
0
vendor/aws/aws-sdk-php/src/AIOps/AIOpsClient.php
vendored
Normal file → Executable file
0
vendor/aws/aws-sdk-php/src/AIOps/Exception/AIOpsException.php
vendored
Normal file → Executable file
0
vendor/aws/aws-sdk-php/src/AIOps/Exception/AIOpsException.php
vendored
Normal file → Executable file
0
vendor/aws/aws-sdk-php/src/ARCRegionSwitch/ARCRegionSwitchClient.php
vendored
Normal file → Executable file
0
vendor/aws/aws-sdk-php/src/ARCRegionSwitch/ARCRegionSwitchClient.php
vendored
Normal file → Executable file
0
vendor/aws/aws-sdk-php/src/ARCRegionSwitch/Exception/ARCRegionSwitchException.php
vendored
Normal file → Executable file
0
vendor/aws/aws-sdk-php/src/ARCRegionSwitch/Exception/ARCRegionSwitchException.php
vendored
Normal file → Executable file
0
vendor/aws/aws-sdk-php/src/ARCZonalShift/ARCZonalShiftClient.php
vendored
Normal file → Executable file
0
vendor/aws/aws-sdk-php/src/ARCZonalShift/ARCZonalShiftClient.php
vendored
Normal file → Executable file
0
vendor/aws/aws-sdk-php/src/ARCZonalShift/Exception/ARCZonalShiftException.php
vendored
Normal file → Executable file
0
vendor/aws/aws-sdk-php/src/ARCZonalShift/Exception/ARCZonalShiftException.php
vendored
Normal file → Executable file
0
vendor/aws/aws-sdk-php/src/AbstractConfigurationProvider.php
vendored
Normal file → Executable file
0
vendor/aws/aws-sdk-php/src/AbstractConfigurationProvider.php
vendored
Normal file → Executable file
0
vendor/aws/aws-sdk-php/src/AccessAnalyzer/AccessAnalyzerClient.php
vendored
Normal file → Executable file
0
vendor/aws/aws-sdk-php/src/AccessAnalyzer/AccessAnalyzerClient.php
vendored
Normal file → Executable file
0
vendor/aws/aws-sdk-php/src/AccessAnalyzer/Exception/AccessAnalyzerException.php
vendored
Normal file → Executable file
0
vendor/aws/aws-sdk-php/src/AccessAnalyzer/Exception/AccessAnalyzerException.php
vendored
Normal file → Executable file
0
vendor/aws/aws-sdk-php/src/Account/AccountClient.php
vendored
Normal file → Executable file
0
vendor/aws/aws-sdk-php/src/Account/AccountClient.php
vendored
Normal file → Executable file
0
vendor/aws/aws-sdk-php/src/Account/Exception/AccountException.php
vendored
Normal file → Executable file
0
vendor/aws/aws-sdk-php/src/Account/Exception/AccountException.php
vendored
Normal file → Executable file
0
vendor/aws/aws-sdk-php/src/Acm/AcmClient.php
vendored
Normal file → Executable file
0
vendor/aws/aws-sdk-php/src/Acm/AcmClient.php
vendored
Normal file → Executable file
0
vendor/aws/aws-sdk-php/src/Acm/Exception/AcmException.php
vendored
Normal file → Executable file
0
vendor/aws/aws-sdk-php/src/Acm/Exception/AcmException.php
vendored
Normal file → Executable file
0
vendor/aws/aws-sdk-php/src/Amplify/AmplifyClient.php
vendored
Normal file → Executable file
0
vendor/aws/aws-sdk-php/src/Amplify/AmplifyClient.php
vendored
Normal file → Executable file
0
vendor/aws/aws-sdk-php/src/Amplify/Exception/AmplifyException.php
vendored
Normal file → Executable file
0
vendor/aws/aws-sdk-php/src/Amplify/Exception/AmplifyException.php
vendored
Normal file → Executable file
0
vendor/aws/aws-sdk-php/src/AmplifyBackend/AmplifyBackendClient.php
vendored
Normal file → Executable file
0
vendor/aws/aws-sdk-php/src/AmplifyBackend/AmplifyBackendClient.php
vendored
Normal file → Executable file
0
vendor/aws/aws-sdk-php/src/AmplifyBackend/Exception/AmplifyBackendException.php
vendored
Normal file → Executable file
0
vendor/aws/aws-sdk-php/src/AmplifyBackend/Exception/AmplifyBackendException.php
vendored
Normal file → Executable file
0
vendor/aws/aws-sdk-php/src/AmplifyUIBuilder/AmplifyUIBuilderClient.php
vendored
Normal file → Executable file
0
vendor/aws/aws-sdk-php/src/AmplifyUIBuilder/AmplifyUIBuilderClient.php
vendored
Normal file → Executable file
0
vendor/aws/aws-sdk-php/src/AmplifyUIBuilder/Exception/AmplifyUIBuilderException.php
vendored
Normal file → Executable file
0
vendor/aws/aws-sdk-php/src/AmplifyUIBuilder/Exception/AmplifyUIBuilderException.php
vendored
Normal file → Executable file
0
vendor/aws/aws-sdk-php/src/Api/AbstractModel.php
vendored
Normal file → Executable file
0
vendor/aws/aws-sdk-php/src/Api/AbstractModel.php
vendored
Normal file → Executable file
0
vendor/aws/aws-sdk-php/src/Api/ApiProvider.php
vendored
Normal file → Executable file
0
vendor/aws/aws-sdk-php/src/Api/ApiProvider.php
vendored
Normal file → Executable file
0
vendor/aws/aws-sdk-php/src/Api/Cbor/CborDecoder.php
vendored
Normal file → Executable file
0
vendor/aws/aws-sdk-php/src/Api/Cbor/CborDecoder.php
vendored
Normal file → Executable file
0
vendor/aws/aws-sdk-php/src/Api/Cbor/CborEncoder.php
vendored
Normal file → Executable file
0
vendor/aws/aws-sdk-php/src/Api/Cbor/CborEncoder.php
vendored
Normal file → Executable file
0
vendor/aws/aws-sdk-php/src/Api/Cbor/Exception/CborException.php
vendored
Normal file → Executable file
0
vendor/aws/aws-sdk-php/src/Api/Cbor/Exception/CborException.php
vendored
Normal file → Executable file
0
vendor/aws/aws-sdk-php/src/Api/DateTimeResult.php
vendored
Normal file → Executable file
0
vendor/aws/aws-sdk-php/src/Api/DateTimeResult.php
vendored
Normal file → Executable file
0
vendor/aws/aws-sdk-php/src/Api/DocModel.php
vendored
Normal file → Executable file
0
vendor/aws/aws-sdk-php/src/Api/DocModel.php
vendored
Normal file → Executable file
0
vendor/aws/aws-sdk-php/src/Api/ErrorParser/AbstractErrorParser.php
vendored
Normal file → Executable file
0
vendor/aws/aws-sdk-php/src/Api/ErrorParser/AbstractErrorParser.php
vendored
Normal file → Executable file
0
vendor/aws/aws-sdk-php/src/Api/ErrorParser/AbstractRpcV2ErrorParser.php
vendored
Normal file → Executable file
0
vendor/aws/aws-sdk-php/src/Api/ErrorParser/AbstractRpcV2ErrorParser.php
vendored
Normal file → Executable file
0
vendor/aws/aws-sdk-php/src/Api/ErrorParser/JsonParserTrait.php
vendored
Normal file → Executable file
0
vendor/aws/aws-sdk-php/src/Api/ErrorParser/JsonParserTrait.php
vendored
Normal file → Executable file
0
vendor/aws/aws-sdk-php/src/Api/ErrorParser/JsonRpcErrorParser.php
vendored
Normal file → Executable file
0
vendor/aws/aws-sdk-php/src/Api/ErrorParser/JsonRpcErrorParser.php
vendored
Normal file → Executable file
0
vendor/aws/aws-sdk-php/src/Api/ErrorParser/RestJsonErrorParser.php
vendored
Normal file → Executable file
0
vendor/aws/aws-sdk-php/src/Api/ErrorParser/RestJsonErrorParser.php
vendored
Normal file → Executable file
0
vendor/aws/aws-sdk-php/src/Api/ErrorParser/RpcV2CborErrorParser.php
vendored
Normal file → Executable file
0
vendor/aws/aws-sdk-php/src/Api/ErrorParser/RpcV2CborErrorParser.php
vendored
Normal file → Executable file
0
vendor/aws/aws-sdk-php/src/Api/ErrorParser/XmlErrorParser.php
vendored
Normal file → Executable file
0
vendor/aws/aws-sdk-php/src/Api/ErrorParser/XmlErrorParser.php
vendored
Normal file → Executable file
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user