Sayfalar: liste
Koleksiyonlar ile düzeninizi koruyun
İçeriği tercihlerinize göre kaydedin ve kategorilere ayırın.
Blog'un sayfalarının listesini alır.
Hemen deneyin veya örneke göz atın.
Sayfalar gizli bir blogdaysa yetkilendirme gerekir. Sayfalar herkese açık bir blogdaysa bu yöntem yetkilendirme olmadan çağrılabilir.
İstek
HTTP isteği
GET https://www.googleapis.com/blogger/v3/blogs/blogId/pages
Parametreler
Parametre adı |
Değer |
Açıklama |
Gerekli parametreler |
blogId |
string |
Sayfaların alınacağı blogun kimliği.
|
İsteğe bağlı parametreler |
fetchBodies |
boolean |
Sayfa gövdelerinin alınıp alınmayacağı.
|
status |
string |
Kabul edilen değerler şunlardır:
- "
draft ": Taslak (yayınlanmamış) sayfalar
- "
imported ": İçeriği kaldırılan sayfalar
- "
live ": Herkese açık olarak görünen sayfalar
|
view |
string |
Kabul edilen değerler şunlardır:
- "
ADMIN ": Yönetici düzeyinde ayrıntı
- "
AUTHOR ": Yazar düzeyinde ayrıntı
- "
READER ": Yönetici düzeyinde ayrıntı
|
İstek içeriği
Bu yöntemle istek gövdesi sağlamayınız.
Yanıt
Başarılı olursa bu yöntem aşağıdaki yapıya sahip bir yanıt metni döndürür:
{
"kind": "blogger#pageList",
"items": [
pages Resource
]
}
Mülk adı |
Değer |
Açıklama |
Notlar |
kind |
string |
Bu varlığın türü. Her zaman blogger#pageList |
|
items[] |
list |
Belirtilen blogun Sayfa Kaynakları listesi. |
|
Örnekler
Not: Bu yöntem için kullanıma sunulan kod örnekleri, desteklenen tüm programlama dillerini kapsamaz (Desteklenen dillerin listesi için istemci kitaplıkları sayfasını inceleyin).
Java
Java istemci kitaplığını kullanır.
// The BlogId for the http://buzz.blogger.com/ blog.
String BUZZ_BLOG_ID = "2399953";
// 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-PagesList-Snippet/1.0")
.setHttpRequestInitializer(credential).build();
// The request action.
List pagesListAction = blogger.pages().list(BUZZ_BLOG_ID);
// Restrict the result content to just the data we need.
pagesListAction.setFields("items(content,title,updated,url)");
// This step sends the request to the server.
PageList pages = pagesListAction.execute();
// Now we can navigate the response.
if (pages.getItems() != null && !pages.getItems().isEmpty()) {
for (Page page : pages.getItems()) {
System.out.println("Title: " + page.getTitle());
System.out.println("URL: " + page.getUrl());
System.out.println("Last Updated:" + page.getUpdated());
System.out.println("Content: " + page.getContent());
}
}
Deneyin!
Canlı verilerde bu yöntemi çağırmak ve yanıtı görmek için aşağıdaki API Gezgini'ni kullanın.
Aksi belirtilmediği sürece bu sayfanın içeriği Creative Commons Atıf 4.0 Lisansı altında ve kod örnekleri Apache 2.0 Lisansı altında lisanslanmıştır. Ayrıntılı bilgi için Google Developers Site Politikaları'na göz atın. Java, Oracle ve/veya satış ortaklarının tescilli ticari markasıdır.
Son güncelleme tarihi: 2024-11-23 UTC.
[null,null,["Son güncelleme tarihi: 2024-11-23 UTC."],[[["\u003cp\u003eRetrieves a list of pages for a specified blog, including title, content, URL, and last updated date.\u003c/p\u003e\n"],["\u003cp\u003eRequires authorization for private blogs but not for public blogs.\u003c/p\u003e\n"],["\u003cp\u003eAllows filtering of results by page status (draft, imported, live) and level of detail (admin, author, reader).\u003c/p\u003e\n"],["\u003cp\u003eProvides options to fetch page bodies and specify desired fields in the response.\u003c/p\u003e\n"],["\u003cp\u003eOffers code examples in Java for utilizing the API.\u003c/p\u003e\n"]]],[],null,["# Pages: list\n\nRetrieves the list of [pages](/blogger/docs/3.0/reference/pages) for a [blog](/blogger/docs/3.0/reference/blogs#resource).\n[Try it now](#try-it) or [see an example](#examples).\n\n[Authorization](/blogger/docs/3.0/using#auth) is required if the pages are on a blog that is private. If the pages 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/pages\n```\n\n### Parameters\n\n| Parameter name | Value | Description |\n|----------------|-----------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| **Required parameters** |||\n| `blogId` | `string` | The ID of the blog to fetch pages from. |\n| **Optional parameters** |||\n| `fetchBodies` | `boolean` | Whether to retrieve the Page bodies. |\n| `status` | `string` | Acceptable values are: - \"`draft`\": Draft (unpublished) Pages - \"`imported`\": Pages that have had their content removed - \"`live`\": Pages that are publicly visible |\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#pageList\",\n \"items\": [\n pages Resource\n ]\n}\n```\n\n| Property name | Value | Description | Notes |\n|---------------|----------|-----------------------------------------------------|-------|\n| `kind` | `string` | The kind of this entity. Always `blogger#pageList` | |\n| `items[]` | `list` | The list of Pages Resources for the specified blog. | |\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// 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-PagesList-Snippet/1.0\")\n\t.setHttpRequestInitializer(credential).build();\n\n// The request action.\nList pagesListAction = blogger.pages().list(BUZZ_BLOG_ID);\n\n// Restrict the result content to just the data we need.\npagesListAction.setFields(\"items(content,title,updated,url)\");\n\n// This step sends the request to the server.\nPageList pages = pagesListAction.execute();\n\n// Now we can navigate the response.\nif (pages.getItems() != null && !pages.getItems().isEmpty()) {\n\tfor (Page page : pages.getItems()) {\n\t\tSystem.out.println(\"Title: \" + page.getTitle());\n\t\tSystem.out.println(\"URL: \" + page.getUrl());\n\t\tSystem.out.println(\"Last Updated:\" + page.getUpdated());\n\t\tSystem.out.println(\"Content: \" + page.getContent());\n\t}\n}\n```\n\nTry it!\n-------\n\n\nUse the APIs Explorer below to call this method on live data and see the response."]]