Skip to content

RESTful API with vanilla PHP (without a framework). Clean Architecture, Repository Pattern and Service Pattern.

License

Notifications You must be signed in to change notification settings

ddevfrostt/php-mahasiswa-restfulapi

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

29 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

API Spec

Create Mahasiswa

Request :

  • Method : POST
  • Endpoint : api/mahasiswa
  • Header :
    • Content-Type : application/json
    • Accept : application/json
  • Body :
{
  "nim": "string, unique, (9)",
  "nama": "string",
  "fakultas": "string",
  "prodi": "string"
}

Response :

{
  "code": "number",
  "status": "string",
  "data": {
    "nim": "string, unique, (9)",
    "nama": "string",
    "fakultas": "string",
    "prodi": "string"
  }
}

Get Mahasiswa

Request :

  • Method : GET
  • Endpoint : api/mahasiswa/{nim_mahasiswa}
  • Header :
    • Accept : appliaction/json

Response :

{
  "code": "number",
  "status": "string",
  "data": {
    "nim": "string, unique, (9)",
    "nama": "string",
    "fakultas": "string",
    "prodi": "string"
  }
}

Update Mahasiswa

Request :

  • Method : PUT/PATCH
  • Endpoint : api/mahasiswa/{nim_mahasiswa}
  • Header :
    • Content-Type : application/json
    • Accept : application/json
  • Body :
{
  "nama": "string",
  "fakultas": "string",
  "prodi": "string"
}

Response :

{
  "code": "number",
  "status": "string",
  "data": {
    "nim": "string, unique, (9)",
    "nama": "string",
    "fakultas": "string",
    "prodi": "string"
  }
}

Delete Mahasiswa

Request :

  • Method : DELETE
  • Endpoint : api/mahasiswa/{nim_mahasiswa}
  • Header :
    • Accept : application/json

Response :

{
  "code": "number",
  "status": "string"
}

About

RESTful API with vanilla PHP (without a framework). Clean Architecture, Repository Pattern and Service Pattern.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • PHP 100.0%