Ongrano Blog Pro
  • Quick Start Ongrano Blog Store Api
  • Reference
    • API Reference
      • Blog Categories
      • Blog Posts
      • Blog Post Comments
Powered by GitBook
On this page
  • Category List
  • Category Detail
  1. Reference
  2. API Reference

Blog Categories

Get all categories and detail via store-api.

PreviousAPI ReferenceNextBlog Posts

Last updated 1 year ago

Good to know: This API document based on Shopware 6 default store-api. You can reach base introduction document via and request body; criteria and detail via . This document gives us store api basics. Ongrano Blog Pro is designed based on these basics.

Category List

POST https://your-site.com/store-api/blog-category

return all categories regarding your criteria.

Request Header

Name
Type
Description
Value

Accept*

string

Response type

application/json

Content-Type*

string

Request type

application/json

sw-access-key*

string

Headless Access Key

SWSCQ1V1QJHHSKV0TFLYZ0LSD1

Request Body - Example Criteria 1

{
    "limit": 5,
    "page": 1,
    "filter": [
        { "type": "equals", "field": "active", "value": true }
    ],
    "sort": [
        { "field": "name", "order": "ASC" }    
    ], 
    "includes": {
        "ongrano_blog_category": ["id", "name"]
    }
}

Request Body - Example Criteria 2

{
    "limit": 10,
    "page": 1,
    "sort": [
        { "field": "name", "order": "DESC" }    
    ], 
    "includes": {
        "ongrano_blog_category": ["id", "name"]
    }
}
[
    {
        "versionId": "0fa91ce3e96a4bc2be4bd9ce752c3425",
        "translated": {
            "name": "test category 1",
            "customFields": {},
            "description": null,
            "metaTitle": "test category 1",
            "metaDescription": "test category 1",
            "keywords": "test category 1"
        },
        "createdAt": "2024-05-08T08:44:46.879+00:00",
        "updatedAt": null,
        "mediaId": "018f3e3c45e676ad8a4bb9d3707cfc47",
        "name": "test category 1",
        "active": true,
        "translations": null,
        "media": null,
        "metaTitle": "test category 1",
        "metaDescription": "test category 1",
        "keywords": "test category 1",
        "id": "018f5760679b714fbae0632757b5d804",
        "customFields": null,
        "description": null,
        "apiAlias": "ongrano_blog_category"
    },
    {
        "versionId": "0fa91ce3e96a4bc2be4bd9ce752c3425",
        "translated": {
            "name": "test category 2",
            "customFields": {},
            "description": null,
            "metaTitle": "test category 2",
            "metaDescription": "test category 2",
            "keywords": "test category 2"
        },
        "createdAt": "2024-05-03T11:34:50.161+00:00",
        "updatedAt": "2024-05-08T08:44:56.459+00:00",
        "mediaId": "018f3e3c45e676ad8a4bb9d3707cfc47",
        "name": "test category 2",
        "active": true,
        "translations": null,
        "media": null,
        "metaTitle": "test category 2",
        "metaDescription": "test category 2",
        "keywords": "test category 2",
        "id": "018f3e392d8373a6a02fe0a32c4c17c8",
        "customFields": null,
        "description": null,
        "apiAlias": "ongrano_blog_category"
    },
    {
        "versionId": "0fa91ce3e96a4bc2be4bd9ce752c3425",
        "translated": {
            "name": "test category 3",
            "customFields": {},
            "description": null,
            "metaTitle": "test category 3",
            "metaDescription": "test category 3",
            "keywords": "test category 3"
        },
        "createdAt": "2024-05-08T08:45:04.880+00:00",
        "updatedAt": "2024-05-08T08:45:17.193+00:00",
        "mediaId": "018f3e3c45e676ad8a4bb9d3707cfc47",
        "name": "test category 3",
        "active": true,
        "translations": null,
        "media": null,
        "metaTitle": "test category 3",
        "metaDescription": "test category 3",
        "keywords": "test category 3",
        "id": "018f5760adea7353a5b2c0ec675704bc",
        "customFields": null,
        "description": null,
        "apiAlias": "ongrano_blog_category"
    }
]
[
    {
        "name": "test category 4",
        "id": "018f5760eca0726e878366b96fa244bb",
        "apiAlias": "ongrano_blog_category"
    },
    {
        "name": "test category 3",
        "id": "018f5760adea7353a5b2c0ec675704bc",
        "apiAlias": "ongrano_blog_category"
    },
    {
        "name": "test category 2",
        "id": "018f3e392d8373a6a02fe0a32c4c17c8",
        "apiAlias": "ongrano_blog_category"
    },
    {
        "name": "test category 1",
        "id": "018f5760679b714fbae0632757b5d804",
        "apiAlias": "ongrano_blog_category"
    }
]

Category Detail

POST https://your-site.com/store-api/blog-category/{blogCategoryId}

return blog category regarding {blogCategoryId}

Request Header

Name
Type
Description
Value

Accept*

string

Response type

application/json

Content-Type*

string

Request type

application/json

sw-access-key*

string

Headless Access Key

SWSCQ1V1QJHHSKV0TFLYZ0LSD1

Request Body - Example Criteria

{
  "associations": {
    "media": {}
  },
  "includes": {
    "media": [
      "url"
    ]
  }
}
[
    {
        "versionId": "0fa91ce3e96a4bc2be4bd9ce752c3425",
        "translated": {
            "name": "test category 4",
            "customFields": {},
            "description": null,
            "metaTitle": "test category 4",
            "metaDescription": "test category 4",
            "keywords": "test category 4"
        },
        "createdAt": "2024-05-08T08:45:20.932+00:00",
        "updatedAt": "2024-05-08T08:45:31.255+00:00",
        "mediaId": "018f3e3c45e676ad8a4bb9d3707cfc47",
        "name": "test category 4",
        "active": false,
        "translations": null,
        "media": {
            "url": "http://127.0.0.1:8001/media/a7/34/8b/1714736088/plugin.png?1714736088",
            "apiAlias": "media"
        },
        "metaTitle": "test category 4",
        "metaDescription": "test category 4",
        "keywords": "test category 4",
        "id": "018f5760eca0726e878366b96fa244bb",
        "customFields": null,
        "description": null,
        "apiAlias": "ongrano_blog_category"
    }
]
https://shopware.stoplight.io/docs/store-api/38777d33d92dc-quick-start-guide
https://shopware.stoplight.io/docs/store-api/cf710bf73d0cd-search-queries