All API resources have support for bulk fetches via "list" API methods. For instance, you can list
booking-pages, and list
event-types. These list API methods share a common structure, using at least these three parameters:
Oncehub utilizes cursor-based pagination by making use of the
before parameters. Both parameters take an existing object ID value (see below) and return objects in reverse chronological order. The
before parameter returns objects listed before the named object. The
after parameter returns objects listed after the named object. These parameters are mutually exclusive - only one of
before may be used.
To retrieve the next page of results, you can use the
after parameter with the object ID of the last object that was returned in the list.
To retrieve the previous page of results, you can use the
before parameter with the object ID of the first object that was returned in the list.
limit parameter determines the number of objects that will be returned on each page. The
limit will default to 10 if not specified and has a maximum limit of 100 objects per page.
The Link header includes a
rel parameter, where relation-types describes the relation of the linked page to the current page of results. The value can either be
If your initial request doesn't return enough records to generate an additional page of results, then the response won't have a link header.
Link: <https://api.oncehub.com/bookings?after=BKNG-22RN37EED5WS&limit=10>; rel="next", <https://api.oncehub.com/bookings?before=BKNG-D3EYIES69QMH&limit=10>; rel="previous"
The example includes a line break for readability.
The URL in the link header can include up to three parameters:
limit: A limit on the number of objects to be returned, between 1 and 100. Defaults to 10.
after: An object ID that defines your place in the list. For instance, if you make a list request and receive 30 objects, ending with
OBJ-XXXX, your subsequent call can include
after=OBJ-XXXXin order to fetch the next page of the list.
before: An object ID that defines your place in the list. For instance, if you make a list request and receive 30 objects, starting with
OBJ-YYYY, your subsequent call can include
before=OBJ-YYYYin order to fetch the previous page of the list.
Linkheader to easily traverse the list of results.