Overview
This page documents all available API endpoints in Finanzapp. All endpoints require theX-Requested-With: XMLHttpRequest header and return JSON responses.
Base URL:
https://pro.finanzapp.es (Production) or http://localhost/FinanzApp (Development)Authentication Endpoints
Login
Authenticate a user with email and password.POST /app/auth/sendLogin.php
Request Parameters
User’s email address
User’s password (min 8 chars, 1 uppercase, 1 number)
reCAPTCHA token for bot protection
Response
Whether the login was successful
Human-readable status message
User information (only on success)
Response Examples
200 - Success
200 - Invalid Credentials
403 - Forbidden
Register
Create a new user account.POST /app/auth/sendRegister.php
Request Parameters
User’s full name
User’s email address (must be unique)
User’s password (min 8 chars, 1 uppercase, 1 number)
Password confirmation (must match password)
Terms acceptance (must be “on”)
Newsletter subscription (“on” or omit)
Response
Registration success status
Status message
Response Examples
200 - Success
200 - Email Exists
Google Login
Authenticate using Google OAuth credentials.POST /app/auth/google-callback-login.php
Request Parameters
Google JWT credential token
Response
"exists" if user exists, "inserted" if new user createdUser profile data from Google
Response Examples
Existing User
New User
Logout
End the current user session.POST /app/auth/logout.php
Source: /home/daytona/workspace/source/app/auth/logout.php
Request Parameters
No parameters required.Response
Logout success status
Status message
Response Examples
200 - Success
403 - Invalid Request
405 - Method Not Allowed
User Management
Update User Configuration
Update user profile settings including name, password, avatar, and notification preferences.POST /app/auth/sendUserConfig.php
Authentication Required: Yes (active session)
Request Parameters
User’s full name
URL of selected avatar image (from predefined options)
New password (optional, only if changing password)
Password confirmation (required if password provided)
Newsletter preference (“on” or omit)
Available Avatars
Finanzapp provides 10 predefined avatar options plus a default:Response
Update success status
Status message
Response Examples
200 - Success
200 - Validation Error
Delete Account
Permanently delete the user’s account and all associated data.POST /app/auth/deleteAccount.php
Source: /home/daytona/workspace/source/app/auth/deleteAccount.php
Authentication Required: Yes (active session with email)
Request Parameters
No parameters required. Uses the email from the current session.Implementation Details
The endpoint (source:/home/daytona/workspace/source/app/auth/deleteAccount.php:21-24):
Response
Deletion success status
Status message
Response Examples
200 - Success
200 - No Active Session
403 - Invalid Request
Password Reset
Request Password Reset
Send a password reset email to the user.POST /app/auth/sendResetLink.php
Request Parameters
Email address of the account to reset
Response
Email sent status
Status message
Response Examples
200 - Success
200 - Email Not Found
Reset Password
Set a new password using a reset token.POST /app/auth/resetPassword.php
Request Parameters
Password reset token from email link
New password (min 8 chars, 1 uppercase, 1 number)
Password confirmation (must match new_password)
Response
Password reset status
Status message
Response Examples
200 - Success
200 - Invalid Token
200 - Password Mismatch
Data Management
Receive Data
Generic endpoint for receiving and storing JSON data.POST /receive-data.php
Source: /home/daytona/workspace/source/receive-data.php
Request Parameters
JSON data to store. Can be a single object or array of objects.
Implementation Details
The endpoint writes received JSON data to a file (data.txt) for logging/storage:
Response
Data save status
Status message
Response Examples
200 - Success
200 - Invalid JSON
403 - Access Denied
Error Responses
All endpoints follow a consistent error response format:Common Error Codes
403 Forbidden
Missing or invalid
X-Requested-With header405 Method Not Allowed
Invalid HTTP method used
401 Unauthorized
No active session or session expired
400 Bad Request
Invalid or missing required parameters
Validation Errors
| Error Message | Cause |
|---|---|
El campo email es obligatorio | Email field is empty |
Introduce un email válido | Email format is invalid |
La contraseña debe tener al menos 8 caracteres, una mayúscula y un número | Password doesn’t meet requirements |
Las contraseñas no coinciden | Password and confirmation don’t match |
Debe aceptar los términos y condiciones | Terms checkbox not checked |
El email ya está registrado | Email already exists in database |
Token inválido o expirado | Password reset token is invalid |
Rate Limiting
Testing the API
You can test the API endpoints using various tools:Using Postman
- Create a new request
- Set method to
POST - Add header:
X-Requested-With: XMLHttpRequest - For form data: Select “Body” > “form-data” and add parameters
- For JSON: Select “Body” > “raw” > “JSON” and paste JSON data
Using Browser Console
Best Practices
Always include X-Requested-With header
Always include X-Requested-With header
All API endpoints validate this header to prevent direct browser access and CSRF attacks.
Handle session expiration gracefully
Handle session expiration gracefully
Check for authentication errors and redirect users to login when sessions expire.
Validate data client-side before submission
Validate data client-side before submission
Implement client-side validation to provide immediate feedback and reduce server load.
Use HTTPS in production
Use HTTPS in production
Always use HTTPS to encrypt sensitive data like passwords during transmission.
Implement proper error handling
Implement proper error handling
Always handle errors gracefully and provide meaningful feedback to users.
Need Help?
API Overview
Learn about API architecture and concepts
Authentication
Detailed authentication documentation
