Bài đăng
Sử dụng bộ sưu tập để sắp xếp ngăn nắp các trang
Lưu và phân loại nội dung dựa trên lựa chọn ưu tiên của bạn.
Lưu ý quan trọng: Chúng tôi sẽ ngừng hỗ trợ API JSON phiên bản 2.0 từ ngày 30 tháng 9 năm 2024.
Để đảm bảo ứng dụng của bạn vẫn hoạt động bình thường, hãy cập nhật những ứng dụng có dùng API JSON phiên bản 2.0 lên phiên bản API mới nhất. Đối với phiên bản mới nhất, hãy sử dụng các đường liên kết trong thanh điều hướng bên trái.
Bài đăng chứa nội dung HTML của một bài đăng trên blog.
Phương thức
Bạn có thể truy xuất danh sách Bài đăng cho một Blog bằng phương thức blogger.posts.list và truy xuất một Bài đăng riêng lẻ bằng phương thức blogger.posts.get.
- list
- Truy xuất danh sách bài đăng.
- get
- Truy xuất một bài đăng theo postId.
Biểu thị tài nguyên
Tài nguyên bài đăng chứa dữ liệu và siêu dữ liệu cho một bài đăng trong blog.
{
"kind": "blogger#post",
"id": long,
"blog": {
"id": long
},
"published": datetime,
"updated": datetime,
"url": string,
"selfLink": string,
"title": string,
"content": string,
"author": {
"id": string,
"displayName": string,
"url": string,
"image": {
"url": string
}
},
"replies": {
"totalItems": long,
"selfLink": string
},
"labels": [
string
]
}
Tên thuộc tính |
Giá trị |
Mô tả |
Ghi chú |
kind |
string |
Loại thực thể này. Luôn là blogger#post . |
|
id |
long |
Giá trị nhận dạng của bài đăng này. |
|
blog |
object |
Dữ liệu về blog chứa bài đăng này. |
|
blog.id |
long |
Giá trị nhận dạng của blog chứa bài đăng này. |
|
published |
datetime |
Ngày giờ theo định dạng RFC 3339 khi bài đăng này được xuất bản. |
|
updated |
datetime |
Ngày giờ theo chuẩn RFC 3339 khi bài đăng này được cập nhật gần đây nhất. |
|
url |
string |
URL nơi bài đăng này xuất hiện. |
|
selfLink |
string |
URL API REST để tìm nạp tài nguyên này. |
|
title |
string |
Tiêu đề bài đăng. |
|
content |
string |
Nội dung của bài đăng. Có thể chứa mã đánh dấu HTML. |
|
author |
object |
Tác giả của bài đăng này. |
|
author.id |
string |
Giá trị nhận dạng của người tạo bài đăng. |
|
author.displayName |
string |
Tên hiển thị của người tạo bài đăng. |
|
author.url |
string |
URL của trang Hồ sơ của người tạo bài đăng. |
|
author.image |
object |
Hình đại diện của người tạo bài đăng. |
|
author.image.url |
string |
URL của hình đại diện của người tạo bài đăng. |
|
replies |
object |
Vùng chứa các bình luận của bài đăng này. |
|
replies.totalItems |
long |
Tổng số bình luận trên bài đăng này. |
|
replies.selfLink |
string |
URL của bình luận trên bài đăng này. |
|
labels[] |
list |
Danh sách nhãn được gắn cho bài đăng này. |
|
Trừ phi có lưu ý khác, nội dung của trang này được cấp phép theo Giấy phép ghi nhận tác giả 4.0 của Creative Commons và các mẫu mã lập trình được cấp phép theo Giấy phép Apache 2.0. Để biết thông tin chi tiết, vui lòng tham khảo Chính sách trang web của Google Developers. Java là nhãn hiệu đã đăng ký của Oracle và/hoặc các đơn vị liên kết với Oracle.
Cập nhật lần gần đây nhất: 2024-12-21 UTC.
[null,null,["Cập nhật lần gần đây nhất: 2024-12-21 UTC."],[[["\u003cp\u003eSupport for the v2.0 JSON API will be discontinued on September 30, 2024, requiring applications to update to the latest API version.\u003c/p\u003e\n"],["\u003cp\u003eThe API allows retrieval of blog posts using the \u003ccode\u003eblogger.posts.list\u003c/code\u003e and \u003ccode\u003eblogger.posts.get\u003c/code\u003e methods, enabling access to post data.\u003c/p\u003e\n"],["\u003cp\u003ePosts contain HTML content and metadata such as title, author information, publication date, and associated labels.\u003c/p\u003e\n"],["\u003cp\u003eThe "Posts Resource" provides a structured representation of a blog post, including details like ID, content, author, and comments.\u003c/p\u003e\n"]]],[],null,["# Posts\n\n**Important**:\nWe will discontinue support for the v2.0 JSON API on September 30th, 2024.\nTo ensure continued functionality, update your applications that rely on the v2.0 JSON API\nto the latest API version. For the latest version, use the links in the left-side navbar.\nPosts contain the HTML content of a blog post.\n\nMethods\n-------\n\nYou can retrieve the list of Posts for a Blog using the [blogger.posts.list](/blogger/docs/2.0/json/reference/posts/list) method, and retrieve an individual Post using the [blogger.posts.get](/blogger/docs/2.0/json/reference/posts/get) method.\n\n[list](/blogger/docs/2.0/json/reference/posts/list)\n: Retrieves a list of posts.\n\n[get](/blogger/docs/2.0/json/reference/posts/get)\n: Retrieves one post by postId.\n\nResource Representations\n------------------------\n\nThe Posts Resource contains the data and metadata for a post in a blog.\n\n```text\n{\n \"kind\": \"blogger#post\",\n \"id\": long,\n \"blog\": {\n \"id\": long\n },\n \"published\": datetime,\n \"updated\": datetime,\n \"url\": string,\n \"selfLink\": string,\n \"title\": string,\n \"content\": string,\n \"author\": {\n \"id\": string,\n \"displayName\": string,\n \"url\": string,\n \"image\": {\n \"url\": string\n }\n },\n \"replies\": {\n \"totalItems\": long,\n \"selfLink\": string\n },\n \"labels\": [\n string\n ]\n}\n```\n\n| Property Name | Value | Description | Notes |\n|----------------------|------------|-----------------------------------------------------|-------|\n| `kind` | `string` | The kind of this entity. Always `blogger#post`. | |\n| `id` | `long` | The identifier of this post. | |\n| `blog` | `object` | Data about the blog containing this post. | |\n| blog.`id` | `long` | The identifier of the blog that contains this post. | |\n| `published` | `datetime` | RFC 3339 date-time when this post was published. | |\n| `updated` | `datetime` | RFC 3339 date-time when this post was last updated. | |\n| `url` | `string` | The URL where this post is displayed. | |\n| `selfLink` | `string` | The API REST URL to fetch this resource from. | |\n| `title` | `string` | The title of the post. | |\n| `content` | `string` | The content of the post. May contain HTML markup. | |\n| `author` | `object` | The author of this post. | |\n| author.`id` | `string` | The identifier of the post creator. | |\n| author.`displayName` | `string` | The post creator's display name. | |\n| author.`url` | `string` | The URL of the post creator's Profile page. | |\n| author.`image` | `object` | The post creator's avatar. | |\n| author.image.`url` | `string` | The post creator's avatar URL. | |\n| `replies` | `object` | The container for this post's comments. | |\n| replies.`totalItems` | `long` | The total number of comments on this post. | |\n| replies.`selfLink` | `string` | The URL of the comments on this post. | |\n| `labels[]` | `list` | The list of labels this post was tagged with. | |"]]