PostUserInfos: รายการ
จัดทุกอย่างให้เป็นระเบียบอยู่เสมอด้วยคอลเล็กชัน
บันทึกและจัดหมวดหมู่เนื้อหาตามค่ากำหนดของคุณ
ต้องมีการให้สิทธิ์
ดึงข้อมูลรายการคู่โพสต์และข้อมูลผู้ใช้ของโพสต์ ซึ่งอาจมีการกรอง ข้อมูลผู้ใช้ของโพสต์มีข้อมูลเกี่ยวกับโพสต์สำหรับผู้ใช้แต่ละราย เช่น สิทธิ์เข้าถึงสำหรับผู้ใช้รายนั้นๆ โดยเฉพาะ
ลองใช้เลย
ส่งคำขอ
คำขอ HTTP
GET https://www.googleapis.com/blogger/v3/users/userId/blogs/blogId/posts
พารามิเตอร์
ชื่อพารามิเตอร์ |
ค่า |
คำอธิบาย |
พารามิเตอร์ที่จำเป็น |
blogId |
string |
รหัสของบล็อกที่จะดึงข้อมูลโพสต์
|
userId |
string |
รหัสของผู้ใช้ที่จะดึงข้อมูลต่อผู้ใช้ คําว่า "ตนเอง" (ไม่ใส่เครื่องหมายคำพูด) หรือตัวระบุโปรไฟล์ของผู้ใช้
|
พารามิเตอร์ที่ไม่บังคับ |
endDate |
datetime |
วันที่โพสต์ล่าสุดที่จะดึงข้อมูล ซึ่งเป็นวันที่และเวลาที่มีการจัดรูปแบบ RFC 3339
|
fetchBodies |
boolean |
ระบุว่าจะรวมเนื้อหาของโพสต์หรือไม่ ค่าเริ่มต้นคือ false
(ค่าเริ่มต้น: false )
|
labels |
string |
รายการป้ายกํากับที่จะค้นหา โดยคั่นแต่ละรายการด้วยคอมมา
|
maxResults |
unsigned integer |
จำนวนสูงสุดของโพสต์ที่จะดึงข้อมูล
|
orderBy |
string |
ลำดับการจัดเรียงที่ใช้กับผลการค้นหา ค่าเริ่มต้นคือ published
ค่าที่ยอมรับมีดังนี้
- "
published ": จัดเรียงตามวันที่เผยแพร่โพสต์
- "
updated ": จัดเรียงตามวันที่อัปเดตโพสต์ล่าสุด
|
pageToken |
string |
โทเค็นการต่ออายุ ซึ่งใช้เพื่อเลื่อนดูชุดผลลัพธ์ขนาดใหญ่ หากต้องการดูหน้าถัดไปของผลการค้นหา ให้ตั้งค่าพารามิเตอร์นี้เป็นค่า "nextPageToken" จากการตอบกลับก่อนหน้า
|
startDate |
datetime |
วันที่โพสต์ที่เก่าที่สุดที่จะดึงข้อมูล ซึ่งเป็นวันที่และเวลาที่มีการจัดรูปแบบ RFC 3339
|
status |
string |
ค่าที่ยอมรับมีดังนี้
- "
draft ": โพสต์ฉบับร่าง
- "
live ": โพสต์ที่เผยแพร่
- "
scheduled ": โพสต์ที่กำหนดเวลาเผยแพร่ในอนาคต
|
view |
string |
ค่าที่ยอมรับมีดังนี้
- "
ADMIN ": รายละเอียดระดับผู้ดูแลระบบ
- "
AUTHOR ": รายละเอียดระดับผู้แต่ง
- "
READER ": รายละเอียดระดับผู้อ่าน
|
การให้สิทธิ์
คำขอนี้ต้องมีการให้สิทธิ์ด้วยขอบเขตต่อไปนี้อย่างน้อย 1 รายการ (อ่านเพิ่มเติมเกี่ยวกับการรับรองและการให้สิทธิ์)
ขอบเขต |
https://www.googleapis.com/auth/blogger |
https://www.googleapis.com/auth/blogger.readonly |
เนื้อหาของคำขอ
อย่าระบุเนื้อหาคำขอด้วยเมธอดนี้
คำตอบ
หากทำสำเร็จ วิธีการนี้จะแสดงผลลัพธ์เป็นเนื้อหาการตอบกลับซึ่งมีโครงสร้างดังต่อไปนี้
{
"kind": "blogger#postUserInfosList",
"nextPageToken": string,
"items": [
postUserInfos Resource
]
}
ชื่อพร็อพเพอร์ตี้ |
ค่า |
คำอธิบาย |
หมายเหตุ |
kind |
string |
ประเภทของเอนทิตีนี้ blogger#postList เสมอ |
|
nextPageToken |
string |
โทเค็นการแบ่งหน้าเพื่อเรียกข้อมูลหน้าถัดไป หากมี |
|
items[] |
list |
รายการโพสต์ที่มีข้อมูลผู้ใช้สำหรับโพสต์นั้นๆ ในบล็อกนี้ |
|
ลองใช้งาน
ใช้โปรแกรมสำรวจ API ด้านล่างเพื่อเรียกใช้เมธอดนี้กับข้อมูลจริงและดูการตอบกลับ
เนื้อหาของหน้าเว็บนี้ได้รับอนุญาตภายใต้ใบอนุญาตที่ต้องระบุที่มาของครีเอทีฟคอมมอนส์ 4.0 และตัวอย่างโค้ดได้รับอนุญาตภายใต้ใบอนุญาต Apache 2.0 เว้นแต่จะระบุไว้เป็นอย่างอื่น โปรดดูรายละเอียดที่นโยบายเว็บไซต์ Google Developers Java เป็นเครื่องหมายการค้าจดทะเบียนของ Oracle และ/หรือบริษัทในเครือ
อัปเดตล่าสุด 2024-11-30 UTC
[null,null,["อัปเดตล่าสุด 2024-11-30 UTC"],[[["\u003cp\u003eRetrieves a list of posts and user-specific information for those posts from a specified blog.\u003c/p\u003e\n"],["\u003cp\u003eAllows filtering of posts by date, labels, status, and other criteria.\u003c/p\u003e\n"],["\u003cp\u003eRequires authorization with specific scopes for access.\u003c/p\u003e\n"],["\u003cp\u003eReturns paginated results with post and user information.\u003c/p\u003e\n"],["\u003cp\u003eCan be tested using the provided API Explorer.\u003c/p\u003e\n"]]],[],null,["# PostUserInfos: list\n\n**Requires [authorization](#auth)**\n\nRetrieves a list of post and post user info pairs, possibly filtered. The post user info contains per-user information about the post, such as access rights, specific to the user.\n[Try it now](#try-it).\n\nRequest\n-------\n\n### HTTP request\n\n```\nGET https://www.googleapis.com/blogger/v3/users/userId/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| `userId` | `string` | ID of the user for the per-user information to be fetched. Either the word 'self' (sans quote marks) or the user's profile identifier. |\n| **Optional parameters** |||\n| `endDate` | `datetime` | Latest post date to fetch, a date-time with RFC 3339 formatting. |\n| `fetchBodies` | `boolean` | Whether to include the post's body content. Default is `false`. (Default: `false`) |\n| `labels` | `string` | Comma-separated list of labels to search for. |\n| `maxResults` | `unsigned integer` | Maximum number of posts to fetch. |\n| `orderBy` | `string` | Sort order applied to search results. Default is `published`. \u003cbr /\u003e \u003cbr /\u003e Acceptable values are: - \"`published`\": Order by the date the post was published - \"`updated`\": Order by the date the post was last updated |\n| `pageToken` | `string` | The continuation token, which is used to page through large result sets. To get the next page of results, set this parameter to the value of \"nextPageToken\" from the previous response. |\n| `startDate` | `datetime` | Earliest post date to fetch, a date-time with RFC 3339 formatting. |\n| `status` | `string` | Acceptable values are: - \"`draft`\": Draft posts - \"`live`\": Published posts - \"`scheduled`\": Posts that are scheduled to publish in future. |\n| `view` | `string` | Acceptable values are: - \"`ADMIN`\": Admin level detail - \"`AUTHOR`\": Author level detail - \"`READER`\": Reader level detail |\n\n### Authorization\n\nThis request requires authorization with at least one of the following scopes ([read more about authentication and authorization](/blogger/docs/3.0/using#auth)).\n\n| Scope |\n|----------------------------------------------------|\n| `https://www.googleapis.com/auth/blogger` |\n| `https://www.googleapis.com/auth/blogger.readonly` |\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#postUserInfosList\",\n \"nextPageToken\": string,\n \"items\": [\n postUserInfos 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| `items[]` | `list` | The list of Posts with User information for the post, for this Blog. | |\n\nTry it!\n-------\n\n\nUse the APIs Explorer below to call this method on live data and see the response."]]