About Paginating Event Management API Responses

You can paginate Event Management API responses for some endpoints to manage the amount of information returned.

Client-Side Pagination ($top and $skip Query Parameters)

You can control the number of objects and which objects are available to your client using the $top and $skip query parameters for the following endpoints:

  • GET /events/{eventId}/supplierInvitations

  • GET /events/{eventId}/scenarios

  • GET /events/{eventId}/rules

  • GET /events/{eventId}/messages

  • GET /events/{eventId}/auditLogs

  • GET /events/{eventId}/rounds/{roundNumber}/supplierInvitations

The $top query parameter specifies the maximum number of objects to return. The $skip query parameter specifies the number of objects to skip; if not specified, no objects are skipped and the response starts with the first object.

For example, you could send a GET /events/{eventId}/supplierInvitations request with the query parameter $top=5, then send a request with the query parameters $top=5 and $skip=5. In subsequent requests, you would increment the $skip value by the previous $top value ($skip=10, $skip=15, etc.).

Server-Side Pagination (maxPageSize HTTP Preference Header)

You can request the maximum number of objects that the Event Management API server returns in an HTTP response by including the maxPageSize HTTP Prefer header for the following requests:

  • GET /events/{eventId}/items

  • GET /events/{eventId}/items/pages/{pageNumber}

  • GET /events/{eventId}/supplierBids

  • GET /events/{eventId}/supplierBids/pages/{pageNumber}

  • GET /events/{eventId}/supplierBids/{invitationId}/pages/{pageNumber}

  • GET /events/{eventId}/rounds/{roundNumber}/items

  • GET /events/{eventId}/rounds/{roundNumber}/supplierBids

  • GET /events/{eventId}/rounds/{roundNumber}/supplierBids/{invitationId}

  • GET /events/{eventId}/awards

  • GET /events/{eventId}/awards/pages/{pageNumber}

You specify maxPageSize in the HTTP request header using the following syntax:

prefer: maxPageSize=nn

Where:
  • nn is the maximum number of items for which objects are returned in each page of the response. The default and maximum value for nn is 50.
  • maxPageSize indicates the number of items to be processed for the response. For supplierBids APIs, maxPageSize can return more than the specified number of objects. For example, if there are five suppliers and 100 items, there can be 500 supplierBids objects since each supplier has bid on each item. If maxPageSize is ten, API fetches supplier bids of the first ten items for page 1, the following ten items for page 2, and so on. Therefore, the response can have up to 10 items x 5 suppliers = 50 supplierBids objects on each page instead of 10 objects.

The response contains the following headers:

Preference-Applied: maxPageSize=nn

Link: links

Where:
  • nn is the number of objects returned in the response
  • links are URLs to specify the "related" previous and next pages of responses
For example, Link can contain the following URLs:
<https://xzy.ariba.com/Sourcing/sourcing-event/v2/events/Doc12345/items/pages/1?user=someuser
&passwordAdapter=PasswordAdapter1&realm=mySitedata&FetchMode=detail&showTotal=true>; rel="previous",
				
<https://xyz.ariba.com/Sourcing/sourcing-event/v2/events/Doc12345/items/pages/3?user=someuser
&passwordAdapter=PasswordAdapter1&realm=mySite&dataFetchMode=detail&showTotal=true>; rel="next	
		

When the response contains the last page of information, the link for the next page (rel="next") is absent; when the response contains the first page of information, the link for the previous page (rel="previous") is absent.