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}/list | Retrieve 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}/list | Retrieve 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_FILTER | Filter by userId of the approvers.Note: This filter is only applicable for the list approval data for a company endpoint. |
APPROVAL_TYPE_FILTER | Filter by approval types. |
APPROVAL_STATUS_FILTER | Filter by approval statuses. |
APPROVAL_DEADLINE_DATE_RANGE_FILTER | Filter by the approval deadlines. For this filter, specify the date range (using the startDate and endDate ) within which the deadline occurs. |
PRIMARY_TRAVELER_ID_FILTER | Filter by travelers. Specify the list of traveler userIDs for which to retrieve the approval data. |
PNR_TYPE_FILTER | Filter by booking type (e.g., air, hotel, rail, car, limo, or miscellaneous). |
OUT_OF_POLICY_FILTER | Filter 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_FILTER | Filter 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 bothAPPROVER_USER_ID_FILTER
andAPPROVAL_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.
- In the first API call, set the
offset
to0
andlimit
to75
. This will return the first 75 approval data items. - In the second API call, set the
offset
to75
andlimit
to75
. This will return the next list of 75 approval data items.
Notes:
- The
limit
field can contain an integer value between1
and100
. This means a maximum of 100 approval data items can be returned in a single API call.- The
paginationRequestParams
is an optional field. If theoffset
andlimit
fields are not specified in the request, a default value ofoffset: 0
andlimit: 100
will be set.