Skip to main content

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:8000
By default, Laravel serves on port 8000. You can specify a different port with --port=8080

Make 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:
Expected Response:
All three fields (password, sistema, usuario) are required. Missing any field will return a 400 error with validation details.

Retrieve All Passwords

Fetch all active passwords in the system:
Expected Response:
The listPassword endpoint only returns passwords with status = 1 (active passwords).

Get a Specific Password

Retrieve a single password by ID:
Expected Response:

Update a Password

Modify an existing password entry:
Expected Response:

Delete a Password

Soft delete a password (sets status to 0):
Expected Response:
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 passwords

Get Password

GET /api/getPassword/{id}Retrieve a specific password by ID

Create Password

POST /api/createPasswordCreate a new password entry

Update Password

POST /api/updatePassword/{id}Update an existing password

Delete Password

POST /api/deletePassword/{id}Soft delete a password entry

Error 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

Next Steps

API Reference

Detailed documentation for all endpoints

Authentication

Secure your API with Laravel Sanctum