Páginas: lista
Mantenha tudo organizado com as coleções
Salve e categorize o conteúdo com base nas suas preferências.
Recupera a lista de páginas de um blog.
Teste agora ou confira um exemplo.
A autorização é necessária se as páginas estiverem em um blog privado. Se as páginas estiverem em um blog público, esse método poderá ser chamado sem autorização.
Solicitação
Solicitação HTTP
GET https://www.googleapis.com/blogger/v3/blogs/blogId/pages
Parâmetros
Nome do parâmetro |
Valor |
Descrição |
Parâmetros obrigatórios |
blogId |
string |
O ID do blog de onde as páginas serão extraídas.
|
Parâmetros opcionais |
fetchBodies |
boolean |
Define se os corpos da página serão recuperados.
|
status |
string |
Os valores aceitáveis são:
- "
draft ": páginas de rascunho (não publicadas)
- "
imported ": páginas que tiveram o conteúdo removido
- "
live ": páginas que são visíveis publicamente
|
view |
string |
Os valores aceitáveis são:
- "
ADMIN ": detalhes no nível do administrador
- "
AUTHOR ": detalhes no nível do autor
- "
READER ": detalhes no nível do administrador
|
Corpo da solicitação
Não forneça um corpo de solicitação com este método.
Resposta
Se for bem-sucedido, esse método retornará um corpo de resposta com esta estrutura:
{
"kind": "blogger#pageList",
"items": [
pages Resource
]
}
Nome da propriedade |
Valor |
Descrição |
Observações |
kind |
string |
O tipo desta entidade. Sempre blogger#pageList |
|
items[] |
list |
A lista de recursos de páginas do blog especificado. |
|
Exemplos
Observação: os exemplos de código disponíveis para esse método não representam todas as linguagens de programação compatíveis. Consulte a página de bibliotecas cliente para ver uma lista de linguagens compatíveis.
Java
Usa a biblioteca cliente de 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());
}
}
Confira!
Use o APIs Explorer abaixo para chamar esse método em dados ativos e ver a resposta.
Exceto em caso de indicação contrária, o conteúdo desta página é licenciado de acordo com a Licença de atribuição 4.0 do Creative Commons, e as amostras de código são licenciadas de acordo com a Licença Apache 2.0. Para mais detalhes, consulte as políticas do site do Google Developers. Java é uma marca registrada da Oracle e/ou afiliadas.
Última atualização 2024-11-23 UTC.
[null,null,["Última atualização 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."]]