Quickstart Guide
This guide will help you make your first API call to VidaPlus API. You’ll learn how to install dependencies, authenticate, and interact with the API.Before you begin, ensure you have Python 3.13 or higher installed on your system.
Prerequisites
You’ll need the following installed:- Python 3.13 or higher
- Poetry 2.1.2 (Python package manager)
- A running instance of VidaPlus API (local or remote)
Step 1: Install Poetry
VidaPlus API uses Poetry for dependency management. Install it using pipx:Step 2: Set Up Python Version
The project requires Python 3.13.2. If you use pyenv for Python version management:Step 3: Install Dependencies
Clone the repository and install all required dependencies:Step 4: Configure Environment Variables
Create a.env file in the project root with the required configuration:
.env
Step 5: Start the API Server
Launch the development server using the task command:- API:
http://localhost:8000 - Interactive Docs:
http://localhost:8000/docs - OpenAPI Schema:
http://localhost:8000/api/v1/openapi.json
The
task run command is equivalent to fastapi dev vidaplus/app.py and provides hot-reloading for development.Step 6: Create Your First User
Before you can authenticate, you need a user account. Let’s create a patient user using the interactive documentation:Find the POST /pacientes/ endpoint
Scroll to the “Pacientes” section and expand the
POST /pacientes/ endpoint.In production, user creation would typically require administrator authentication. For initial setup, you may need to create a superuser directly in the database.
Step 7: Authenticate and Get Access Token
Now let’s obtain a JWT token for authentication:Response
Step 8: Make Your First Authenticated Request
Use the access token to make authenticated API calls:Response
Step 9: Refresh Your Token
Tokens expire after 30 minutes by default. Refresh your token before it expires:Next Steps
Congratulations! You’ve successfully: ✅ Installed VidaPlus API and its dependencies✅ Started the development server
✅ Authenticated and obtained an access token
✅ Made your first authenticated API request
Explore More
API Reference
Explore all available endpoints and their parameters
Authentication Guide
Learn more about JWT authentication and security
Installation Details
Advanced installation options including Docker deployment
Guides
Learn about deployment, testing, and contributing
Common Issues
Authentication fails with 401 Unauthorized
Authentication fails with 401 Unauthorized
Token expired error
Token expired error
Tokens expire after 30 minutes. Use the refresh token endpoint to obtain a new token without re-authenticating.
Database connection errors
Database connection errors
- Verify your
DATABASE_URLin the.envfile is correct - Ensure the database file exists (for SQLite) or the database server is running (for PostgreSQL)
- Check database permissions
Import errors or module not found
Import errors or module not found
- Ensure you’ve activated the Poetry shell:
poetry shell - Run
poetry installto install all dependencies - Verify you’re using Python 3.13+