{ } API Practice Lab

Live REST API · Laravel 13.24.0

Learn APIs by building against a real one.

Welcome, students. In this course we practise how modern apps talk to a server: sending requests, reading JSON, logging in with tokens and handling errors. Every endpoint here is live, so the todo, notes, blog and shop apps you build will work for real.

Base URL

https://api-practice.aakifraza.com/api/v1
terminal
$ curl https://api-practice.aakifraza.com/api/v1/auth/login \
  -H "Accept: application/json" \
  -d email=student1@example.com \
  -d password=password \
  -d device_name=laptop

# 200 OK
{
  "token": "1|f8Kq2...xYz",
  "token_type": "Bearer",
  "user": {
    "id": 1,
    "name": "Student 1",
    "email": "student1@example.com",
    ...
  }
}
live endpoints
51
resources to explore
9
platforms with sample code
5
daily data reset (PKT)
12:00 AM

What we will practise

Everything a real app needs from its backend

01

HTTP fundamentals

GET, POST, PUT, PATCH and DELETE. Status codes like 200, 201, 401, 404 and 422, and what each one means for your app.

02

Token authentication

Register, log in, keep a bearer token, log out one device or all of them. Laravel Sanctum under the hood.

03

CRUD resources

Create, read, update and delete your own todos, notes and contacts. Each student only ever sees their own data.

04

Validation & errors

Send bad data on purpose and learn to read 422 responses and show field errors in your forms.

05

Files & relationships

Upload avatars and blog covers with multipart requests. Work with comments, likes and categories.

06

A complete shop flow

Browse products, manage a cart, place orders and cancel them, just like a real e-commerce app.

Quick start

Your first request in three steps

Use any tool you like: cURL, Postman, a browser fetch(), React, React Native or Flutter.

  1. 1

    Get a token

    Register your own account, or log in with a demo student. Save the token from the response.

    POST /auth/register
    POST /auth/login
  2. 2

    Send it with every request

    Endpoints marked with a lock need these two headers. Without the token you will get 401.

    Authorization: Bearer <token>
    Accept: application/json
  3. 3

    Build something

    Start with a todo list, then move on to notes, contacts, a blog and finally a full shop with cart and orders.

    GET /todos
    POST /todos

Demo student accounts

Ten ready-made students, each with their own todos, notes and contacts.

email
student1@example.com … student10@example.com
password
password

No-token playground

Brand new to APIs? Begin with the open blog API. No login, no headers, just requests and responses.

https://api-practice.aakifraza.com/api/blog

Experiment freely. All practice data is wiped and re-seeded every night at 12:00 AM Pakistan time.

API reference

51 endpoints, grouped by resource

All paths are relative to /api/v1. Ready-to-copy code for cURL, JavaScript, React, React Native and Flutter lives in the admin panel's API guide.

Token required

Authentication & profile

12
  • POST /auth/register
  • POST /auth/login
  • GET /auth/me
  • POST /auth/logout
  • POST /auth/logout-all
  • GET /auth/tokens
  • DELETE /auth/tokens/2
  • PUT /auth/profile
  • PUT /auth/password
  • POST /auth/avatar
  • DELETE /auth/avatar
  • DELETE /auth/account

Todos

6
  • GET /todos?status=pending&page=1
  • POST /todos
  • GET /todos/1
  • PATCH /todos/1
  • PATCH /todos/1/toggle
  • DELETE /todos/1

Notes

5
  • GET /notes?search=lecture
  • POST /notes
  • GET /notes/1
  • PATCH /notes/1
  • DELETE /notes/1

Contacts

5
  • GET /contacts?search=ali&favorites=1
  • POST /contacts
  • GET /contacts/1
  • PATCH /contacts/1
  • DELETE /contacts/1

Blogs, comments & likes

11
  • GET /blogs?search=flutter&category=flutter&sort=popular&page=1
  • GET /blogs/1
  • POST /blogs
  • PATCH /blogs/1
  • POST /blogs/1/cover
  • DELETE /blogs/1
  • POST /blogs/1/like
  • DELETE /blogs/1/like
  • GET /blogs/1/comments
  • POST /blogs/1/comments
  • DELETE /comments/1

Categories

1
  • GET /categories

Products

2
  • GET /products?search=mouse&sort=price_asc&in_stock=1
  • GET /products/1

Cart

5
  • GET /cart
  • POST /cart/items
  • PATCH /cart/items/1
  • DELETE /cart/items/1
  • DELETE /cart

Orders

4
  • POST /orders
  • GET /orders?status=pending
  • GET /orders/1
  • POST /orders/1/cancel

Your teacher

AR

Muhammad Aakif Raza

aakifraza.com

I build and run real production platforms, and this lab is built the same way. The API you are practising with follows the same patterns used in the projects below, so what you learn here carries straight over to real work.

Visit my website

Projects I have built