Open Krina opened 9 years ago
@Krina
The maximum value allowed for page_size is 100. No individual request should ever return more than 100 items. Can you post the code here?
Robert
Hi Robert,
Please find below code
// Make our API call $videos = $bc->find('allVideos'); // Determine how many possible results there are echo 'Total Videos: ' . $bc->total_count . '
'; # Only return ID and Tags data $params = array( 'page_size' => '150', 'get_item_count' => 'FALSE', 'video_fields' => 'id,name,shortDescription,videoStillURL,tags,thumbnailURL,length,playsTotal,playsTrailingWeek,FLVURL', 'get_item_count' => 'FALSE', 'media_delivery' => 'http', 'sort_by' => 'PUBLISH_DATE', 'sort_order' => 'DESC', ); // Make our API call $videos = $bc->findall('video',$params); print_r($videos); exit();
Above code display 1087 items
this code:
// Determine how many possible results there are
echo 'Total Videos: ' . $bc->total_count . '
';
is displaying the total number of videos in the account -- that is not the number that is being returned by the API request.
No, When I print the array it shows me 1086 items. Can you please tell me how I can add pagination.
As I said, the maximum page_size is 100, but we recommend using 25 for better performance. So:
$params = array(
'page_size' => 25,
'page_number' => 4,
page_number is 0 based, so this would give you the 5th set of 25 videos
I have set 'page_size' => '150' as parameter but it loads all data instead of loading only 150 data.
page_size not affect to result.
Can you please help me how to do this?
Thnaks, Krina