Employee API
...
Endpoints
Elasticsearch DSL

Pagination

11min

Pagination information for the /v1/professional_network/employee/search/es_dsl endpoint.

Shortcuts

Overview

Profile IDs are provided in batches of 1000 IDs per page.

Sometimes, a request might yield more IDs than can be displayed on a single page. In such situations, you'll need to use pagination to obtain all the requested IDs from the POST request.

Where can I see the page count?

Response headers will contain information such as the total result count, page number, and the last ID on the page.

Response header information you need to look for:

Example

  • x-next-page-afterdisplays the last ID on the page.
  • x-total-pages lists the total number of pages with ID results.
  • x-total-resultsshows the total number of IDs returned by your search.

Using pagination in cURL requests

This tutorial requires prior knowledge of how to compile POST requests in Employee API.

Elasticsearch DSL endpoint

Use parameterx-next-page-after to retrieve a second page of IDs.

  1. Navigate to the Headers section to the right of the (response) Body:
Document image


2. Click on the Headers section.

You will need information from x-next-page-after , x-total-pages, and x-total-results lines.

Document image

  • x-next-page-after displays the last ID on the page.
  • x-total-pages lists the total number of pages with ID results.
  • x-total-resultsshows the total number of IDs returned by your search.

3. Add parameter ?after={last_ID} to the POST request to see the next results page. 4. Execute the request, and you will see the next page in the Body section.

Pagination using sorting

Pagination, when sorting by ID, works the same way as pagination without sorting.

All personal/company information mentioned within this context is entirely fictional and is solely intended for illustrative purposes.

  1. Add parameter ?after={last_ID} to the POST request: Refer to the pagination example for the exact parameter placement:
Pagination (sorted by id)


Send the request, and you will see the next page in the (Response) Body.



Pagination using ID sorting works the same way as pagination without sorting. Pagination using score sorting has a different ID format. The format difference is seen by the x-next-page-after parameter.

The number preceding the comma is for the score, and the one after the score - is the last ID on the page.

Document image


Add parameter ?after={last_ID} to the POST request to see the next results page. Refer to the pagination example for the exact parameter placement:

Pagination (sorted by score)


Send the request, and you will see the next page in the (Response) Body.