ButterCMS / buttercms-java

Java SDK for ButterCMS (https://buttercms.com)
MIT License
1 stars 3 forks source link

Search function calls the wrong API #7

Open HonzaStefanik opened 2 years ago

HonzaStefanik commented 2 years ago

According to the ButterCMS' documentation, the search URL is the following

GET 'https://api.buttercms.com/v2/posts/search/?query=buttercmsapi&page=1&page_size=10&auth_token=your_api_token'

However, using the search function according to docs from the Java SDK calls the following

GET https://api.buttercms.com/v2/posts/?auth_token=token&query=test HTTP/1.1

The /search/ part is missing.

jakelumetta commented 2 years ago

We actually changed/normalized the URL for blog post search when we added search for pages: https://buttercms.com/docs/api/#search-pages

So this issue should really 1) update the url for blog post search and 2) add support for tapping into page search as well

martinalbert commented 1 year ago

@jakelumetta @ViolanteCodes this was fixed by https://github.com/ButterCMS/buttercms-java/commit/bfd47ade004b6e50ccf84188cc546ee1f34bf5db. Documentation contains incorrect API though.

ViolanteCodes commented 1 year ago

@martinalbert can you put in a PR to update the documentation?

ViolanteCodes commented 1 year ago

@martinalbert can you put in a PR to update the documentation?

Actually, sorry, can you point out where the documentation is incorrect?

martinalbert commented 1 year ago

@ViolanteCodes here in readme is mentioned getPostsSearch where as client contains getSearchPosts, same with getPageSearch in readme and getSearchPages in client

ViolanteCodes commented 1 year ago

@martinalbert thank you, i've opened an internal ticket :)