API Reference

Public REST API for subscriptions' websites. All endpoints require X-API-Key header.

Servers
  • https://api.example.comProduction
  • http://localhost:3000Local
Authentication
Send your API key in the X-API-Key header.
X-API-Key: YOUR_API_KEY

Endpoints

GET/public/blog/categories

Get categories and subcategories

Parameters
  • parentIdquery, integer
200Response example
application/json
[
  {
    "id": 1,
    "typeName": "News",
    "children": [
      {
        "id": 2,
        "typeName": "World"
      }
    ]
  },
  {
    "id": 3,
    "typeName": "Tech",
    "children": [
      {
        "id": 4,
        "typeName": "AI"
      }
    ]
  }
]
GET/public/blog/posts/by-category-lite/{categoryId}

Get posts by category (lite, flat, minimal fields)

Parameters
  • categoryId *path, integer
  • language *query, string
200Response example
application/json
{
  "posts": [
    {
      "id": 2,
      "language": "EN",
      "title": "Test Title",
      "slug": "test-title",
      "post": {
        "id": 4,
        "category": {
          "id": 1424,
          "typeName": "Blog"
        }
      }
    }
  ]
}
GET/public/blog/posts/by-category/{categoryId}

Get posts by category (hierarchical)

Parameters
  • categoryId *path, integer
  • language *query, string
200Response example
application/json
{
  "categoryId": 123,
  "categoryName": "Main Category",
  "posts": [
    {
      "id": 501,
      "language": "EN",
      "title": "Post A",
      "slug": "post-a"
    }
  ],
  "subcategories": [
    {
      "categoryId": 124,
      "categoryName": "Subcategory A",
      "posts": [
        {
          "id": 502,
          "language": "EN",
          "title": "Post B",
          "slug": "post-b"
        }
      ],
      "subcategories": [
        {
          "categoryId": 125,
          "categoryName": "Nested Subcategory",
          "posts": [],
          "subcategories": []
        }
      ]
    }
  ]
}
GET/public/blog/posts/by-slug/{slug}

Get single post by slug

Parameters
  • slug *path, string
  • language *query, string
200Response example
application/json
{
  "id": 845,
  "language": "EN",
  "title": "My Post",
  "slug": "my-post",
  "post": {
    "id": 321,
    "viewsCount": 450
  }
}