helpscout / helpscout-api-php

PHP Wrapper for the Help Scout API
MIT License
98 stars 62 forks source link

Unable to fetch all threads for specific conversation if threads are more than 25 #269

Closed arbind-ladybird closed 3 years ago

arbind-ladybird commented 3 years ago

Thank you for taking the time to submit an issue with all the details shown below. Our engineering team monitors issues submitted and strives to respond with 1-2 business days.

Current behavior when trying to fetch all threads related to a specific conversation, we are getting only 25 threads by using $conversation->getThreads(). What about next threads if more than 25 threads are associated.

Expected behavior It should return all threads and on github document it should be mentioned

Steps to reproduce

  1. ..

bkuhl commented 3 years ago

Hey,

Thanks for reaching out. I apologize about the delayed response but we'll jump right in here! $conversation->getThreads() will only provide the first page of results and only if those threads are eager loaded and is not paginate-able. If you need to support pagination, I'd suggest using $conversation->threads()->list($conversation->getid()) as that will provide you a PagedCollection and access to be able to easily paginate results. There's some examples of working with pagination in this section of the docs.

We're happy to help if you run into any trouble!

arbind-ladybird commented 3 years ago

Thanks for your response. I will try the way you suggested.

On Wed, Apr 7, 2021, 22:04 Ben Kuhl @.***> wrote:

Closed #269 https://github.com/helpscout/helpscout-api-php/issues/269.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/helpscout/helpscout-api-php/issues/269#event-4563601757, or unsubscribe https://github.com/notifications/unsubscribe-auth/ARD3GQMCMCZCZCQIJ75FGPDTHSCR3ANCNFSM42BJNLJA .