1. U4 ERPx
  2. API Reference
  3. ObjectAPI
  4. Count

Count

Requesting the number of Enterprise Documents

To determine the number of Enterprise Documents that would be returned by a request, we can send a HEAD request (instead of the usual GET request), by using the same query parameters as our intended request would have, with the exception of limit and offset. Sending these two query parameters on a HEAD request would result in a 400 response, with the response header X-U4-Error: Offset and limit are not allowed for the HEAD operation.

The number of Enterprise Documents will be returned in the response header X-U4-TotalCount.

Sample

curl -X HEAD \
  "https://unit4-api-address/v1/objects/customers\
        ?companyId=EN\
        &select=companyId,customerId,customerName,invoice(creditLimit,currencyCode)\
        &filter=customerId eq '10000'" \
    -H "Authorization: Bearer YOUR_TOKEN_HERE" \
    -H "Accept-Encoding: gzip"