默认分类 2023 年 10 月 27 日

博客公开API信息

RSS

URI: /feed | Request method: GET

Return RSS

Public API

Lists articles

URI: /api/content/posts | Request method: GET

Query parameters

Parameters Required Type Comment
offset false integer (int32) the number of records to skip before starting to return the records
limit false integer (int32) the max number of records to retrieve

Example

{
    "code": 200,
    "data": [
        {
            "id": 1,
            "title": "Article title",
            "link": "Article route",
            "summary": "Article description",
            "category": "Article category",
            "cover_img": "Article cover image",
            "created_time": Timestamp when the article was first published
        },
      ...
    ]
}

Gets an article

URI: /api/content/posts/:id | Request method: GET

Path parameters

Parameters Required Type Comment
id true integer (int32) Article ID

Example

{
    "code": 200,
    "data": {
        "id": 1,
        "title": "Article title",
        "link": "Article route",
        "content": "Article content (Markdown)",
        "summary": "Article description",
        "category": "Article category",
        "cover_img": "Article cover image",
        "created_time": Timestamp when the article was first published
    }
}

Lists standalone pages

URI: /api/content/sheets | Request method: GET

Query parameters

Parameters Required Type Comment
offset false integer (int32) the number of records to skip before starting to return the records
limit false integer (int32) the max number of records to retrieve

Example

{
    "code": 200,
    "data": [
        {
            "id": 1,
            "title": "Page title",
            "link": "Page route",
            "summary": "Page description",
            "created_time": Timestamp when the page was first published
        }
    ]
}

Gets a standalone page

URI: /api/content/sheets/:id | Request method: GET

Path parameters

Parameters Required Type Comment
id true integer (int32) Standalone page ID

Example

{
    "code": 200,
    "data": {
        "id": 1,
        "title": "Page title",
        "link": "Page route",
        "content": "Page content(Markdown)",
        "summary": "Page description",
        "created_time": Timestamp when the page was first published
    }
}

Lists Friends

URI: /api/content/friends | Request method: GET

Query parameters

Parameters Required Type Comment
offset false integer (int32) the number of records to skip before starting to return the records
limit false integer (int32) the max number of records to retrieve

Example

{
    "code": 200,
    "data": [
        {
            "id": 1,
            "name": "Friend's name",
            "link": "Friend's link",
            "description": "Friend's description",
            "avatar": "Friend's avatar"
        },
      ...
    ]
}

Lists Categories

URI: /api/content/categories | Request method: GET

Query parameters

Parameters Required Type Comment
offset false integer (int32) the number of records to skip before starting to return the records
limit false integer (int32) the max number of records to retrieve

Example

{
    "code": 200,
    "data": [
        {
            "id": 1,
            "title": "Category name",
            "link": "Category route"
        },
      ...
    ]
}

Lists articles by category

URI: /api/content/categories/:id | Request method: GET

Path parameters

Parameters Required Type Comment
id true integer (int32) Category ID

Example

{
    "code": 200,
    "data": [
        {
            "id": 1,
            "title": "Article title",
            "link": "Article route",
            "summary": "Article description",
            "category": "Article category",
            "cover_img": "Article cover image",
            "created_time": Timestamp when the article was first published
        },
      ...
    ]
}