Pagination informations are stripped from php sdk search methods

Hello

I noticed that the pagination information mentionned in the api are not injected in responses from PHP SDK search methods.

This means that I need to retrive all pages to get the totalItems fetched in a query, and this will cause bad performance issues. How can I get these informations or is it possible to add it in the search methods ?

For example, i need to get the total views for a given video. How can i get juste the totalItems with the sdk ?

I opened an issue in your php sdk repository too on this subject.

thanks

This is a bug. You’re correct, this is not in the PHP SDK at the moment. We do have the SDK scheduled to be rewritten, and this will be resolved in the next version.

I think you’ll have to make each query until there are no more results. The API does accept page size and page number attributes, but the pagination is missing in the response.

Alternatively - you could use the API directly for these results.

Doug

Thanks for replying. This can cause really bad performance issues if we get thousands of views. Do you have a deadline for this fix from the sdk ? this would save us many dev costs.

Thanks.

I do not have a timeline for the SDK update, but it currently is on our 2021 roadmap, so it will not be terribly soon. If we simply add the pagination JSON to the response - it would break current implementations - so we have to be mindful on the fix :slight_smile:

one alternative (and Im the first to admit it is less than ideal) is to use the API to get the results + pagination that you require.

One of our dev suggested to add a new parameter to the search methods of the sdk to change the response format. The default value would be false, and if set to true, the response format should change to return the same datas as the documented API.

I think it should be easy for your dev to set it up and should not change the results for your clients actually using the bugged sdk.

Anyway in the meantime we will have to do without it.

Thanks for you answer, let me know if you can set it up earlier based on this suggestion. I think all your clients could be satisfied by this quickfix.