# Modulo Información Personal

# Obtener Usuario (2) - [get-user3]

## 🧾 Descripción

*Obtiene la información completa de un usuario del sistema, ya sea **Empleado** o **Estudiante**, de acuerdo al identificador enviado (email o DNI/pasaporte).*  
*Retorna datos personales, laborales, de contrato y estado del usuario.*  
*Si es empleado, consulta tablas de Employee —si no existe— consulta Student.*

---

# 🚀 Endpoint

<div class="contain-inline-size rounded-2xl relative bg-token-sidebar-surface-primary" id="bkmrk-post-%2Fget-user3"><div class="sticky top-9"><div class="absolute end-0 bottom-0 flex h-9 items-center pe-2"><div class="bg-token-bg-elevated-secondary text-token-text-secondary flex items-center gap-4 rounded-sm px-2 font-sans text-xs">  
</div></div></div><div class="overflow-y-auto p-4" dir="ltr"><span style="color: rgb(224, 62, 45);">**`POST /get-user3`**</span></div></div>> La ruta final depende de tus archivos <span style="color: rgb(224, 62, 45);">**`api.php`**</span>.

---

# 🔐 Seguridad

- No valida token aquí, pero depende del mecanismo usado dentro de <span style="color: rgb(224, 62, 45);">**`general->dbErp`**</span> y <span style="color: rgb(224, 62, 45);">**`general->ServiceErp`**</span>.
- Debe ser usado desde una app autenticada.

---

# 📥 Request Body

<div class="contain-inline-size rounded-2xl relative bg-token-sidebar-surface-primary" id="bkmrk--3"><div class="sticky top-9"><div class="absolute end-0 bottom-0 flex h-9 items-center pe-2"></div></div><div class="overflow-y-auto p-4" dir="ltr"></div></div><table border="1" id="bkmrk-%7B-%22username%22%3A-%22strin" style="border-collapse: collapse; width: 100%;"><colgroup><col style="width: 99.881%;"></col></colgroup><tbody><tr><td>`<span class="hljs-punctuation">{</span>  <span class="hljs-attr">"username"</span><span class="hljs-punctuation">:</span> <span class="hljs-string">"string"</span><span class="hljs-punctuation">}</span>`</td></tr></tbody></table>

### Parámetros

<div class="_tableContainer_1rjym_1" id="bkmrk-campo-tipo-requerido"><div class="group _tableWrapper_1rjym_13 flex w-fit flex-col-reverse" tabindex="-1"><table class="w-fit min-w-(--thread-content-width)" data-end="1062" data-start="877"><thead data-end="925" data-start="877"><tr data-end="925" data-start="877"><th data-col-size="sm" data-end="889" data-start="877">Campo</th><th data-col-size="sm" data-end="898" data-start="889">Tipo</th><th data-col-size="sm" data-end="910" data-start="898">Requerido</th><th data-col-size="md" data-end="925" data-start="910">Descripción</th></tr></thead><tbody data-end="1062" data-start="975"><tr data-end="1062" data-start="975"><td data-col-size="sm" data-end="987" data-start="975">username</td><td data-col-size="sm" data-end="996" data-start="987">string</td><td data-col-size="sm" data-end="1008" data-start="996">Sí</td><td data-col-size="md" data-end="1062" data-start="1008">Email del usuario o número de documento/pasaporte.</td></tr></tbody></table>

</div></div>---

# 📤 Respuestas

## ✔️ 200 – Usuario encontrado (Empleado)

<div class="contain-inline-size rounded-2xl relative bg-token-sidebar-surface-primary" id="bkmrk-%7B-%22valor%22%3A-true%2C-%22ms"><div class="sticky top-9"><div class="absolute end-0 bottom-0 flex h-9 items-center pe-2"><div class="bg-token-bg-elevated-secondary text-token-text-secondary flex items-center gap-4 rounded-sm px-2 font-sans text-xs">  
</div></div></div><div class="overflow-y-auto p-4" dir="ltr"><table border="1" style="border-collapse: collapse; width: 100%;"><colgroup><col style="width: 99.881%;"></col></colgroup><tbody><tr><td>`<span class="hljs-punctuation">{</span>  <span class="hljs-attr">"valor"</span><span class="hljs-punctuation">:</span> <span class="hljs-literal"><span class="hljs-keyword">true</span></span><span class="hljs-punctuation">,</span>  <span class="hljs-attr">"msn"</span><span class="hljs-punctuation">:</span> <span class="hljs-string">"Si hay data"</span><span class="hljs-punctuation">,</span>  <span class="hljs-attr">"data"</span><span class="hljs-punctuation">:</span> <span class="hljs-punctuation">[</span>    <span class="hljs-punctuation">{</span>      <span class="hljs-attr">"name"</span><span class="hljs-punctuation">:</span> <span class="hljs-string">"EMP000123"</span><span class="hljs-punctuation">,</span>      <span class="hljs-attr">"employee_name"</span><span class="hljs-punctuation">:</span> <span class="hljs-string">"Juan Pérez"</span><span class="hljs-punctuation">,</span>      <span class="hljs-attr">"tipo_usuario"</span><span class="hljs-punctuation">:</span> <span class="hljs-string">"Empleado"</span><span class="hljs-punctuation">,</span>      <span class="hljs-attr">"status"</span><span class="hljs-punctuation">:</span> <span class="hljs-string">"Active"</span><span class="hljs-punctuation">,</span>      <span class="hljs-attr">"vigencia_contrato"</span><span class="hljs-punctuation">:</span> <span class="hljs-string">"2024-01-01 hasta 2024-12-31"</span><span class="hljs-punctuation">,</span>      <span class="hljs-attr">"contratacion"</span><span class="hljs-punctuation">:</span> <span class="hljs-string">"primer_contrato"</span><span class="hljs-punctuation">,</span>      <span class="hljs-attr">"pets"</span><span class="hljs-punctuation">:</span> <span class="hljs-string">"0"</span><span class="hljs-punctuation">,</span>      <span class="hljs-attr">"fecha_de_nacimiento"</span><span class="hljs-punctuation">:</span> <span class="hljs-string">"05-12"</span><span class="hljs-punctuation">,</span>      <span class="hljs-attr">"..."</span><span class="hljs-punctuation">:</span> <span class="hljs-string">"otros_campos"</span>    <span class="hljs-punctuation">}</span>  <span class="hljs-punctuation">]</span><span class="hljs-punctuation">}</span>`</td></tr></tbody></table>

</div><div class="overflow-y-auto p-4" dir="ltr"></div></div>---

## ✔️ 200 – Usuario encontrado (Estudiante)

<div class="contain-inline-size rounded-2xl relative bg-token-sidebar-surface-primary" id="bkmrk-%7B-%22valor%22%3A-true%2C-%22ms-1"><div class="sticky top-9"><div class="absolute end-0 bottom-0 flex h-9 items-center pe-2"><div class="bg-token-bg-elevated-secondary text-token-text-secondary flex items-center gap-4 rounded-sm px-2 font-sans text-xs"><table border="1" style="border-collapse: collapse; width: 100%;"><colgroup><col style="width: 99.881%;"></col></colgroup><tbody><tr><td>`<span class="hljs-punctuation">{</span>  <span class="hljs-attr">"valor"</span><span class="hljs-punctuation">:</span> <span class="hljs-literal"><span class="hljs-keyword">true</span></span><span class="hljs-punctuation">,</span>  <span class="hljs-attr">"msn"</span><span class="hljs-punctuation">:</span> <span class="hljs-string">"Si hay data"</span><span class="hljs-punctuation">,</span>  <span class="hljs-attr">"data"</span><span class="hljs-punctuation">:</span> <span class="hljs-punctuation">[</span>    <span class="hljs-punctuation">{</span>      <span class="hljs-attr">"name"</span><span class="hljs-punctuation">:</span> <span class="hljs-string">"STU00234"</span><span class="hljs-punctuation">,</span>      <span class="hljs-attr">"employee_name"</span><span class="hljs-punctuation">:</span> <span class="hljs-string">"Estudiante Ejemplo"</span><span class="hljs-punctuation">,</span>      <span class="hljs-attr">"tipo_usuario"</span><span class="hljs-punctuation">:</span> <span class="hljs-string">"Estudiante"</span><span class="hljs-punctuation">,</span>      <span class="hljs-attr">"statusUser"</span><span class="hljs-punctuation">:</span> <span class="hljs-number">1</span><span class="hljs-punctuation">,</span>      <span class="hljs-attr">"fecha_de_nacimiento"</span><span class="hljs-punctuation">:</span> <span class="hljs-string">""</span><span class="hljs-punctuation">,</span>      <span class="hljs-attr">"..."</span><span class="hljs-punctuation">:</span> <span class="hljs-string">"otros_campos"</span>    <span class="hljs-punctuation">}</span>  <span class="hljs-punctuation">]</span><span class="hljs-punctuation">}</span>`</td></tr></tbody></table>

</div></div></div><div class="overflow-y-auto p-4" dir="ltr"></div></div>---

## ❌ Usuario no encontrado en Employee ni Student

<div class="contain-inline-size rounded-2xl relative bg-token-sidebar-surface-primary" id="bkmrk--7"><div class="sticky top-9"><div class="absolute end-0 bottom-0 flex h-9 items-center pe-2"><div class="bg-token-bg-elevated-secondary text-token-text-secondary flex items-center gap-4 rounded-sm px-2 font-sans text-xs">  
</div></div></div><div class="overflow-y-auto p-4" dir="ltr"></div></div><table border="1" id="bkmrk-%7B-%22valor%22%3A-false%2C-%22m" style="border-collapse: collapse; width: 100%;"><colgroup><col style="width: 99.881%;"></col></colgroup><tbody><tr><td>`<span class="hljs-punctuation">{</span>  <span class="hljs-attr">"valor"</span><span class="hljs-punctuation">:</span> <span class="hljs-literal"><span class="hljs-keyword">false</span></span><span class="hljs-punctuation">,</span>  <span class="hljs-attr">"msn"</span><span class="hljs-punctuation">:</span> <span class="hljs-string">"Sin Estudiante: Su usuario no tiene permisos para acceder al aplicativo. Contactar con soporte."</span><span class="hljs-punctuation">,</span>  <span class="hljs-attr">"data"</span><span class="hljs-punctuation">:</span> <span class="hljs-punctuation">[</span><span class="hljs-punctuation">]</span><span class="hljs-punctuation">}</span>`</td></tr></tbody></table>

---

## ❌ Empleado inactivo

<div class="contain-inline-size rounded-2xl relative bg-token-sidebar-surface-primary" id="bkmrk--9"><div class="sticky top-9"><div class="absolute end-0 bottom-0 flex h-9 items-center pe-2"><div class="bg-token-bg-elevated-secondary text-token-text-secondary flex items-center gap-4 rounded-sm px-2 font-sans text-xs">  
</div></div></div><div class="overflow-y-auto p-4" dir="ltr"></div></div><table border="1" id="bkmrk-%7B-%22valor%22%3A-false%2C-%22m-1" style="border-collapse: collapse; width: 100%;"><colgroup><col style="width: 99.881%;"></col></colgroup><tbody><tr><td>`<span class="hljs-punctuation">{</span>  <span class="hljs-attr">"valor"</span><span class="hljs-punctuation">:</span> <span class="hljs-literal"><span class="hljs-keyword">false</span></span><span class="hljs-punctuation">,</span>  <span class="hljs-attr">"msn"</span><span class="hljs-punctuation">:</span> <span class="hljs-string">"Empleado Inactivo: Comuníquese con su administrador para que pueda verificar el estado de su empleado."</span><span class="hljs-punctuation">,</span>  <span class="hljs-attr">"data"</span><span class="hljs-punctuation">:</span> <span class="hljs-punctuation">[</span> ... <span class="hljs-punctuation">]</span><span class="hljs-punctuation">}</span>`</td></tr></tbody></table>

---

## ❌ Usuario estudiante deshabilitado

<div class="contain-inline-size rounded-2xl relative bg-token-sidebar-surface-primary" id="bkmrk--11"><div class="sticky top-9"><div class="absolute end-0 bottom-0 flex h-9 items-center pe-2"><div class="bg-token-bg-elevated-secondary text-token-text-secondary flex items-center gap-4 rounded-sm px-2 font-sans text-xs">  
</div></div></div><div class="overflow-y-auto p-4" dir="ltr"></div></div><table border="1" id="bkmrk-%7B-%22valor%22%3A-false%2C-%22m-2" style="border-collapse: collapse; width: 100%;"><colgroup><col style="width: 99.881%;"></col></colgroup><tbody><tr><td>`<span class="hljs-punctuation">{</span>  <span class="hljs-attr">"valor"</span><span class="hljs-punctuation">:</span> <span class="hljs-literal"><span class="hljs-keyword">false</span></span><span class="hljs-punctuation">,</span>  <span class="hljs-attr">"msn"</span><span class="hljs-punctuation">:</span> <span class="hljs-string">"Usuario Deshabilitado: Comuníquese con su administrador para que pueda verificar el estado de su empleado."</span><span class="hljs-punctuation">,</span>  <span class="hljs-attr">"data"</span><span class="hljs-punctuation">:</span> <span class="hljs-punctuation">[</span> ... <span class="hljs-punctuation">]</span><span class="hljs-punctuation">}</span>`</td></tr></tbody></table>

---

# 🧩 Lógica del Servicio

### 1️⃣ Determinar tipo de búsqueda

Si el username contiene **@**, se busca por: <span style="color: rgb(224, 62, 45);">**`<span class="hljs-attr">Employee.user_id</span> = username`**</span>

Si no: <span style="color: rgb(224, 62, 45);">**`<span class="hljs-attr">Employee.passport_number</span> = username`**</span>

---

### 2️⃣ Consulta principal (Employee)

Usa <span style="color: rgb(224, 62, 45);">**`dbErp`** </span>con una consulta SQL dinámica unida a:

- tabEmployee
- tabUser
- tabBranch
- tabContrato de Trabajo
- tabDepartment

Si **no hay resultados** → se intenta en Student.

---

### 3️⃣ Consulta secundaria (Student)

**Busca en:**

- tabStudent
- tabUser
- tabBranch
- tabJob Applicant
- tabRequerimiento de Personal
- tabDesignation
- tabDepartment

Si no existe → usuario sin permisos.

---

### 4️⃣ Validaciones adicionales

- Employee con status <span style="color: rgb(224, 62, 45);">**`"Inactive"`**</span> → error.
- Student con <span style="color: rgb(224, 62, 45);">**`enabled = 0`**</span> → error.
- Formatear <span style="color: rgb(224, 62, 45);">**`fecha_de_nacimiento`**</span> → <span style="color: rgb(224, 62, 45);">**`"m-d"`**</span>.

---

### 5️⃣ Validación de contratos

**Se consulta:** `resource/Contrato de Trabajo`

**Se determina:**

- `"primer_contrato"` o
- `"renovacion"`

---

### 6️⃣ Ajuste final de campos

- pets → transformado a “0” si viene null.
- Se asignan alias y campos calculados.

---

# 📚 Response Schema

### Para Empleado

**Incluye (parcial):**

<div class="_tableContainer_1rjym_1" id="bkmrk-campo-descripci%C3%B3n-na"><div class="group _tableWrapper_1rjym_13 flex w-fit flex-col-reverse" tabindex="-1"><table class="w-fit min-w-(--thread-content-width)" data-end="3972" data-start="3634"><thead data-end="3657" data-start="3634"><tr data-end="3657" data-start="3634"><th data-col-size="sm" data-end="3642" data-start="3634">Campo</th><th data-col-size="sm" data-end="3657" data-start="3642">Descripción</th></tr></thead><tbody data-end="3972" data-start="3682"><tr data-end="3708" data-start="3682"><td data-col-size="sm" data-end="3689" data-start="3682">name</td><td data-col-size="sm" data-end="3708" data-start="3689">ID del Employee</td></tr><tr data-end="3744" data-start="3709"><td data-col-size="sm" data-end="3725" data-start="3709">employee\_name</td><td data-col-size="sm" data-end="3744" data-start="3725">Nombre completo</td></tr><tr data-end="3774" data-start="3745"><td data-col-size="sm" data-end="3760" data-start="3745">tipo\_usuario</td><td data-col-size="sm" data-end="3774" data-start="3760">"Empleado"</td></tr><tr data-end="3815" data-start="3775"><td data-col-size="sm" data-end="3784" data-start="3775">status</td><td data-col-size="sm" data-end="3815" data-start="3784">Active, PreActivo, Inactive</td></tr><tr data-end="3855" data-start="3816"><td data-col-size="sm" data-end="3836" data-start="3816">vigencia\_contrato</td><td data-col-size="sm" data-end="3855" data-start="3836">Rango de fechas</td></tr><tr data-end="3903" data-start="3856"><td data-col-size="sm" data-end="3871" data-start="3856">contratacion</td><td data-col-size="sm" data-end="3903" data-start="3871">primer\_contrato / renovacion</td></tr><tr data-end="3940" data-start="3904"><td data-col-size="sm" data-end="3911" data-start="3904">pets</td><td data-col-size="sm" data-end="3940" data-start="3911">Valor convertido a string</td></tr><tr data-end="3972" data-start="3941"><td data-col-size="sm" data-end="3963" data-start="3941">fecha\_de\_nacimiento</td><td data-col-size="sm" data-end="3972" data-start="3963">mm-dd</td></tr></tbody></table>

</div></div>Más de 40 campos adicionales según tu SQL.

---

### Para Estudiante

**Incluye:**

<div class="_tableContainer_1rjym_1" id="bkmrk-campo-descripci%C3%B3n-na-1"><div class="group _tableWrapper_1rjym_13 flex w-fit flex-col-reverse" tabindex="-1"><table class="w-fit min-w-(--thread-content-width)" data-end="4277" data-start="4053"><thead data-end="4076" data-start="4053"><tr data-end="4076" data-start="4053"><th data-col-size="sm" data-end="4061" data-start="4053">Campo</th><th data-col-size="sm" data-end="4076" data-start="4061">Descripción</th></tr></thead><tbody data-end="4277" data-start="4101"><tr data-end="4126" data-start="4101"><td data-col-size="sm" data-end="4108" data-start="4101">name</td><td data-col-size="sm" data-end="4126" data-start="4108">ID del Student</td></tr><tr data-end="4162" data-start="4127"><td data-col-size="sm" data-end="4143" data-start="4127">employee\_name</td><td data-col-size="sm" data-end="4162" data-start="4143">Nombre completo</td></tr><tr data-end="4192" data-start="4163"><td data-col-size="sm" data-end="4178" data-start="4163">tipo\_usuario</td><td data-col-size="sm" data-end="4192" data-start="4178">Estudiante</td></tr><tr data-end="4215" data-start="4193"><td data-col-size="sm" data-end="4206" data-start="4193">statusUser</td><td data-col-size="sm" data-end="4215" data-start="4206">1 ó 0</td></tr><tr data-end="4237" data-start="4216"><td data-col-size="sm" data-end="4229" data-start="4216">user\_image</td><td data-col-size="sm" data-end="4237" data-start="4229">Foto</td></tr><tr data-end="4257" data-start="4238"><td data-col-size="sm" data-end="4247" data-start="4238">gender</td><td data-col-size="sm" data-end="4257" data-start="4247">Género</td></tr><tr data-end="4277" data-start="4258"><td data-col-size="sm" data-end="4264" data-start="4258">dni</td><td data-col-size="sm" data-end="4277" data-start="4264">Documento</td></tr></tbody></table>

</div></div>---

# 🧪 Ejemplo curl

<div class="contain-inline-size rounded-2xl relative bg-token-sidebar-surface-primary" id="bkmrk-curl--x-post-https%3A%2F"><div class="sticky top-9"><div class="absolute end-0 bottom-0 flex h-9 items-center pe-2"></div></div><div class="overflow-y-auto p-4" dir="ltr"></div><div class="overflow-y-auto p-4" dir="ltr"><table border="1" style="border-collapse: collapse; width: 100%;"><colgroup><col style="width: 99.881%;"></col></colgroup><tbody><tr><td>`curl -X POST https://midominio.com/api/get-user3 \-H <span class="hljs-string">"Content-Type: application/json"</span> \-d <span class="hljs-string">'{"username": "juan.perez@empresa.com"}'</span>`</td></tr></tbody></table>

</div></div>

# Actualizar Datos del Usuario (1) - [update-perfil-info]

## 🧾 **Descripción**

*Actualiza la información de perfil del empleado dentro del ERP (doctype **Employee**) mediante una petición **PUT**, modificando uno o varios de los siguientes datos:*

- Número de celular (<span style="color: rgb(224, 62, 45);">**`cell_number`**</span>)
- Correo personal (<span style="color: rgb(224, 62, 45);">**`personal_email`**</span>)
- Dirección permanente (<span style="color: rgb(224, 62, 45);">**`permanent_address`**</span>)

*Solo actualiza los campos enviados; los no enviados no se modifican.*

---

# 🚀 **Endpoint**

<div class="contain-inline-size rounded-2xl relative bg-token-sidebar-surface-primary" id="bkmrk-put-%2Fupdate-date-per"><div class="sticky top-9"><div class="absolute end-0 bottom-0 flex h-9 items-center pe-2"><div class="bg-token-bg-elevated-secondary text-token-text-secondary flex items-center gap-4 rounded-sm px-2 font-sans text-xs">  
</div></div></div><div class="overflow-y-auto p-4" dir="ltr">**<span style="color: rgb(224, 62, 45);">`PUT <span class="hljs-operator">/</span><span class="hljs-keyword">update</span><span class="hljs-operator">-</span><span class="hljs-type">date</span><span class="hljs-operator">-</span>perfil`</span>**</div></div>> La ruta real depende del archivo <span style="color: rgb(224, 62, 45);">**`routes/api.php`**</span>.

---

# 🔐 **Seguridad**

- Requiere que la app ya tenga autenticación o sesión aplicada.
- Internamente el servicio usa <span style="color: rgb(224, 62, 45);">**`ServiceErp`** </span>(ERPNext API con permiso necesario).

---

# 📥 **Request Body**

<div class="contain-inline-size rounded-2xl relative bg-token-sidebar-surface-primary" id="bkmrk--3"><div class="sticky top-9"><div class="absolute end-0 bottom-0 flex h-9 items-center pe-2"><div class="bg-token-bg-elevated-secondary text-token-text-secondary flex items-center gap-4 rounded-sm px-2 font-sans text-xs">  
</div></div></div><div class="overflow-y-auto p-4" dir="ltr"></div></div><table border="1" id="bkmrk-%7B-%22employe%22%3A-%22hr-emp" style="border-collapse: collapse; width: 100%;"><colgroup><col style="width: 99.881%;"></col></colgroup><tbody><tr><td>`<span class="hljs-punctuation">{</span>  <span class="hljs-attr">"employe"</span><span class="hljs-punctuation">:</span> <span class="hljs-string">"HR-EMP-001"</span><span class="hljs-punctuation">,</span>  <span class="hljs-attr">"celular"</span><span class="hljs-punctuation">:</span> <span class="hljs-string">"987654321"</span><span class="hljs-punctuation">,</span>  <span class="hljs-attr">"correo"</span><span class="hljs-punctuation">:</span> <span class="hljs-string">"example@correo.com"</span><span class="hljs-punctuation">,</span>  <span class="hljs-attr">"direccion"</span><span class="hljs-punctuation">:</span> <span class="hljs-string">"Av. Los Olivos 123"</span><span class="hljs-punctuation">}</span>`</td></tr></tbody></table>

### Campos

<div class="_tableContainer_1rjym_1" id="bkmrk-campo-tipo-requerido"><div class="group _tableWrapper_1rjym_13 flex w-fit flex-col-reverse" tabindex="-1"><table class="w-fit min-w-(--thread-content-width)" data-end="1455" data-start="1039"><thead data-end="1088" data-start="1039"><tr data-end="1088" data-start="1039"><th data-col-size="sm" data-end="1052" data-start="1039">Campo</th><th data-col-size="sm" data-end="1061" data-start="1052">Tipo</th><th data-col-size="sm" data-end="1073" data-start="1061">Requerido</th><th data-col-size="md" data-end="1088" data-start="1073">Descripción</th></tr></thead><tbody data-end="1455" data-start="1139"><tr data-end="1222" data-start="1139"><td data-col-size="sm" data-end="1152" data-start="1139">employe</td><td data-col-size="sm" data-end="1161" data-start="1152">string</td><td data-col-size="sm" data-end="1173" data-start="1161">✔️ Sí</td><td data-col-size="md" data-end="1222" data-start="1173">ID del empleado en ERPNext (`Employee.name`).</td></tr><tr data-end="1285" data-start="1223"><td data-col-size="sm" data-end="1236" data-start="1223">celular</td><td data-col-size="sm" data-end="1245" data-start="1236">string</td><td data-col-size="sm" data-end="1257" data-start="1245">No</td><td data-col-size="md" data-end="1285" data-start="1257">Nuevo número de celular.</td></tr><tr data-end="1376" data-start="1286"><td data-col-size="sm" data-end="1299" data-start="1286">correo</td><td data-col-size="sm" data-end="1308" data-start="1299">string</td><td data-col-size="sm" data-end="1320" data-start="1308">No</td><td data-col-size="md" data-end="1376" data-start="1320">Nuevo correo personal. (Actualiza `personal_email`).</td></tr><tr data-end="1455" data-start="1377"><td data-col-size="sm" data-end="1390" data-start="1377">direccion</td><td data-col-size="sm" data-end="1399" data-start="1390">string</td><td data-col-size="sm" data-end="1411" data-start="1399">No</td><td data-col-size="md" data-end="1455" data-start="1411">Nueva dirección permanente del empleado.</td></tr></tbody></table>

</div></div>---

# 🧩 **Validaciones**

1. **employe vacío** → se devuelve error mediante `responseValidate()`.
2. Los demás campos son opcionales.
3. Solo se actualizan los campos enviados.

---

# 📤 **Responses**

## ✔️ 200 – Actualización exitosa

<div class="contain-inline-size rounded-2xl relative bg-token-sidebar-surface-primary" id="bkmrk-%7B-%22value%22%3A-false%2C-%22m"><div class="sticky top-9"><div class="absolute end-0 bottom-0 flex h-9 items-center pe-2"><div class="bg-token-bg-elevated-secondary text-token-text-secondary flex items-center gap-4 rounded-sm px-2 font-sans text-xs"><table border="1" style="border-collapse: collapse; width: 100%;"><colgroup><col style="width: 99.881%;"></col></colgroup><tbody><tr><td>`<span class="hljs-punctuation">{</span>  <span class="hljs-attr">"value"</span><span class="hljs-punctuation">:</span> <span class="hljs-literal"><span class="hljs-keyword">false</span></span><span class="hljs-punctuation">,</span>  <span class="hljs-attr">"msn"</span><span class="hljs-punctuation">:</span> <span class="hljs-string">"Actualizacion Exitosa"</span><span class="hljs-punctuation">,</span>  <span class="hljs-attr">"data"</span><span class="hljs-punctuation">:</span> <span class="hljs-punctuation">{</span>    ...respuesta del ERPNext...  <span class="hljs-punctuation">}</span><span class="hljs-punctuation">}</span>`</td></tr></tbody></table>

</div></div></div><div class="overflow-y-auto p-4" dir="ltr"></div></div>> Nota: El valor <span style="color: rgb(224, 62, 45);">**`"value": false`**</span> parece un bug en tu código, ya que indica éxito pero devuelve <span style="color: rgb(224, 62, 45);">**`false`**</span>.  
> Te lo dejo documentado según tu implementación real.

---

## ❌ 400 – Faltan parámetros requeridos

Ejemplo cuando no se envía <span style="color: rgb(224, 62, 45);">**`employe`**</span>:

<div class="contain-inline-size rounded-2xl relative bg-token-sidebar-surface-primary" id="bkmrk--7"><div class="sticky top-9"><div class="absolute end-0 bottom-0 flex h-9 items-center pe-2"><div class="bg-token-bg-elevated-secondary text-token-text-secondary flex items-center gap-4 rounded-sm px-2 font-sans text-xs">  
</div></div></div><div class="overflow-y-auto p-4" dir="ltr"></div></div><table border="1" id="bkmrk-%7B-%22valor%22%3A-false%2C-%22m" style="border-collapse: collapse; width: 100%;"><colgroup><col style="width: 99.881%;"></col></colgroup><tbody><tr><td>`<span class="hljs-punctuation">{</span>  <span class="hljs-attr">"valor"</span><span class="hljs-punctuation">:</span> <span class="hljs-literal"><span class="hljs-keyword">false</span></span><span class="hljs-punctuation">,</span>  <span class="hljs-attr">"msn"</span><span class="hljs-punctuation">:</span> <span class="hljs-string">"Debe enviar el empleado"</span><span class="hljs-punctuation">,</span>  <span class="hljs-attr">"data"</span><span class="hljs-punctuation">:</span> <span class="hljs-punctuation">[</span><span class="hljs-punctuation">]</span><span class="hljs-punctuation">}</span>`</td></tr></tbody></table>

*(Respuesta generada por <span style="color: rgb(224, 62, 45);">**`responseValidate()`**</span>)*

---

# 🧠 **Lógica Interna (Resumen)**

1. Recibe parámetros del request.
2. Si <span style="color: rgb(224, 62, 45);">**`employe`** </span>está vacío → error.
3. Crea un arreglo `updateKeys` solo con los campos enviados.
4. Llama a:

<div class="contain-inline-size rounded-2xl relative bg-token-sidebar-surface-primary" id="bkmrk-put-%2Fapi%2Fresource%2Fem"><div class="sticky top-9"><div class="absolute end-0 bottom-0 flex h-9 items-center pe-2"><div class="bg-token-bg-elevated-secondary text-token-text-secondary flex items-center gap-4 rounded-sm px-2 font-sans text-xs">  
</div></div></div><div class="overflow-y-auto p-4" dir="ltr"><span style="color: rgb(224, 62, 45);">**`<span class="hljs-type">PUT</span> <span class="hljs-regexp">/api/</span>resource<span class="hljs-regexp">/Employee/</span>{employe}`**</span></div></div>Con el body:

<div class="contain-inline-size rounded-2xl relative bg-token-sidebar-surface-primary" id="bkmrk-%7B-%22cell_number%22%3A-%22.."><div class="sticky top-9"><div class="absolute end-0 bottom-0 flex h-9 items-center pe-2"><div class="bg-token-bg-elevated-secondary text-token-text-secondary flex items-center gap-4 rounded-sm px-2 font-sans text-xs"><table border="1" style="border-collapse: collapse; width: 100%;"><colgroup><col style="width: 99.881%;"></col></colgroup><tbody><tr><td>`<span class="hljs-punctuation">{</span>  <span class="hljs-attr">"cell_number"</span><span class="hljs-punctuation">:</span> <span class="hljs-string">"..."</span><span class="hljs-punctuation">,</span>  <span class="hljs-attr">"personal_email"</span><span class="hljs-punctuation">:</span> <span class="hljs-string">"..."</span><span class="hljs-punctuation">,</span>  <span class="hljs-attr">"permanent_address"</span><span class="hljs-punctuation">:</span> <span class="hljs-string">"..."</span><span class="hljs-punctuation">}</span>`</td></tr></tbody></table>

</div></div></div><div class="overflow-y-auto p-4" dir="ltr"></div></div>5. Devuelve la respuesta del ERP.

---

# 📚 **Schemas**

### Request

<div class="contain-inline-size rounded-2xl relative bg-token-sidebar-surface-primary" id="bkmrk--10"><div class="sticky top-9"><div class="absolute end-0 bottom-0 flex h-9 items-center pe-2"><div class="bg-token-bg-elevated-secondary text-token-text-secondary flex items-center gap-4 rounded-sm px-2 font-sans text-xs">  
</div></div></div><div class="overflow-y-auto p-4" dir="ltr"></div></div><table border="1" id="bkmrk-%7B-%22employe%22%3A-%22string" style="border-collapse: collapse; width: 100%;"><colgroup><col style="width: 99.881%;"></col></colgroup><tbody><tr><td>`<span class="hljs-punctuation">{</span>  <span class="hljs-attr">"employe"</span><span class="hljs-punctuation">:</span> <span class="hljs-string">"string"</span><span class="hljs-punctuation">,</span>  <span class="hljs-attr">"celular"</span><span class="hljs-punctuation">:</span> <span class="hljs-string">"string (opcional)"</span><span class="hljs-punctuation">,</span>  <span class="hljs-attr">"correo"</span><span class="hljs-punctuation">:</span> <span class="hljs-string">"string (opcional)"</span><span class="hljs-punctuation">,</span>  <span class="hljs-attr">"direccion"</span><span class="hljs-punctuation">:</span> <span class="hljs-string">"string (opcional)"</span><span class="hljs-punctuation">}</span>`</td></tr></tbody></table>

### Response

<div class="contain-inline-size rounded-2xl relative bg-token-sidebar-surface-primary" id="bkmrk-%7B-%22value%22%3A-%22boolean%22"><div class="sticky top-9"><div class="absolute end-0 bottom-0 flex h-9 items-center pe-2"><div class="bg-token-bg-elevated-secondary text-token-text-secondary flex items-center gap-4 rounded-sm px-2 font-sans text-xs"><table border="1" style="border-collapse: collapse; width: 100%;"><colgroup><col style="width: 99.881%;"></col></colgroup><tbody><tr><td>`<span class="hljs-punctuation">{</span>  <span class="hljs-attr">"value"</span><span class="hljs-punctuation">:</span> <span class="hljs-string">"boolean"</span><span class="hljs-punctuation">,</span>  <span class="hljs-attr">"msn"</span><span class="hljs-punctuation">:</span> <span class="hljs-string">"string"</span><span class="hljs-punctuation">,</span>  <span class="hljs-attr">"data"</span><span class="hljs-punctuation">:</span> <span class="hljs-string">"object (respuesta del ERP)"</span><span class="hljs-punctuation">}</span>`</td></tr></tbody></table>

</div></div></div><div class="overflow-y-auto p-4" dir="ltr"></div></div>---

# 🧪 **Ejemplo de Uso (curl)**

<div class="contain-inline-size rounded-2xl relative bg-token-sidebar-surface-primary" id="bkmrk-curl--x-put-https%3A%2F%2F"><div class="sticky top-9"><div class="absolute end-0 bottom-0 flex h-9 items-center pe-2"><div class="bg-token-bg-elevated-secondary text-token-text-secondary flex items-center gap-4 rounded-sm px-2 font-sans text-xs"><table border="1" style="border-collapse: collapse; width: 100%;"><colgroup><col style="width: 99.881%;"></col></colgroup><tbody><tr><td>`curl -X PUT https://midominio.com/api/update-date-perfil \-H <span class="hljs-string">"Content-Type: application/json"</span> \-d <span class="hljs-string">'{  "employe": "EMP-0005",  "celular": "987654321",  "correo": "nuevo@correo.com",  "direccion": "Calle 123"}'</span>`</td></tr></tbody></table>

</div></div></div><div class="overflow-y-auto p-4" dir="ltr"></div></div>

# Actualizar Imagen de Perfil del Usuario (1) - [update-img-user]

## 🧾 Descripción

*Actualiza la imagen de perfil de un usuario en ERPNext.*  
*El proceso incluye:*

1. Recepción de un archivo enviado desde la app.
2. Subida del archivo al endpoint de ERPNext: <span style="color: rgb(224, 62, 45);">**`method/upload_file`**</span>.
3. Obtención de la URL generada del archivo.
4. Actualización del campo <span style="color: rgb(224, 62, 45);">**`user_image`** </span>del **User**.
5. Actualización del campo <span style="color: rgb(224, 62, 45);">**`image`** </span>en el **Employee** asociado (si existe).

---

# 🚀 Endpoint

<div class="contain-inline-size rounded-2xl relative bg-token-sidebar-surface-primary" id="bkmrk-post-%2Fupdate-img-use"><div class="sticky top-9"><div class="absolute end-0 bottom-0 flex h-9 items-center pe-2"><div class="bg-token-bg-elevated-secondary text-token-text-secondary flex items-center gap-4 rounded-sm px-2 font-sans text-xs">  
</div></div></div><div class="overflow-y-auto p-4" dir="ltr"><span style="color: rgb(224, 62, 45);">**`POST <span class="hljs-operator">/</span><span class="hljs-keyword">update</span><span class="hljs-operator">-</span>img<span class="hljs-operator">-</span><span class="hljs-keyword">user</span>`**</span></div></div>> La ruta exacta dependerá del archivo de rutas Laravel (<span style="color: rgb(224, 62, 45);">**`api.php`**</span>).

---

# 🔐 Seguridad

- La función no valida sesión o token, pero el endpoint llamado en ERPNext usa **cookies de sesión Guest**, lo que indica que debe usarse desde un backend confiable.
- Se recomienda protegerla en la API propia.

---

# 📥 Request (Multipart / Form-Data)

### Campos requeridos

<div class="_tableContainer_1rjym_1" id="bkmrk-campo-tipo-requerido"><div class="group _tableWrapper_1rjym_13 flex w-fit flex-col-reverse" tabindex="-1"><table class="w-fit min-w-(--thread-content-width)" data-end="1230" data-start="987"><thead data-end="1030" data-start="987"><tr data-end="1030" data-start="987"><th data-col-size="sm" data-end="996" data-start="987">Campo</th><th data-col-size="sm" data-end="1003" data-start="996">Tipo</th><th data-col-size="sm" data-end="1015" data-start="1003">Requerido</th><th data-col-size="md" data-end="1030" data-start="1015">Descripción</th></tr></thead><tbody data-end="1230" data-start="1075"><tr data-end="1138" data-start="1075"><td data-col-size="sm" data-end="1084" data-start="1075">file</td><td data-col-size="sm" data-end="1091" data-start="1084">file</td><td data-col-size="sm" data-end="1103" data-start="1091">Sí</td><td data-col-size="md" data-end="1138" data-start="1103">Imagen a subir (jpg, png, etc.)</td></tr><tr data-end="1230" data-start="1139"><td data-col-size="sm" data-end="1148" data-start="1139">user</td><td data-col-size="sm" data-end="1157" data-start="1148">string</td><td data-col-size="sm" data-end="1166" data-start="1157">Sí</td><td data-col-size="md" data-end="1230" data-start="1166">Nombre del usuario en ERPNext para actualizar (`User.name`).</td></tr></tbody></table>

</div></div>### Ejemplo (form-data)

<div class="contain-inline-size rounded-2xl relative bg-token-sidebar-surface-primary" id="bkmrk--3"><div class="sticky top-9"><div class="absolute end-0 bottom-0 flex h-9 items-center pe-2"><div class="bg-token-bg-elevated-secondary text-token-text-secondary flex items-center gap-4 rounded-sm px-2 font-sans text-xs">  
</div></div></div><div class="overflow-y-auto p-4" dir="ltr">``</div></div><table border="1" id="bkmrk-file%3A-avatar.png-use" style="border-collapse: collapse; width: 100%;"><colgroup><col style="width: 99.881%;"></col></colgroup><tbody><tr><td>`file: avatar.png<span class="hljs-keyword">user</span>: <span class="hljs-keyword">user</span><span class="hljs-variable">@example</span>.com`</td></tr></tbody></table>

---

# 📤 Responses

## ✔️ 200 – Imagen actualizada correctamente

<div class="contain-inline-size rounded-2xl relative bg-token-sidebar-surface-primary" id="bkmrk--5"><div class="sticky top-9"><div class="absolute end-0 bottom-0 flex h-9 items-center pe-2"><div class="bg-token-bg-elevated-secondary text-token-text-secondary flex items-center gap-4 rounded-sm px-2 font-sans text-xs">  
</div></div></div><div class="overflow-y-auto p-4" dir="ltr"></div></div><table border="1" id="bkmrk-%7B-%22valor%22%3A-true%2C-%22ms" style="border-collapse: collapse; width: 100%;"><colgroup><col style="width: 99.881%;"></col></colgroup><tbody><tr><td>`<span class="hljs-punctuation">{</span>  <span class="hljs-attr">"valor"</span><span class="hljs-punctuation">:</span> <span class="hljs-literal"><span class="hljs-keyword">true</span></span><span class="hljs-punctuation">,</span>  <span class="hljs-attr">"msn"</span><span class="hljs-punctuation">:</span> <span class="hljs-string">"Imagen de usuario actualizado correctamente"</span><span class="hljs-punctuation">,</span>  <span class="hljs-attr">"data"</span><span class="hljs-punctuation">:</span> <span class="hljs-punctuation">{</span> ... <span class="hljs-punctuation">}</span><span class="hljs-punctuation">}</span>`</td></tr></tbody></table>

---

## ❌ 400 – Faltan datos o error al subir archivo

Ejemplo de error al no recibir archivo:

<div class="contain-inline-size rounded-2xl relative bg-token-sidebar-surface-primary" id="bkmrk--7"><div class="sticky top-9"><div class="absolute end-0 bottom-0 flex h-9 items-center pe-2"><div class="bg-token-bg-elevated-secondary text-token-text-secondary flex items-center gap-4 rounded-sm px-2 font-sans text-xs">  
</div></div></div><div class="overflow-y-auto p-4" dir="ltr"></div></div><table border="1" id="bkmrk-%7B-%22msn%22%3A-%22file-could" style="border-collapse: collapse; width: 100%; height: 29.6px;"><colgroup><col style="width: 99.881%;"></col></colgroup><tbody><tr style="height: 29.6px;"><td style="height: 29.6px;">`<span class="hljs-punctuation">{</span>  <span class="hljs-attr">"msn"</span><span class="hljs-punctuation">:</span> <span class="hljs-string">"File could not be processed"</span><span class="hljs-punctuation">}</span>`</td></tr></tbody></table>

---

## ❌ 500 – Error de carga o actualización

<div class="contain-inline-size rounded-2xl relative bg-token-sidebar-surface-primary" id="bkmrk--9"><div class="sticky top-9"><div class="absolute end-0 bottom-0 flex h-9 items-center pe-2"><div class="bg-token-bg-elevated-secondary text-token-text-secondary flex items-center gap-4 rounded-sm px-2 font-sans text-xs">  
</div></div></div><div class="overflow-y-auto p-4" dir="ltr"></div></div><table border="1" id="bkmrk-%7B-%22valor%22%3A-false%2C-%22m" style="border-collapse: collapse; width: 100%;"><colgroup><col style="width: 99.881%;"></col></colgroup><tbody><tr><td>`<span class="hljs-punctuation">{</span>  <span class="hljs-attr">"valor"</span><span class="hljs-punctuation">:</span> <span class="hljs-literal"><span class="hljs-keyword">false</span></span><span class="hljs-punctuation">,</span>  <span class="hljs-attr">"msn"</span><span class="hljs-punctuation">:</span> <span class="hljs-string">"Error al actualizar la imagen de usuario"</span><span class="hljs-punctuation">,</span>  <span class="hljs-attr">"data"</span><span class="hljs-punctuation">:</span> <span class="hljs-punctuation">{</span> ... <span class="hljs-punctuation">}</span><span class="hljs-punctuation">}</span>`</td></tr></tbody></table>

---

# 🧩 Lógica Interna

### 1. **Lectura del archivo**

<div class="contain-inline-size rounded-2xl relative bg-token-sidebar-surface-primary" id="bkmrk-%24cfile-%3D-new-%5Ccurlfi"><div class="sticky top-9"><div class="absolute end-0 bottom-0 flex h-9 items-center pe-2"></div></div><div class="overflow-y-auto p-4" dir="ltr"></div><div class="overflow-y-auto p-4" dir="ltr"><table border="1" style="border-collapse: collapse; width: 100%;"><colgroup><col style="width: 99.881%;"></col></colgroup><tbody><tr><td>`<span class="hljs-variable">$cfile</span> = <span class="hljs-keyword">new</span> <span class="hljs-title class_">\CURLFile</span>(<span class="hljs-variable">$_FILES</span>[<span class="hljs-string">"file"</span>][<span class="hljs-string">'tmp_name'</span>], <span class="hljs-variable">$_FILES</span>[<span class="hljs-string">"file"</span>][<span class="hljs-string">'type'</span>], <span class="hljs-variable">$_FILES</span>[<span class="hljs-string">"file"</span>][<span class="hljs-string">'name'</span>]);`</td></tr></tbody></table>

</div></div>### 2. **Subida a ERPNext**

- Endpoint usado: `POST /method/upload_file`

- Cabecera usada: `<span class="hljs-section">Cookie: full_name=Guest; sid=Guest; system_user=no; user_id=Guest; user_image=</span>`

> ⚠️ Se sube el archivo como usuario Guest.

### 3. **Validación de respuesta**

Debe existir: `message.file_url`

Si no existe → error.

### 4. **Actualizar información del User**

<div class="contain-inline-size rounded-2xl relative bg-token-sidebar-surface-primary" id="bkmrk--11"><div class="sticky top-9"><div class="absolute end-0 bottom-0 flex h-9 items-center pe-2"></div></div><div class="overflow-y-auto p-4" dir="ltr"></div></div><table border="1" id="bkmrk-put-resource%2Fuser%2F%7Bu" style="border-collapse: collapse; width: 100%;"><colgroup><col style="width: 99.881%;"></col></colgroup><tbody><tr><td>`PUT resource/<span class="hljs-keyword">User</span>/{<span class="hljs-keyword">user</span>}{  "user_image": "<file_url>"}`</td></tr></tbody></table>

### 5. **Actualizar Employee si corresponde**

- Busca Employee cuyo <span style="color: rgb(224, 62, 45);">**`user_id`** </span>coincida:

<div class="contain-inline-size rounded-2xl relative bg-token-sidebar-surface-primary" id="bkmrk-select-user_id%2C-name"><div class="sticky top-9"><div class="absolute end-0 bottom-0 flex h-9 items-center pe-2"><div class="bg-token-bg-elevated-secondary text-token-text-secondary flex items-center gap-4 rounded-sm px-2 font-sans text-xs">  
</div></div></div><div class="overflow-y-auto p-4" dir="ltr">`<span class="hljs-keyword">SELECT</span> user_id, name <span class="hljs-keyword">FROM</span> tabEmployee <span class="hljs-keyword">WHERE</span> user_id <span class="hljs-operator">=</span> {<span class="hljs-keyword">user</span>}`</div></div>Si existe:

<div class="contain-inline-size rounded-2xl relative bg-token-sidebar-surface-primary" id="bkmrk-put-resource%2Femploye"><div class="sticky top-9"><div class="absolute end-0 bottom-0 flex h-9 items-center pe-2"><div class="bg-token-bg-elevated-secondary text-token-text-secondary flex items-center gap-4 rounded-sm px-2 font-sans text-xs"><table border="1" style="border-collapse: collapse; width: 100%;"><colgroup><col style="width: 99.881%;"></col></colgroup><tbody><tr><td>`<span class="hljs-type">PUT</span> resource<span class="hljs-regexp">/Employee/</span>{employee_id}{  <span class="hljs-string">"image"</span>: <span class="hljs-string">"<file_url>"</span>}`</td></tr></tbody></table>

</div></div></div><div class="overflow-y-auto p-4" dir="ltr"></div></div>---

# 📚 Request/Response Schemas

### Request (multipart/form-data)

<div class="contain-inline-size rounded-2xl relative bg-token-sidebar-surface-primary" id="bkmrk--13"><div class="sticky top-9"><div class="absolute end-0 bottom-0 flex h-9 items-center pe-2"><div class="bg-token-bg-elevated-secondary text-token-text-secondary flex items-center gap-4 rounded-sm px-2 font-sans text-xs">  
</div></div></div><div class="overflow-y-auto p-4" dir="ltr"></div></div><table border="1" id="bkmrk-file%3A-file-user%3A-str" style="border-collapse: collapse; width: 100%;"><colgroup><col style="width: 99.881%;"></col></colgroup><tbody><tr><td>`<span class="hljs-symbol">file:</span> File<span class="hljs-symbol">user:</span> <span class="hljs-type">string</span>`</td></tr></tbody></table>

### Response (success)

<div class="contain-inline-size rounded-2xl relative bg-token-sidebar-surface-primary" id="bkmrk--14"><div class="sticky top-9"><div class="absolute end-0 bottom-0 flex h-9 items-center pe-2"></div></div><div class="overflow-y-auto p-4" dir="ltr"></div></div><table border="1" id="bkmrk-%7B-%22valor%22%3A-true%2C-%22ms-1" style="border-collapse: collapse; width: 100%;"><colgroup><col style="width: 99.881%;"></col></colgroup><tbody><tr><td>`<span class="hljs-punctuation">{</span>  <span class="hljs-attr">"valor"</span><span class="hljs-punctuation">:</span> <span class="hljs-literal"><span class="hljs-keyword">true</span></span><span class="hljs-punctuation">,</span>  <span class="hljs-attr">"msn"</span><span class="hljs-punctuation">:</span> <span class="hljs-string">"Imagen de usuario actualizado correctamente"</span><span class="hljs-punctuation">,</span>  <span class="hljs-attr">"data"</span><span class="hljs-punctuation">:</span> <span class="hljs-punctuation">{</span> <span class="hljs-attr">"user_image"</span><span class="hljs-punctuation">:</span> <span class="hljs-string">"url_file"</span> <span class="hljs-punctuation">}</span><span class="hljs-punctuation">}</span>`</td></tr></tbody></table>

---

# 🧪 Ejemplo de uso (curl)

<div class="contain-inline-size rounded-2xl relative bg-token-sidebar-surface-primary" id="bkmrk-curl--x-post-https%3A%2F"><div class="sticky top-9"><div class="absolute end-0 bottom-0 flex h-9 items-center pe-2"><div class="bg-token-bg-elevated-secondary text-token-text-secondary flex items-center gap-4 rounded-sm px-2 font-sans text-xs"><table border="1" style="border-collapse: collapse; width: 100%;"><colgroup><col style="width: 99.881%;"></col></colgroup><tbody><tr><td>`curl -X POST https://midominio.com/api/update-img-user \  -F <span class="hljs-string">"file=@/home/user/avatar.png"</span> \  -F <span class="hljs-string">"user=user@example.com"</span>`</td></tr></tbody></table>

</div></div></div><div class="overflow-y-auto p-4" dir="ltr"></div></div>