Laravel Logo

๐Ÿ“˜ Laravel API Backend

This is a deployed Laravel API backend built with Laravel 12, designed to handle task management features. You are currently on the API's guide page at https://simple-task-api-88g5.onrender.com. which means its working ๐Ÿ˜

๐Ÿš€ Features

๐Ÿƒโ€โ™‚๏ธ Accessing the API

The API is live and accessible at https://simple-task-api-88g5.onrender.com. This page provides a guide to the available endpoints.

Base URL: https://simple-task-api-88g5.onrender.com

Important: All task endpoints require a X-User-ID header with a valid UUID for user identification.

๐Ÿงช API Testing (Because Guessing Is Not a Strategy)

1. Check API is Running

Request: GET https://simple-task-api-88g5.onrender.com/

Response:

โœ… API is running

2. Register a User

Request: POST https://simple-task-api-88g5.onrender.com/register

Headers:

X-User-ID: 550e8400-e29b-41d4-a716-446655440000
Content-Type: application/json

Response:

{
  "message": "User registered successfully",
  "user": {
    "id": "550e8400-e29b-41d4-a716-446655440000",
    "created_at": "2025-06-06T08:00:00.000000Z",
    "updated_at": "2025-06-06T08:00:00.000000Z"
  }
}

3. Create a New Task

Request: POST https://simple-task-api-88g5.onrender.com/task

Headers:

X-User-ID: 550e8400-e29b-41d4-a716-446655440000
Content-Type: application/json

Body (Raw JSON):

{
  "title": "Getting Peace of mind (and maybe a job)"
}

Response:

{
  "id": 1,
  "user_id": "550e8400-e29b-41d4-a716-446655440000",
  "title": "Getting Peace of mind (and maybe a job)",
  "completed": false,
  "created_at": "2025-06-06T08:00:00.000000Z",
  "updated_at": "2025-06-06T08:00:00.000000Z"
}

4. List All Tasks (User-specific)

Request: GET https://simple-task-api-88g5.onrender.com/tasks

Headers:

X-User-ID: 550e8400-e29b-41d4-a716-446655440000

Response:

[
  {
    "id": 1,
    "user_id": "550e8400-e29b-41d4-a716-446655440000",
    "title": "Getting Peace of mind (and maybe a job)",
    "completed": false,
    "created_at": "2025-06-06T08:00:00.000000Z",
    "updated_at": "2025-06-06T08:00:00.000000Z"
  }
]

5. Get a Specific Task

Request: GET https://simple-task-api-88g5.onrender.com/task/{id}

Headers:

X-User-ID: 550e8400-e29b-41d4-a716-446655440000

Example: GET https://simple-task-api-88g5.onrender.com/task/1

Response:

{
  "id": 1,
  "user_id": "550e8400-e29b-41d4-a716-446655440000",
  "title": "Getting Peace of mind (and maybe a job)",
  "completed": false,
  "created_at": "2025-06-06T08:00:00.000000Z",
  "updated_at": "2025-06-06T08:00:00.000000Z"
}

6. Mark a Task as Completed

Request: PUT https://simple-task-api-88g5.onrender.com/task/{id}

Headers:

X-User-ID: 550e8400-e29b-41d4-a716-446655440000
Content-Type: application/json

Example: PUT https://simple-task-api-88g5.onrender.com/task/1

Response:

{
  "id": 1,
  "user_id": "550e8400-e29b-41d4-a716-446655440000",
  "title": "Getting Peace of mind (and maybe a job)",
  "completed": true,
  "created_at": "2025-06-06T08:10:00.000000Z",
  "updated_at": "2025-06-06T08:15:00.000000Z"
}

7. Delete a Task

Request: DELETE https://simple-task-api-88g5.onrender.com/task/{id}

Headers:

X-User-ID: 550e8400-e29b-41d4-a716-446655440000

Example: DELETE https://simple-task-api-88g5.onrender.com/task/1

Response:

{
  "message": "Task deleted"
}

๐Ÿ”‘ API Endpoints Summary

Method Endpoint Description Headers Required
GET / Check API status None
POST /register Register a new user X-User-ID
GET /tasks Get all tasks for user X-User-ID
GET /task/{id} Get specific task X-User-ID
POST /task Create new task X-User-ID
PUT /task/{id} Mark task as completed X-User-ID
DELETE /task/{id} Delete task X-User-ID

๐Ÿšจ Important Notes