Categories

Category merupakan tipe dari genre untuk mengklasifikasikan genre berdasarkan buku-buku. Category dapat di pilih berdasarkan genre yang akan dibuat nanti.

Get All Categories

Get All

GET https://openapi.omdo.site/api/categories

{
    "success": true,
    "message": "Categories retrieved successfully",
    "data": [
        {
            "id": 1,
            "name": "Dewasa",
            "description": "Category Kedewasaan yang haqiqi",
            "created_at": "2023-07-04T05:45:39.000000Z",
            "updated_at": "2023-07-04T05:45:39.000000Z"
        }
    ]
}
<?php

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => 'https://openapi.omdo.site0/api/categories',
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => '',
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 0,
  CURLOPT_FOLLOWLOCATION => true,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => 'GET',
));

$response = curl_exec($curl);

curl_close($curl);
echo $response;

Get Categories by ID

GET https://openapi.omdo.site/api/categories/{id}

Path Parameters

Name
Type
Description

id*

integer

Category ID for get specify data books

Create Category

POST https://openapi.omdo.site/api/categories

application/json

Headers

Name
Type
Description

Authorization*

String

Token JWT with Bearer type

Request Body

Name
Type
Description

name*

String

Category name

description

String

Category description

Update Category

PUT https://openapi.omdo.site/api/categories/{id}

application/json

Path Parameters

Name
Type
Description

id*

Integer

Category id

Headers

Name
Type
Description

Authorization*

String

Token JWT with Bearer type

Request Body

Name
Type
Description

name*

String

Category name

description

String

category description

Delete Category

DELETE https://openapi.omdo.site/api/categories/{id}

Path Parameters

Name
Type
Description

id*

integer

Category ID for get specify data books

Last updated