Last updated

Listing the approval data

The APIs below provide the approval data for an approver or a company.

Name Endpoint Details
List approval data for an approver/v3/approvals/approvers/{userId}/listRetrieve the list of approval data using the approver’s userId.

URL path requires: userId of the approver.

The request body can contain optional filter parameters. For example, filter by approval type, approval status, etc.

Response will contain: The list of approval data such as the approvalId, pnrId, tripId, approvalStatus, approvalType, approvalVoidDeadline, etc.

Note: The process PNR approval endpoint uses both approvalId and pnrId in the request.
List approval data for a company/v3/approvals/companies/{companyId}/listRetrieve the list of approval data using the companyId.

URL path requires: companyId of the company.

The request body can contain optional filter parameters. For example, filter by the approver's user ID, approval type, approval status, etc.

Response will contain: The list of approval data such as the approvalId, pnrId, tripId, approvalStatus, approvalType, approvalVoidDeadline, etc.

Other APIs will use: approvalId and pnrId

Filters for listing approval data

Both of the list approval data endpoints allow you to filter the approval data results using specific parameters. The request schema of the approvalFilters > filterType field contains the following filters.

Filters Description
APPROVER_USER_ID_FILTERFilter by userId of the approvers.

Note: This filter is only applicable for the list approval data for a company endpoint.
APPROVAL_TYPE_FILTERFilter by approval types.
APPROVAL_STATUS_FILTERFilter by approval statuses.
APPROVAL_DEADLINE_DATE_RANGE_FILTERFilter by the approval deadlines. For this filter, specify the date range (using the startDate and endDate) within which the deadline occurs.
PRIMARY_TRAVELER_ID_FILTERFilter by travelers. Specify the list of traveler userIDs for which to retrieve the approval data.
PNR_TYPE_FILTERFilter by booking type (e.g., air, hotel, rail, car, limo, or miscellaneous).
OUT_OF_POLICY_FILTERFilter by out-of-policy bookings.

If the OUT_OF_POLICY_FILTER is set to true, the results will only contain out-of-policy approvals.

If the OUT_OF_POLICY_FILTER is false, the results will contain the approvals that are within the policy.
TRIP_ID_FILTERFilter by specific trip IDs.

Note: Since the approvalFilters field is an array object, you can combine two or more filters in the API request. For example, the request can contain both APPROVER_USER_ID_FILTER and APPROVAL_TYPE_FILTER. The response will contain the approval data that matches the approver user IDs and approval type mentioned in the request.

Pagination

You can use pagination when listing the approval data. Use the paginationRequestParams > offset and limit fields to paginate the approval data in the results.

For example, assume you need to display a list of 75 approval data items per page.

  1. In the first API call, set the offset to 0 and limit to 75. This will return the first 75 approval data items.
  2. In the second API call, set the offset to 75 and limit to 75. This will return the next list of 75 approval data items.

Notes:

  • The limit field can contain an integer value between 1 and 100. This means a maximum of 100 approval data items can be returned in a single API call.
  • The paginationRequestParams is an optional field. If the offset and limit fields are not specified in the request, a default value of offset: 0 and limit: 100 will be set.