function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
SFDC RocksSFDC Rocks 

API: '.../chatter/feeds/record/' + caseId + '/feed-items' only returns the last feed items page

Using the Chatter REST API from Apex... when I request feed items for a case record using Apex code that looks like the below...


Http http = new Http();
HttpRequest request = new HttpRequest();
request.setEndpoint(this.server +  '/services/data/v23.0/chatter/feeds/record/' + caseId + '/feed-items');
request.setHeader('Authorization', 'OAuth ' + this.sessionId);
HttpResponse response = http.send(request);


In the JSON results, I am only getting the last page of the feed items and the nextPageUrl is always null.


If I append a '&pageSize=100' to the URL then I can get all of the feed items up to 100, but again I only get 1 page of results.


In one of my requests, I actually saw the "nextPageUrl' having a non-null value: this was once when I was not using the pageSize URL parameter, but it was intermittent.  Not sure why it showed me a value for just one call.


What I want to do is to be able to make multiple requests to get the first page, and then the second page, etc.


Does anyone have an example of Apex code that should work?  Or any clues on what I might be doing wrong?


Thomas CookThomas Cook

I think this is something that has been fixed. Can you try putting v24.0 in your URL and see if that works?