Skip to content

Latest commit

 

History

History
374 lines (274 loc) · 5.14 KB

api_departments.md

File metadata and controls

374 lines (274 loc) · 5.14 KB

Departamentos


Índice




POST /departments

  http://[SUA_URL]/api/departments

Header

  { 
    "Authorization": "Bearer {{ token }}"
 }

BODY

Body store departments

Code
{
    "name":"Biologia"
}

Response Success 201

Response

Code
{
  "status": "Success",
  "message": "Department successfully created",
  "data": {
    "department": {
      "name": "Biologia",
      "uuid": "cd4306e9-fbd5-4a94-b054-ec98942d7871",
      "slug": "biologia",
      "updated_at": "2022-09-02T14:22:08.000000Z",
      "created_at": "2022-09-02T14:22:08.000000Z"
    }
  }
}

Response Error 422

Response

Code
{
  "message": "We need your [ NAME ] to continue!",
  "errors": {
    "name": [
      "We need your [ NAME ] to continue!"
    ]
  }
}

Início




GET /departments

  http://[SUA_URL]/api/departments

Header

  { 
    "Authorization": "Bearer {{ token }}"
 }

Response Success 200

Response

Code
{
  "status": "Success",
  "message": "All Departments Loaded!",
  "data": {
    "departments": [
      {
        "uuid": "34271383-0d87-4d99-b4c4-c9da7359209e",
        "slug": "departamento-de-cooperação-internacional-em-magia",
        "name": "Departamento de Cooperação Internacional em Magia",
        "created_at": "2022-09-02T14:10:52.000000Z",
        "updated_at": "2022-09-02T14:10:52.000000Z"
      },
      ...
    ]
}

Início




GET /departments/{{uuid}}

  http://[SUA_URL]/api/departments/{{uuid}}

Header

  { 
    "Authorization": "Bearer {{ token }}"
 }

Response Success 200

Response

Code
{
  "status": "Success",
  "message": "Department successfully found!",
  "data": {
    "department": {
      "uuid": "cd4306e9-fbd5-4a94-b054-ec98942d7871",
      "slug": "biologia",
      "name": "Biologia",
      "created_at": "2022-09-02T14:22:08.000000Z",
      "updated_at": "2022-09-02T14:22:08.000000Z"
    }
  }
}

Response Error 404

Response

Code
{
  "status": "Error",
  "message": "The searched resource does not exist",
  "data": null
}

Início




PUT /departments/{{uuid}}

  http://[SUA_URL]/api/departments/{{uuid}}

Header

  { 
    "Authorization": "Bearer {{ token }}"
 }

BODY

Body put departments

Code
{
    "name":"Biologia"
}

Response Success 200

Response

Code
{
  "status": "Success",
  "message": "Department successfully updated",
  "data": {
    "department": {
      "uuid": "cd4306e9-fbd5-4a94-b054-ec98942d7871",
      "slug": "biologia",
      "name": "Biologia",
      "created_at": "2022-09-02T14:22:08.000000Z",
      "updated_at": "2022-09-02T14:22:08.000000Z"
    }
  }
}

Response Error 422

Response

Code
{
  "message": "We need your [ NAME ] to continue!",
  "errors": {
    "name": [
      "We need your [ NAME ] to continue!"
    ]
  }
}

Início




DEL /departments/{{uuid}}

  http://[SUA_URL]/api/departments/{{uuid}}

Header

  { 
    "Authorization": "Bearer {{ token }}"
 }

Response Success 200

Response

Code
{
  "status": "Success",
  "message": "The department has been successfully removed!",
  "data": {
    "department": {
      "uuid": "cd4306e9-fbd5-4a94-b054-ec98942d7871",
      "slug": "biologia",
      "name": "Biologia",
      "created_at": "2022-09-02T14:22:08.000000Z",
      "updated_at": "2022-09-02T14:22:08.000000Z"
    }
  }
}

Response Error 404

Response

Code
{
  "status": "Error",
  "message": "Unable to perform deletion. The requested resource does not exist!",
  "data": null
}

Início

Diagrama EER

eer