帖子:list
使用集合让一切井井有条
根据您的偏好保存内容并对其进行分类。
重要提示:我们将于 2024 年 9 月 30 日停止支持 2.0 版 JSON API。为确保可继续使用功能,请将依赖 v2.0 JSON API 的应用更新到最新 API 版本。如需获取最新版本,请使用左侧导航栏中的链接。
检索帖子列表。立即尝试。
如果博文是在私密博客上发布的,则必须进行身份验证。如果这些帖子位于公开的博客上,则此方法无需身份验证即可调用。
请求
HTTP 请求
GET https://www.googleapis.com/blogger/v2/blogs/blogId/posts
参数
参数名称 |
值 |
说明 |
必需参数 |
blogId |
string |
要从中提取博文的博客 ID。
|
可选参数 |
fetchBodies |
boolean |
是否包含帖子的正文内容。
|
maxResults |
unsigned integer |
要获取的帖子数量上限。
|
pageToken |
string |
延续令牌(如果请求分页)。
|
startDate |
datetime |
要获取的最早发布日期,即采用 RFC 3339 格式的日期时间。
|
请求正文
使用此方法时请勿提供请求正文。
响应
如果成功,此方法将返回以下结构的响应正文:
{
"kind": "blogger#postList",
"nextPageToken": string,
"prevPageToken": string,
"items": [
posts Resource
]
}
属性名称 |
值 |
说明 |
备注 |
kind |
string |
此实体的种类。始终为 blogger#postList 。 |
|
nextPageToken |
string |
用于获取下一页的分页令牌(如果存在)。 |
|
prevPageToken |
string |
用于获取上一页的分页令牌(如果存在)。 |
|
items[] |
list |
此博客的博文列表。 |
|
试试看!
请使用下面的 Explorer 对实际数据调用此方法,并查看响应。
如未另行说明,那么本页面中的内容已根据知识共享署名 4.0 许可获得了许可,并且代码示例已根据 Apache 2.0 许可获得了许可。有关详情,请参阅 Google 开发者网站政策。Java 是 Oracle 和/或其关联公司的注册商标。
最后更新时间 (UTC):2024-06-26。
[null,null,["最后更新时间 (UTC):2024-06-26。"],[[["\u003cp\u003eSupport for the v2.0 JSON API will be discontinued on September 30, 2024, and users should update to the latest API version.\u003c/p\u003e\n"],["\u003cp\u003eThis API retrieves a list of posts from a specified blog, requiring authentication only for private blogs.\u003c/p\u003e\n"],["\u003cp\u003eDevelopers can use parameters like \u003ccode\u003efetchBodies\u003c/code\u003e, \u003ccode\u003emaxResults\u003c/code\u003e, \u003ccode\u003epageToken\u003c/code\u003e, and \u003ccode\u003estartDate\u003c/code\u003e to customize their requests for retrieving posts.\u003c/p\u003e\n"],["\u003cp\u003eSuccessful responses will provide a list of posts along with pagination tokens for navigating through results.\u003c/p\u003e\n"]]],[],null,["# Posts: list\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.\n\nRetrieves a list of posts.\n[Try it now](#try-it).\n\nAuthentication is required if the posts are on a blog that is private. If the posts are on a blog that is public, then this method can be called without authentication.\n\nRequest\n-------\n\n### HTTP Request\n\n```\nGET https://www.googleapis.com/blogger/v2/blogs/blogId/posts\n```\n\n### Parameters\n\n| Parameter Name | Value | Description |\n|----------------|--------------------|--------------------------------------------------------------------|\n| **Required Parameters** |||\n| `blogId` | `string` | ID of the blog to fetch posts from. |\n| **Optional Parameters** |||\n| `fetchBodies` | `boolean` | Whether the body content of posts is included. |\n| `maxResults` | `unsigned integer` | Maximum number of posts to fetch. |\n| `pageToken` | `string` | Continuation token if the request is paged. |\n| `startDate` | `datetime` | Earliest post date to fetch, a date-time with RFC 3339 formatting. |\n\n### Request Body\n\nDo not supply a request body with this method.\n\nResponse\n--------\n\nIf successful, this method returns a response body with the following structure:\n\n```objective-c\n{\n \"kind\": \"blogger#postList\",\n \"nextPageToken\": string,\n \"prevPageToken\": string,\n \"items\": [\n posts Resource\n ]\n}\n```\n\n| Property Name | Value | Description | Notes |\n|-----------------|----------|-------------------------------------------------------------|-------|\n| `kind` | `string` | The kind of this entity. Always `blogger#postList`. | |\n| `nextPageToken` | `string` | Pagination token to fetch the next page, if one exists. | |\n| `prevPageToken` | `string` | Pagination token to fetch the previous page, if one exists. | |\n| `items[]` | `list` | The list of posts for this blog. | |\n\nTry It!\n-------\n\n\nUse the explorer below to call this method on live data and see the response."]]