Dokumentasi sederhana untuk penggunaan API User berbasis file JSON
API ini terdiri dari 5 endpoint utama yang digunakan untuk melakukan operasi CRUD pada data user.
/api/
users.json
get_users.php (GET semua user)
get_user.php (GET 1 user)
create_user.php (POST user baru)
update_user.php (PUT update user)
delete_user.php (DELETE user)
[
{ "id": 1, "name": "Novant Nanda Pradana", "no_hp": "081200000001", "email": "novant@example.com", "role": "admin", "password": "$2y$10$aa11bb22cc33dd44ee55", "created_at": "2025-01-01 10:00:00" },
{ "id": 2, "name": "Amar Subekti", "no_hp": "081200000002", "email": "amar@example.com", "role": "user", "password": "$2y$10$ff66gg77hh88ii99jj00", "created_at": "2025-01-02 11:15:00" },
{ "id": 3, "name": "Indra Prakoso", "no_hp": "081200000003", "email": "indra@example.com", "role": "staff", "password": "$2y$10$kk11ll22mm33nn44oo55", "created_at": "2025-01-03 09:45:00" },
{ "id": 4, "name": "Ica", "no_hp": "081200000004", "email": "ica@example.com", "role": "user", "password": "$2y$10$pp66qq77rr88ss99tt00", "created_at": "2025-01-04 14:10:00" },
{ "id": 5, "name": "Rani", "no_hp": "081200000005", "email": "rani@example.com", "role": "manager", "password": "$2y$10$uu11vv22ww33xx44yy55", "created_at": "2025-01-05 16:35:00" },
{ "id": 6, "name": "Mahendra Jecob", "no_hp": "081200000006", "email": "mahendra@example.com", "role": "staff", "password": "$2y$10$zz66aa77bb88cc99dd00", "created_at": "2025-01-06 13:20:00" },
{ "id": 7, "name": "Andika", "no_hp": "081200000007", "email": "andika@example.com", "role": "user", "password": "$2y$10$ee11ff22gg33hh44ii55", "created_at": "2025-01-07 12:40:00" },
{ "id": 8, "name": "Catur", "no_hp": "081200000008", "email": "catur@example.com", "role": "admin", "password": "$2y$10$jj66kk77ll88mm99nn00", "created_at": "2025-01-08 17:55:00" },
{ "id": 9, "name": "Alift", "no_hp": "081200000009", "email": "alift@example.com", "role": "user", "password": "$2y$10$oo11pp22qq33rr44ss55", "created_at": "2025-01-09 08:25:00" },
{ "id": 10, "name": "Absi", "no_hp": "081200000010", "email": "absi@example.com", "role": "staff", "password": "$2y$10$tt66uu77vv88ww99xx00", "created_at": "2025-01-10 11:50:00" }
]
GET: https://sqa-tugas.qodeid.com/api/get_users.php
GET: https://sqa-tugas.qodeid.com/api/get_user.php?id=1
POST: https://sqa-tugas.qodeid.com/api/create_user.php
Body JSON:
{
"id": 1,
"name": "Novant Nanda Pradana",
"no_hp": "081200000001",
"email": "novant@example.com",
"role": "admin",
"password": "$2y$10$aa11bb22cc33dd44ee55",
"created_at": "2025-01-01 10:00:00"
},
{
"id": 2,
"name": "Amar Subekti",
"no_hp": "081200000002",
"email": "amar@example.com",
"role": "user",
"password": "$2y$10$ff66gg77hh88ii99jj00",
"created_at": "2025-01-02 11:15:00"
},
----
PUT: https://sqa-tugas.qodeid.com/api/update_user.php?id=1
Body JSON:
{
"id": 1,
"name": "Novant Nanda Pradana",
"no_hp": "081200000001",
"email": "novant@example.com",
"role": "admin",
"password": "$2y$10$aa11bb22cc33dd44ee55",
"created_at": "2025-01-01 10:00:00"
},
DELETE: https://sqa-tugas.qodeid.com/api/delete_user.php?id=4
© 2025 Dokumentasi API User — Tugas Software Quality Assurance