LinkedIn organizationalEntityAcls API分页详情异常及响应情况问询
Hey there, I’ve helped a handful of developers work through pagination quirks with LinkedIn’s organizationalEntityAcls API lately, and I recognize exactly the issue you’re hitting. Let’s break down the pagination behavior I’ve observed, along with fixes to get the full pagination details you need:
Scenario 1: Default Pagination Without the projections Parameter
When you call the endpoint without including a projections parameter, you’ll get a minimal default response that lacks actionable pagination navigation links. Here’s a concrete example:
Request
https://api.linkedin.com/v2/organizationalEntityAcls?q=roleAssignee&oauth2_access_token=XXX
Response
{ "elements": [ { "role":"ADMINISTRATOR", "roleAssignee":"urn:li:person:xxxxx", "state":"APPROVED", "organizationalTarget":"urn:li:organization:yyyyy" } ], "paging":{ "count":10, "start":0, "links":[] } }
Notice the empty links array here—this is why you can’t navigate to subsequent pages using the default response.
Scenario 2: Pagination with Explicit projections Parameter (The Fix)
To pull full pagination details (including the links needed to fetch next/previous pages), you need to explicitly define a projections parameter that includes the paging object and its nested fields. Here’s how to adjust your request:
Updated Request
https://api.linkedin.com/v2/organizationalEntityAcls?q=roleAssignee&oauth2_access_token=XXX&projections=(elements*(role,roleAssignee,state,organizationalTarget),paging*(count,start,links))
Expected Response
The paging section will now include populated links with ready-to-use URLs to navigate between result pages, like this:
{ "elements": [/* Your result elements */], "paging":{ "count":10, "start":0, "links":[ { "rel":"next", "href":"https://api.linkedin.com/v2/organizationalEntityAcls?q=roleAssignee&start=10&count=10&oauth2_access_token=XXX", "type":"application/json" } ] } }
The core issue here is that LinkedIn’s API requires you to explicitly request the pagination fields you need via projections—it won’t return them by default, even if there are additional results available.
内容的提问来源于stack exchange,提问作者raji

