Veterinarios API
Base path
Section titled “Base path”/api/veterinarios
Endpoints
Section titled “Endpoints”| Method | Path | Auth | Description |
|---|---|---|---|
| POST | /api/veterinarios | No | Register a new veterinarian. |
| GET | /api/veterinarios/confirmar/:token | No | Confirm account with email token. |
| POST | /api/veterinarios/login | No | Log in and receive a JWT. |
| POST | /api/veterinarios/olvide-password | No | Request a password reset email. |
| GET | /api/veterinarios/olvide-password/:token | No | Validate reset token. |
| POST | /api/veterinarios/olvide-password/:token | No | Set a new password. |
| GET | /api/veterinarios/perfil | Yes | Fetch the authenticated profile. |
| PUT | /api/veterinarios/perfil/:id | Yes | Update profile data. |
| PUT | /api/veterinarios/actualizarPassword | Yes | Update password. |
Register veterinarian
Section titled “Register veterinarian”POST /api/veterinarios
Request body:
{ "nombre": "string", "email": "string", "password": "string", "telefono": "string", "web": "string"}Success response: the saved Veterinario document.
Errors:
400{ "msg": "Ups! Parece que este correo ya pertenece a otro usario!" }
Confirm account
Section titled “Confirm account”GET /api/veterinarios/confirmar/:token
Success response:
{ "msg": "Usuario Confirmado Correctamente" }Errors:
404{ "msg": "Token no valido" }
POST /api/veterinarios/login
Request body:
{ "email": "string", "password": "string" }Success response:
{ "_id": "string", "nombre": "string", "email": "string", "token": "jwt"}Errors:
403{ "msg": "Ups! Parece que este usuario no existe! Comprueba que los datos sean correctos." }403{ "msg": "Ups! tu cuenta no ha sido confirmada." }403{ "msg": "Password incorrecto." }
Request password reset
Section titled “Request password reset”POST /api/veterinarios/olvide-password
Request body:
{ "email": "string" }Success response:
{ "msg": "hemos enviado a tu correo un mensaje con las instruccioines para recuperar tu password."}Errors:
404{ "msg": "El usuario no existe" }
Check reset token
Section titled “Check reset token”GET /api/veterinarios/olvide-password/:token
Success response:
{ "msg": "Token valido el usuario existe" }Errors:
403{ "msg": "Token invalido" }
Set new password
Section titled “Set new password”POST /api/veterinarios/olvide-password/:token
Request body:
{ "password": "string" }Success response:
{ "msg": "El password se ha modificado exitosamente!" }Errors:
400{ "msg": "parece que hubo un error!" }
Get profile
Section titled “Get profile”GET /api/veterinarios/perfil
Auth: Bearer token required.
Success response: the Veterinario document without password, token, or confirmado.
Update profile
Section titled “Update profile”PUT /api/veterinarios/perfil/:id
Auth: Bearer token required.
Request body (all fields optional but should be provided):
{ "nombre": "string", "email": "string", "web": "string", "telefono": "string"}Success response: updated Veterinario document.
Errors:
400{ "msg": "Hubo un error" }400{ "msg": "Ese email ya esta en uso" }
Update password
Section titled “Update password”PUT /api/veterinarios/actualizarPassword
Auth: Bearer token required.
Request body:
{ "pwd_actual": "string", "pwd_nuevo": "string" }Success response:
{ "msg": "Password almacenado correctamente" }Errors:
400{ "msg": "Hubo un error" }400{ "msg": "El password actual es incorrecto" }