Halaman: daftar
Tetap teratur dengan koleksi
Simpan dan kategorikan konten berdasarkan preferensi Anda.
Mengambil daftar halaman untuk blog.
Coba sekarang atau lihat contohnya.
Otorisasi diperlukan jika halaman berada di blog yang bersifat pribadi. Jika halaman berada di blog yang bersifat publik, metode ini dapat dipanggil tanpa otorisasi.
Permintaan
Permintaan HTTP
GET https://www.googleapis.com/blogger/v3/blogs/blogId/pages
Parameter
Nama parameter |
Nilai |
Deskripsi |
Parameter yang diperlukan |
blogId |
string |
ID blog tempat mengambil halaman.
|
Parameter opsional |
fetchBodies |
boolean |
Apakah akan mengambil isi Halaman.
|
status |
string |
Nilai yang dapat diterima adalah:
- "
draft ": Halaman Draf (tidak dipublikasikan)
- "
imported ": Halaman yang kontennya telah dihapus
- "
live ": Halaman yang dapat dilihat secara publik
|
view |
string |
Nilai yang dapat diterima adalah:
- "
ADMIN ": Detail tingkat admin
- "
AUTHOR ": Detail tingkat penulis
- "
READER ": Detail tingkat admin
|
Isi permintaan
Jangan berikan isi permintaan dengan metode ini.
Respons
Jika berhasil, metode ini akan menampilkan isi respons dengan struktur berikut:
{
"kind": "blogger#pageList",
"items": [
pages Resource
]
}
Nama properti |
Nilai |
Deskripsi |
Catatan |
kind |
string |
Jenis entity ini. Selalu blogger#pageList |
|
items[] |
list |
Daftar Resource Halaman untuk blog yang ditentukan. |
|
Contoh
Catatan: Contoh kode yang tersedia untuk metode ini tidak merepresentasikan semua bahasa pemrograman yang didukung (lihat halaman library klien untuk mengetahui daftar bahasa yang didukung).
Java
Menggunakan library klien Java
// 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());
}
}
Cobalah!
Gunakan API Explorer di bawah untuk memanggil metode ini pada data langsung dan melihat responsnya.
Kecuali dinyatakan lain, konten di halaman ini dilisensikan berdasarkan Lisensi Creative Commons Attribution 4.0, sedangkan contoh kode dilisensikan berdasarkan Lisensi Apache 2.0. Untuk mengetahui informasi selengkapnya, lihat Kebijakan Situs Google Developers. Java adalah merek dagang terdaftar dari Oracle dan/atau afiliasinya.
Terakhir diperbarui pada 2024-11-23 UTC.
[null,null,["Terakhir diperbarui pada 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."]]