टिप्पणियां: सूची
संग्रह की मदद से व्यवस्थित रहें
अपनी प्राथमिकताओं के आधार पर, कॉन्टेंट को सेव करें और कैटगरी में बांटें.
किसी पोस्ट के लिए, टिप्पणियों की सूची वापस आती है.
इसे अभी आज़माएं या उदाहरण देखें.
अगर टिप्पणियां किसी निजी ब्लॉग पर हैं, तो उन्हें अनुमति देना ज़रूरी है. अगर टिप्पणियां किसी ऐसे ब्लॉग पर की गई हैं जो सार्वजनिक है, तो इस तरीके को बिना अनुमति के कॉल किया जा सकता है.
अनुरोध
एचटीटीपी अनुरोध
GET https://www.googleapis.com/blogger/v3/blogs/blogId/posts/postId/comments
पैरामीटर
पैरामीटर का नाम |
मान |
ब्यौरा |
ज़रूरी पैरामीटर |
blogId |
string |
उस ब्लॉग का आईडी जिससे टिप्पणियां फ़ेच करनी हैं.
|
postId |
string |
पोस्ट का आईडी जिससे टिप्पणियां फ़ेच की जानी हैं.
|
वैकल्पिक पैरामीटर |
endDate |
datetime |
टिप्पणी फ़ेच करने की नई तारीख, जो आरएफ़सी 3339 के फ़ॉर्मैट में दी गई तारीख और समय.
|
fetchBodies |
boolean |
क्या टिप्पणियों के मुख्य हिस्से को शामिल किया गया है.
|
maxResults |
unsigned integer |
नतीजे में शामिल की जाने वाली टिप्पणियों की ज़्यादा से ज़्यादा संख्या.
|
pageToken |
string |
अगर अनुरोध को पेज किया गया है, तो कंटिन्यूएशन टोकन.
|
startDate |
datetime |
टिप्पणी को फ़ेच करने की सबसे पहले की तारीख, आरएफ़सी 3339 फ़ॉर्मैटिंग के साथ तारीख और समय.
|
status |
string |
ये वैल्यू स्वीकार की जाती हैं:
- "
emptied ": ऐसी टिप्पणियां जिनका कॉन्टेंट हटा दिया गया है
- "
live ": ऐसी टिप्पणियां जो सभी को दिखती हैं
- "
pending ": ऐसी टिप्पणियां जिन्हें एडमिन की अनुमति मिलना बाकी है
- "
spam ": ऐसी टिप्पणियां जिन्हें एडमिन ने स्पैम के तौर पर मार्क किया है
|
view |
string |
ये वैल्यू स्वीकार की जाती हैं:
- "
ADMIN ": एडमिन लेवल की जानकारी
- "
AUTHOR ": लेखक के लेवल की जानकारी
- "
READER ": एडमिन लेवल की जानकारी
|
अनुरोध का मुख्य भाग
इस तरीके के साथ अनुरोध का मुख्य हिस्सा न दें.
जवाब
सही तरीके से काम करने पर, यह तरीका इस स्ट्रक्चर के साथ रिस्पॉन्स का मुख्य हिस्सा दिखाता है:
{
"kind": "blogger#commentList",
"nextPageToken": string,
"prevPageToken": string,
"items": [
comments Resource
]
}
प्रॉपर्टी का नाम |
मान |
ब्यौरा |
नोट |
kind |
string |
इस एंट्री का टाइप. हमेशा blogger#commentList . |
|
nextPageToken |
string |
अगर पहले से कोई पेज मौजूद है, तो अगला पेज फ़ेच करने के लिए, पेज पर नंबर डालने का टोकन. |
|
prevPageToken |
string |
अगर पहले से पेज मौजूद है, तो पिछले पेज को फ़ेच करने के लिए, पेज पर नंबर डालने का टोकन. |
|
items[] |
list |
बताई गई पोस्ट के लिए, टिप्पणी से जुड़े संसाधनों की सूची. |
|
उदाहरण
ध्यान दें: इस तरीके के लिए दिए गए कोड के उदाहरणों में इसके साथ काम करने वाली सभी प्रोग्रामिंग भाषाएं नहीं दिखाई गई हैं (इसके साथ काम करने वाली भाषाओं की सूची के लिए क्लाइंट लाइब्रेरी वाला पेज देखें).
Java
Java क्लाइंट लाइब्रेरी का इस्तेमाल करता हो
// The BlogId for the http://buzz.blogger.com/ blog.
String BUZZ_BLOG_ID = "2399953";
// The PostId for a buzz post with comments.
String BUZZ_POST_ID = "5310628572012276714";
// Configure the Java API Client for Installed Native App
HttpTransport HTTP_TRANSPORT = new NetHttpTransport();
JsonFactory JSON_FACTORY = new JacksonFactory();
// Configure the Installed App OAuth2 flow.
Credential credential = OAuth2Native.authorize(HTTP_TRANSPORT,
JSON_FACTORY, new LocalServerReceiver(),
Arrays.asList(BloggerScopes.BLOGGER));
// Construct the Blogger API access facade object.
Blogger blogger = Blogger.builder(HTTP_TRANSPORT, JSON_FACTORY)
.setApplicationName("Blogger-CommentsList-Snippet/1.0")
.setHttpRequestInitializer(credential).build();
// The request action.
List commentsListAction = blogger.comments().list(BUZZ_BLOG_ID, BUZZ_POST_ID);
// Restrict the result content to just the data we need.
commentsListAction.setFields("items(author/displayName,content),nextPageToken");
// This step sends the request to the server.
CommentList comments = commentsListAction.execute();
// Now we can navigate the response.
while(comments.getItems() != null && !comments.getItems().isEmpty()){
for(Comment comment : comments.getItems()) {
System.out.println(comment.getAuthor().getDisplayName()+": "+comment.getContent());
}
// Pagination logic
String pageToken = comments.getNextPageToken();
if(pageToken == null) {
break;
}
System.out.println("-- Next page of comments");
commentsListAction.setPageToken(pageToken);
comments = commentsListAction.execute();
}
इसे आज़माएं!
लाइव डेटा पर इस तरीके को कॉल करने और जवाब देखने के लिए, नीचे दिए गए एपीआई एक्सप्लोरर का इस्तेमाल करें.
जब तक कुछ अलग से न बताया जाए, तब तक इस पेज की सामग्री को Creative Commons Attribution 4.0 License के तहत और कोड के नमूनों को Apache 2.0 License के तहत लाइसेंस मिला है. ज़्यादा जानकारी के लिए, Google Developers साइट नीतियां देखें. Oracle और/या इससे जुड़ी हुई कंपनियों का, Java एक रजिस्टर किया हुआ ट्रेडमार्क है.
आखिरी बार 2024-08-09 (UTC) को अपडेट किया गया.
[null,null,["आखिरी बार 2024-08-09 (UTC) को अपडेट किया गया."],[[["\u003cp\u003eRetrieves a list of comments for a specific blog post, requiring authorization only for private blogs.\u003c/p\u003e\n"],["\u003cp\u003eAllows filtering of comments by date, content inclusion, maximum results, and status (live, pending, spam, emptied).\u003c/p\u003e\n"],["\u003cp\u003eSupports pagination to retrieve large sets of comments using \u003ccode\u003enextPageToken\u003c/code\u003e and \u003ccode\u003eprevPageToken\u003c/code\u003e.\u003c/p\u003e\n"],["\u003cp\u003eProvides response data including comment details, author information, and pagination tokens in JSON format.\u003c/p\u003e\n"],["\u003cp\u003eOffers code examples in Java for utilizing the API to fetch and display comments.\u003c/p\u003e\n"]]],[],null,["# Comments: list\n\nRetrieves the list of [comments](/blogger/docs/3.0/reference/comments) for a [post](/blogger/docs/3.0/reference/posts).\n[Try it now](#try-it) or [see an example](#examples).\n\n[Authorization](/blogger/docs/3.0/using#auth) is required if the comments are on a blog that is private. If the comments are on a blog that is public, then this method can be called without authorization.\n\nRequest\n-------\n\n### HTTP request\n\n```\nGET https://www.googleapis.com/blogger/v3/blogs/blogId/posts/postId/comments\n```\n\n### Parameters\n\n| Parameter name | Value | Description |\n|----------------|--------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| **Required parameters** |||\n| `blogId` | `string` | The ID of the blog to fetch comments from. |\n| `postId` | `string` | The ID of the post to fetch comments from. |\n| **Optional parameters** |||\n| `endDate` | `datetime` | Latest date of comment to fetch, a date-time with RFC 3339 formatting. |\n| `fetchBodies` | `boolean` | Whether the body content of the comments is included. |\n| `maxResults` | `unsigned integer` | Maximum number of comments to include in the result. |\n| `pageToken` | `string` | Continuation token if request is paged. |\n| `startDate` | `datetime` | Earliest date of comment to fetch, a date-time with RFC 3339 formatting. |\n| `status` | `string` | Acceptable values are: - \"`emptied`\": Comments that have had their content removed - \"`live`\": Comments that are publicly visible - \"`pending`\": Comments that are awaiting administrator approval - \"`spam`\": Comments marked as spam by the administrator |\n| `view` | `string` | Acceptable values are: - \"`ADMIN`\": Admin level detail - \"`AUTHOR`\": Author level detail - \"`READER`\": Admin level detail |\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#commentList\",\n \"nextPageToken\": string,\n \"prevPageToken\": string,\n \"items\": [\n comments Resource\n ]\n}\n```\n\n| Property name | Value | Description | Notes |\n|-----------------|----------|-------------------------------------------------------------|-------|\n| `kind` | `string` | The kind of this entry. Always `blogger#commentList`. | |\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 comments resources for the specified post. | |\n\nExamples\n--------\n\n**Note:** The code examples available for this method do not represent all supported programming languages (see the [client libraries page](/blogger/docs/3.0/libraries) for a list of supported languages). \n\n### Java\n\nUses the [Java client library](http://code.google.com/p/google-api-java-client/) \n\n```java\n// The BlogId for the http://buzz.blogger.com/ blog.\nString BUZZ_BLOG_ID = \"2399953\";\n\n// The PostId for a buzz post with comments.\nString BUZZ_POST_ID = \"5310628572012276714\";\n\n// Configure the Java API Client for Installed Native App\nHttpTransport HTTP_TRANSPORT = new NetHttpTransport();\nJsonFactory JSON_FACTORY = new JacksonFactory();\n\n// Configure the Installed App OAuth2 flow.\nCredential credential = OAuth2Native.authorize(HTTP_TRANSPORT,\n\tJSON_FACTORY, new LocalServerReceiver(),\n\tArrays.asList(BloggerScopes.BLOGGER));\n\n// Construct the Blogger API access facade object.\nBlogger blogger = Blogger.builder(HTTP_TRANSPORT, JSON_FACTORY)\n\t.setApplicationName(\"Blogger-CommentsList-Snippet/1.0\")\n\t.setHttpRequestInitializer(credential).build();\n\n// The request action.\nList commentsListAction = blogger.comments().list(BUZZ_BLOG_ID, BUZZ_POST_ID);\n\n// Restrict the result content to just the data we need.\ncommentsListAction.setFields(\"items(author/displayName,content),nextPageToken\");\n\n// This step sends the request to the server.\nCommentList comments = commentsListAction.execute();\n\n// Now we can navigate the response.\nwhile(comments.getItems() != null && !comments.getItems().isEmpty()){\n\tfor(Comment comment : comments.getItems()) {\n\t\tSystem.out.println(comment.getAuthor().getDisplayName()+\": \"+comment.getContent());\n\t}\n\n\t// Pagination logic\n\tString pageToken = comments.getNextPageToken();\n\tif(pageToken == null) {\n\t\tbreak;\n\t}\n\tSystem.out.println(\"-- Next page of comments\");\n\tcommentsListAction.setPageToken(pageToken);\n\tcomments = commentsListAction.execute();\n}\n```\n\nTry it!\n-------\n\n\nUse the APIs Explorer below to call this method on live data and see the response."]]