Get Started in 5 Minutes
This guide will walk you through setting up the Password Manager API and making your first API request.1
Clone and Install
First, clone the repository and install dependencies:
Make sure you have PHP 8.0.2 or higher and Composer installed on your system.
2
Configure Environment
Copy the example environment file and configure your database:Edit
.env and set your database credentials:3
Create Database and Run Migrations
Create the database and run migrations to set up tables:This creates the necessary
passwords table with columns for password, sistema, usuario, and status.4
Start the Development Server
Launch the Laravel development server:Your API is now running at
http://localhost:8000By default, Laravel serves on port 8000. You can specify a different port with
--port=8080Make Your First API Call
Now that your API is running, let’s create your first password entry.Create a Password
Send a POST request to create a new password:Retrieve All Passwords
Fetch all active passwords in the system:The
listPassword endpoint only returns passwords with status = 1 (active passwords).Get a Specific Password
Retrieve a single password by ID:Update a Password
Modify an existing password entry:Delete a Password
Soft delete a password (sets status to 0):Deletion is a soft delete operation. The password is marked as inactive (
status = 0) but remains in the database.API Endpoints Summary
List Passwords
GET /api/listPasswordReturns all active passwordsGet Password
GET /api/getPassword/{id}Retrieve a specific password by IDCreate Password
POST /api/createPasswordCreate a new password entryUpdate Password
POST /api/updatePassword/{id}Update an existing passwordDelete Password
POST /api/deletePassword/{id}Soft delete a password entryError Handling
The API returns standard HTTP status codes:- 200 - Success
- 400 - Bad Request (validation errors)
- 404 - Not Found (password doesn’t exist)
- 500 - Internal Server Error
Common Errors
Testing with Different Tools
- cURL
- JavaScript (fetch)
- Python (requests)
- PHP (Guzzle)
Next Steps
API Reference
Detailed documentation for all endpoints
Authentication
Secure your API with Laravel Sanctum