Article

(Register) : POST ../articles

Fill bearer token before make request

MAKE categories first before add article; otherwise it will violates foreign key constraint.

Request body (json) :

{
  "title": "Is",
  "content": "Hallo, it should be consider to add categories_id before making any article, so there wont be mistake",
  "category_id": "b3655a86-f888-4afc-ae0e-226ecb2546a3"
}

Response (201 Created) :

{
    "article_id": "d05e5782-ae8c-43e8-b915-be9db596ad05",
    "title": "Is",
    "content": "Hallo, it should be consider to add categories_id before making any article, so there wont be mistake",
    "slug": "is",
    "view_count": 0,
    "category_id": "b3655a86-f888-4afc-ae0e-226ecb2546a3",
    "author_id": "34e584db-00c6-4fc3-b445-c40d870f79bd",
    "created_at": "2025-01-20T21:02:33+08:00",
    "updated_at": "2025-01-20T21:02:33+08:00"
}

(Find All) : Get ../articles

Response (200 OK) :

[
    {
        "article_id": "d05e5782-ae8c-43e8-b915-be9db596ad05",
        "title": "Is",
        "content": "Hallo, it should be consider to add categories_id before making any article, so there wont be mistake",
        "slug": "is",
        "view_count": 0,
        "category_id": "b3655a86-f888-4afc-ae0e-226ecb2546a3",
        "author_id": "34e584db-00c6-4fc3-b445-c40d870f79bd",
        "created_at": "2025-01-20T21:02:33+08:00",
        "updated_at": "2025-01-20T21:02:33+08:00"
    }
]