Skip to content

๐Ÿ˜ Learn to make Rest API with PHP and MySQL using OOP paradigm and design patterns. (Project of learn PHP and MySQL with PZN)

Notifications You must be signed in to change notification settings

muhammadpauzi/php-rest-api-mysql

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

43 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

PHP Rest API with MySQL

๐Ÿ˜ Learn to make Rest API with PHP and MySQL using OOP paradigm and design patterns. (Project of learn PHP and MySQL with PZN).

API SPEC


BASE URL : http://localhost:8080/

Users


Find all users

Request :

  • Endpoint : /users
  • Method : GET

Response :

{
    "data": [
        {
            "id": "",
            "name": "",
            "username": "",
            "email": "",
            "created_at": ""
        }
    ]
}

Find a user

Request :

  • Endpoint : /users/:id
  • Method : GET

Response :

{
    "data": {
        "id": "",
        "name": "",
        "username": "",
        "email": "",
        "created_at": ""
    }
}

Find a user with the posts

Request :

  • Endpoint : /users/:id/posts
  • Method : GET

Response :

{
    "data": {
        "id": "",
        "name": "",
        "username": "",
        "email": "",
        "created_at": "",
        "posts": [
            {
                "id": "",
                "title": "",
                "description": "",
                "body": "",
                "id_user": "", 
                "created_at": "", 
            }
        ]
    }
}

Posts


Find all posts

Request :

  • Endpoint : /posts
  • Method : GET

Response :

{
    "data": [
        {
            "id": "",
            "name": "",
            "username": "",
            "email": "",
            "created_at": "",
            "title": "",
            "description": "",
            "body": "",
            "id_user": "", 
            "user_created_at": "", 
        }
    ]
}

Find a post

Request :

  • Endpoint : /posts/:id
  • Method : GET

Response :

{
    "data": {
        "id": "",
        "name": "",
        "username": "",
        "email": "",
        "created_at": "",
        "title": "",
        "description": "",
        "body": "",
        "id_user": "", 
        "user_created_at": "", 
    }
}

About

๐Ÿ˜ Learn to make Rest API with PHP and MySQL using OOP paradigm and design patterns. (Project of learn PHP and MySQL with PZN)

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published