SAP Knowledge Base Article - Public

3637767 - Why Does the Case API Return Only Partial Results When Filtering by Account ID?

Symptom

  • When querying the Case API in SAP Sales & Service Cloud Version 2 using the following format:
    GET /sap/c4c/api/v1/case-service/cases?$filter=account.id eq <ACCOUNT_ID>
  • Only a subset of the expected case records is returned.
  • Known cases associated with the specified account may not appear in the initial response. 

Environment

  • SAP Service Cloud Version 2 1.0
  • SAP Sales Cloud Version 2 1.0 

Cause

  • Consulting

Resolution

  • Such behavior is due to server-side pagination enforced by the Case API:
    • The API limits the number of records returned per request, typically defaulting to 50 or 100 items.
    • To retrieve the complete result set, clients must use the $top and $skip query options for manual pagination.
  • Example Scenario (assuming there are 188 cases linked to an account):
    • Retrieving All 188 Matching Cases related to a specific account.
      1. To get the total count of matching cases related to the account:
        -> GET /sap/c4c/api/v1/case-service/cases/$count?$filter=account.id eq <ACCOUNT_ID>
      2. Retrieve the first 100 cases:
        -> GET /sap/c4c/api/v1/case-service/cases?$top=100&$filter=account.id eq <ACCOUNT_ID>
      3. Continue using $skip=200, $skip=300, etc., as needed, based on the total count.
    • Important:
      • The Case API does not support auto-pagination using @odata.nextLink.
      • Always include $count to determine the total number of records.
      • Ensure filter consistency across all paginated calls to avoid mismatches.

See Also

Keywords

sap service cloud version 2, api cases, missing cases, closed cases, api response, $top parameter, postman, insomnia, case-service, sap c4c, isIrrelevant filter, account.id filter, status filter, integration, cx service v2, sap api troubleshooting , KBA , CEC-CRM-CAS , Case Management for SAP Sales/Service Cloud , Problem

Product

SAP Service Cloud Version 2 all versions