question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Blogger API v3 : when calling /posts/search/, parameter nextPageToken is ignored

See original GitHub issue

Env : javascript, using XMLHttpRequest and JSON API.

When calling {URL}/posts/?{parameters} :

  • the 10 first items are returned
  • if the response contains more than 10 items, an attribute { "nextPageToken":"xyz" } is added to the JSON data response.

Then when calling {URL}/posts/?{parameters}&pageToken={nextPageToken} :

  • the response contains the next 10 items
  • a new nextPageToken is returned until no more page

=> Looks like the expected behavior, working fine.

However: When calling {URL}/posts/search/?q={query_string}{parameters} :

  • the 10 first items are returned
  • if the response contains more than 10 items, an attribute { "nextPageToken":"xyz" } is added to the JSON data response.

Then when calling {URL}/posts/search/?q={query_string}{parameters}&pageToken={nextPageToken} : - the 10 first items are displayed again (ie not the next 10), - returned nextPageToken is the same than first call

Looks like pageToken is ignored for /posts/search/. Is this the expected behavior ? How to access items of /posts/search/ response returning more than 10 items?

Issue Analytics

  • State:open
  • Created 4 years ago
  • Comments:6 (1 by maintainers)

github_iconTop GitHub Comments

3reactions
mortezaadicommented, Jan 12, 2022

Definitely, it’s not a bug, though it needs more clarification, you can refer to this document from Blogger API v3.

to get the pagination work you need to call the API with maxResults={pageSize} then you will get an extra value in the response ‘nextPageToken’, you should use the value of this field and pass it with. ‘pageToken’ NOT ‘nextPageToken’

https://blablabla?maxResults=10&pageToken={VALUE_OF_NEXTPAGETOKEN}

when you reach the end of the list you won’t get the nextPageToken anymore and it means nothing more to fetch.

0reactions
meltsufincommented, Dec 4, 2022

It doesn’t appear to be an issue with the library itself. If anything, it’s the service.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Blogger API v3 : when calling /posts/search ... - Stack Overflow
Looks like pageToken is ignored for /posts/search/. Is this the expected behavior? How to access items of /posts/search/ response returning more ...
Read more >
Blogger API: Using the API - Google Developers
After you have an API key, your application can append the query parameter key= yourAPIKey to all request URLs. The API key is...
Read more >
Blogger Api -- 小米规整 | 米薏小天地
分享下 Blogger Api 希望大家喜欢. ... https://www.googleapis.com/blogger/v3/blogs/blogId/posts/search ...
Read more >
Blogger API v3 Connector - WSO2 Documentation
<accessToken> parameter, an optional parameter needed when calling operations in Blogger API needing authentication and when invoking any ...
Read more >
List and Search Posts - Blogging Using the Blogger API in ...
We can retrieve a list of all blog posts by making a GET request to the following URL: https://blogger.googleapis.com/v3/blogs/{blogId}/posts.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found