Skip to main content

How filtering works

Learn how to filter and sort results using date ranges and parameters.

The API supports filtering results using various query parameters. You can filter by date ranges, sort order, and combine multiple parameters to get exactly the data you need.

Common filtering examples

All data for a campaign in descending order (most recent first)

To retrieve all campaign results sorted by the most recent first, pass the sort parameter with the value desc. This is ideal for displaying the latest results at the top of your dashboard or reports. Parameters:
  • campaign_id=123e4567-e89b-12d3-a456-426614174000 - The specific campaign to retrieve results for
  • sort=desc - Sort results in descending order (newest to oldest)
curl -G https://api.external.hirednow.ai/v1/campaigns/results \
  -H "Authorization: Bearer <YOUR_API_KEY>" \
  -d campaign_id=123e4567-e89b-12d3-a456-426614174000 \
  -d sort=desc

All data for a campaign in ascending order (oldest first)

To retrieve all campaign results sorted from oldest to newest, pass the sort parameter with the value asc. This is useful for processing historical data chronologically or performing incremental syncs. Parameters:
  • campaign_id=123e4567-e89b-12d3-a456-426614174000 - The specific campaign to retrieve results for
  • sort=asc - Sort results in ascending order (oldest to newest)
curl -G https://api.external.hirednow.ai/v1/campaigns/results \
  -H "Authorization: Bearer <YOUR_API_KEY>" \
  -d campaign_id=123e4567-e89b-12d3-a456-426614174000 \
  -d sort=asc

Data before a specific date

To get all results up to a certain date, use the end_date parameter. This will return all data from the beginning up to and including the specified date. Combine with sort=desc to see the most recent data within that range first. Parameters:
  • campaign_id=123e4567-e89b-12d3-a456-426614174000 - The specific campaign to retrieve results for
  • end_date=2024-01-01 - Return data up to and including January 1, 2024
  • sort=desc - Show most recent results first within the date range
curl -G https://api.external.hirednow.ai/v1/campaigns/results \
  -H "Authorization: Bearer <YOUR_API_KEY>" \
  -d campaign_id=123e4567-e89b-12d3-a456-426614174000 \
  -d end_date=2024-01-01 \
  -d sort=desc

Data after a specific date

To get all results from a specific date onwards, use the start_date parameter. This will return all data from the specified date through the current date. Perfect for getting recent data or data since a last sync point. Parameters:
  • campaign_id=123e4567-e89b-12d3-a456-426614174000 - The specific campaign to retrieve results for
  • start_date=2024-06-01 - Return data from June 1, 2024 onwards
  • sort=desc - Show most recent results first
curl -G https://api.external.hirednow.ai/v1/campaigns/results \
  -H "Authorization: Bearer <YOUR_API_KEY>" \
  -d campaign_id=123e4567-e89b-12d3-a456-426614174000 \
  -d start_date=2024-06-01 \
  -d sort=desc

Data between two dates in descending order

To get results for a specific date range with the most recent first, use both start_date and end_date parameters along with sort=desc. This is ideal for generating reports for a specific time period. Parameters:
  • campaign_id=123e4567-e89b-12d3-a456-426614174000 - The specific campaign to retrieve results for
  • start_date=2024-07-01 - Start of the date range (July 1, 2024)
  • end_date=2024-09-30 - End of the date range (September 30, 2024)
  • sort=desc - Show most recent results first within the range
curl -G https://api.external.hirednow.ai/v1/campaigns/results \
  -H "Authorization: Bearer <YOUR_API_KEY>" \
  -d campaign_id=123e4567-e89b-12d3-a456-426614174000 \
  -d start_date=2024-07-01 \
  -d end_date=2024-09-30 \
  -d sort=desc

Data between two dates in ascending order

To get results for a specific date range in chronological order, use both start_date and end_date parameters with sort=asc. This is useful for processing data sequentially or building time-series visualizations. Parameters:
  • campaign_id=123e4567-e89b-12d3-a456-426614174000 - The specific campaign to retrieve results for
  • start_date=2024-07-01 - Start of the date range (July 1, 2024)
  • end_date=2024-09-30 - End of the date range (September 30, 2024)
  • sort=asc - Show oldest results first within the range
curl -G https://api.external.hirednow.ai/v1/campaigns/results \
  -H "Authorization: Bearer <YOUR_API_KEY>" \
  -d campaign_id=123e4567-e89b-12d3-a456-426614174000 \
  -d start_date=2024-07-01 \
  -d end_date=2024-09-30 \
  -d sort=asc

Advanced filtering examples

Month-end reporting

For comprehensive monthly reports, combine date range filtering with a higher result limit. Set both start_date and end_date to the first and last day of the month, use sort=desc to show recent activity first, and increase the limit to retrieve more results per page. Parameters:
  • campaign_id=123e4567-e89b-12d3-a456-426614174000 - The specific campaign to retrieve results for
  • start_date=2024-09-01 - First day of the month (September 1, 2024)
  • end_date=2024-09-30 - Last day of the month (September 30, 2024)
  • sort=desc - Show most recent results first
  • limit=100 - Retrieve up to 100 results per page (default is 20)
curl -G https://api.external.hirednow.ai/v1/campaigns/results \
  -H "Authorization: Bearer <YOUR_API_KEY>" \
  -d campaign_id=123e4567-e89b-12d3-a456-426614174000 \
  -d start_date=2024-09-01 \
  -d end_date=2024-09-30 \
  -d sort=desc \
  -d limit=100

Incremental data sync

For syncing new data since your last fetch, filter by a specific campaign and start date. Use sort=asc to process results chronologically, starting from your last sync point. The higher limit ensures you can fetch more data in a single request. Parameters:
  • campaign_id=123e4567-e89b-12d3-a456-426614174000 - Filter to a specific campaign
  • start_date=2024-10-20 - Only fetch data from October 20, 2024 onwards
  • sort=asc - Process data chronologically from oldest to newest
  • limit=100 - Fetch more results per page to reduce number of API calls
curl -G https://api.external.hirednow.ai/v1/campaigns/results \
  -H "Authorization: Bearer <YOUR_API_KEY>" \
  -d campaign_id=123e4567-e89b-12d3-a456-426614174000 \
  -d start_date=2024-10-20 \
  -d sort=asc \
  -d limit=100

Single day’s data

To retrieve all results for a specific day, set both start_date and end_date to the same date. This is useful for daily reports or investigating activity on a particular date. Combine with campaign_id to narrow down to a specific campaign. Parameters:
  • campaign_id=123e4567-e89b-12d3-a456-426614174000 - Filter to a specific campaign
  • start_date=2024-10-15 - Target date (October 15, 2024)
  • end_date=2024-10-15 - Same as start_date to get only this day’s data
curl -G https://api.external.hirednow.ai/v1/campaigns/results \
  -H "Authorization: Bearer <YOUR_API_KEY>" \
  -d campaign_id=123e4567-e89b-12d3-a456-426614174000 \
  -d start_date=2024-10-15 \
  -d end_date=2024-10-15

Parameters

sort
string
default:"asc"
Sort order for results. Use asc for ascending order (oldest first) or desc for descending order (most recent first).
start_date
string
Filter results to include only data from this date onwards. Format: YYYY-MM-DD
end_date
string
Filter results to include only data up to and including this date. Format: YYYY-MM-DD
campaign_id
string
Filter results to a specific campaign by providing the campaign UUID.
limit
integer
default:"10"
A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 20.

Tips

  • Combine start_date and end_date to get data for a specific date range
  • Use sort=desc for the most recent data first, which is useful for dashboards and reporting
  • Use sort=asc for incremental syncs to process data in chronological order
  • Set start_date and end_date to the same value to get data for a single day