Skip to content

API - PPR / MHR Search History Table Fitering #30004

Closed

Description

@LizGovier

Add any combination of account search history table filtering for:

  • Search Timestamp request parameter names: startDateTime, endDateTime
  • Search Type request parameter name: type
  • Search Criteria request parameter name: criteria
  • Client Reference ID (Folio) request parameter name: clientReferenceId
  • Username request parameter name: username

Note: when searching on PPR individual debtor or MHR individual owner the criteria format is "firstName lastName".

PPR Search Types:
AIRCRAFT_DOT
BUSINESS_DEBTOR,
INDIVIDUAL_DEBTOR,
MHR_NUMBER,
REGISTRATION_NUMBER,
SERIAL_NUMBER
MHR Search Types:
MHR_OWNER_NAME
MHR_ORGANIZATION_NAME
MHR_MHR_NUMBER
MHR_SERIAL_NUMBER

Sorting uses the sortCriteriaName and sortDirection request parameters.
sortCriteriaName can be one of: searchDateTime, clientReferenceId, username, type, criteria
sortDirection can be one of: ascending, descending

When filtering by criteria, type should also be provided.

Partial matching rules are in the UX design.

Activity

  1. LizGovier commented on Aug 7, 2025

    @LizGovier
    Author
  2. changed the title [-]API - PPR / MHR Search History Table[/-] [+]API - PPR / MHR Search History Table Fitering[/+] on Aug 7, 2025
  3. self-assigned this
    on Aug 15, 2025
  4. doug-lovett commented on Aug 20, 2025

    @doug-lovett
    Collaborator

    Request exampes:

    /ppr/api/v1/search-history?username=Bowler
    /ppr/api/v1/search-history?clientReferenceId=8129482&sortCriteriaName=clientReferenceId&sortDirection=ascending
    /ppr/api/v1/search-history?type=SERIAL_NUMBER&sortCriteriaName=searchDateTime&sortDirection=ascending
    /ppr/api/v1/search-history?startDateTime=2025-08-07&endDateTime=2025-08-07&sortCriteriaName=searchDateTime&sortDirection=descending
    /ppr/api/v1/search-history?type=MHR_OWNER_NAME&criteria=hamm&sortCriteriaName=searchDateTime&sortDirection=ascending
    /ppr/api/v1/search-history?type=BUSINESS_DEBTOR&criteria=imran&sortCriteriaName=searchDateTime&sortDirection=ascending
    /ppr/api/v1/search-history?type=INDIVIDUAL_DEBTOR&criteria=jack+pollock&sortCriteriaName=searchDateTime&sortDirection=ascending

  5. chdivyareddy commented on Aug 21, 2025

    @chdivyareddy
    Collaborator

    Hey @doug-lovett , just verified using Postman with MHR and noted that all the request examples provided above gives the same response for the requests. Please take a look, thanks!

    /mhr-dev/api/v1/search-history?type=SERIAL_NUMBER&sortCriteriaName=searchDateTime&sortDirection=ascending

    Here the request type is Serial Number, but the response includes all the search types including serial number and this happens with all other requests.

    image.png

  6. doug-lovett commented on Aug 21, 2025

    @doug-lovett
    Collaborator

    @chdivyareddy are you going to DEV? When I submit:
    GET https://test.api.connect.gov.bc.ca/ppr-dev/api/v1/search-history?type=SERIAL_NUMBER&criteria=123&sortCriteriaName=criteria&sortDirection=ascending
    The response is:

    [
      {
        "exactResultsSize": 3,
        "returnedResultsSize": 29,
        "searchDateTime": "2025-08-14T17:38:14+00:00",
        "searchHistoryTotal": 45,
        "searchId": "15917",
        "searchQuery": {
          "clientReferenceId": "",
          "criteria": {
            "value": "123"
          },
          "type": "SERIAL_NUMBER"
        },
        "selectedResultsSize": 0,
        "totalResultsSize": 29,
        "username": "Cameron Bowler"
      },
      {
        "exactResultsSize": 0,
        "returnedResultsSize": 4,
        "searchDateTime": "2025-08-13T18:03:33+00:00",
        "searchId": "15904",
        "searchQuery": {
          "certified": true,
          "clientReferenceId": "",
          "criteria": {
            "value": "12345"
          },
          "type": "SERIAL_NUMBER"
        },
        "selectedResultsSize": 4,
        "totalResultsSize": 4,
        "username": "BUSINESS REGISTRY TEST 1"
      },
      {
        "exactResultsSize": 0,
        "returnedResultsSize": 4,
        "searchDateTime": "2025-08-13T19:10:40+00:00",
        "searchId": "15905",
        "searchQuery": {
          "certified": true,
          "clientReferenceId": "",
          "criteria": {
            "value": "12345"
          },
          "type": "SERIAL_NUMBER"
        },
        "selectedResultsSize": 0,
        "totalResultsSize": 4,
        "username": "BUSINESS REGISTRY TEST 1"
      },
      {
        "exactResultsSize": 0,
        "returnedResultsSize": 4,
        "searchDateTime": "2025-08-13T19:11:37+00:00",
        "searchId": "15906",
        "searchQuery": {
          "certified": true,
          "clientReferenceId": "",
          "criteria": {
            "value": "12345"
          },
          "type": "SERIAL_NUMBER"
        },
        "selectedResultsSize": 0,
        "totalResultsSize": 4,
        "username": "BUSINESS REGISTRY TEST 1"
      },
      {
        "exactResultsSize": 0,
        "returnedResultsSize": 4,
        "searchDateTime": "2025-08-13T19:13:30+00:00",
        "searchId": "15907",
        "searchQuery": {
          "clientReferenceId": "",
          "criteria": {
            "value": "12345"
          },
          "type": "SERIAL_NUMBER"
        },
        "selectedResultsSize": 4,
        "totalResultsSize": 4,
        "username": "BUSINESS REGISTRY TEST 1"
      },
      {
        "exactResultsSize": 0,
        "returnedResultsSize": 4,
        "searchDateTime": "2025-08-13T19:24:06+00:00",
        "searchId": "15908",
        "searchQuery": {
          "certified": true,
          "clientReferenceId": "",
          "criteria": {
            "value": "12345"
          },
          "type": "SERIAL_NUMBER"
        },
        "selectedResultsSize": 4,
        "totalResultsSize": 4,
        "username": "BUSINESS REGISTRY TEST 1"
      },
      {
        "exactResultsSize": 0,
        "returnedResultsSize": 4,
        "searchDateTime": "2025-08-13T19:24:36+00:00",
        "searchId": "15909",
        "searchQuery": {
          "clientReferenceId": "",
          "criteria": {
            "value": "12345"
          },
          "type": "SERIAL_NUMBER"
        },
        "selectedResultsSize": 4,
        "totalResultsSize": 4,
        "username": "BUSINESS REGISTRY TEST 1"
      },
      {
        "exactResultsSize": 0,
        "returnedResultsSize": 4,
        "searchDateTime": "2025-08-13T20:09:16+00:00",
        "searchId": "15911",
        "searchQuery": {
          "clientReferenceId": "",
          "criteria": {
            "value": "12345"
          },
          "type": "SERIAL_NUMBER"
        },
        "selectedResultsSize": 4,
        "totalResultsSize": 4,
        "username": "BUSINESS REGISTRY TEST 1"
      },
      {
        "exactResultsSize": 0,
        "returnedResultsSize": 4,
        "searchDateTime": "2025-08-13T20:11:11+00:00",
        "searchId": "15914",
        "searchQuery": {
          "clientReferenceId": "",
          "criteria": {
            "value": "12345"
          },
          "type": "SERIAL_NUMBER"
        },
        "selectedResultsSize": 4,
        "totalResultsSize": 4,
        "username": "BUSINESS REGISTRY TEST 1"
      },
      {
        "exactResultsSize": 0,
        "returnedResultsSize": 4,
        "searchDateTime": "2025-08-13T18:02:25+00:00",
        "searchId": "15902",
        "searchQuery": {
          "clientReferenceId": "",
          "criteria": {
            "value": "12345"
          },
          "type": "SERIAL_NUMBER"
        },
        "selectedResultsSize": 4,
        "totalResultsSize": 4,
        "username": "BUSINESS REGISTRY TEST 1"
      },
      {
        "exactResultsSize": 0,
        "returnedResultsSize": 4,
        "searchDateTime": "2025-08-19T16:16:18+00:00",
        "searchId": "15926",
        "searchQuery": {
          "clientReferenceId": "91824981294812948243931829489124882149812948912489",
          "criteria": {
            "value": "12345"
          },
          "type": "SERIAL_NUMBER"
        },
        "selectedResultsSize": 4,
        "totalResultsSize": 4,
        "username": "BUSINESS REGISTRY TEST 1"
      }
    ]
    

    Note: https://test.api.connect.gov.bc.ca/ppr/* is TEST.

  7. chdivyareddy commented on Aug 21, 2025

    @chdivyareddy
    Collaborator

    @doug-lovett PPR Search filtering works as expected, I was talking about MHR searches as this ticket includes both PPR and MHR searches, my understanding was this was updated for both, but I still see issue with MHR search filtering in DEV.

  8. doug-lovett commented on Aug 21, 2025

    @doug-lovett
    Collaborator

    @chdivyareddy are you using the ppr endpoint? The UI account search history table gets PPR and MHR search results in a single call from the ppr endpoint.
    GET https://test.api.connect.gov.bc.ca/ppr-dev/api/v1/search-history?type=MHR_OWNER_NAME&criteria=hamm&sortCriteriaName=searchDateTime&sortDirection=ascending

    Returns a handful of results.

  9. chdivyareddy commented on Aug 21, 2025

    @chdivyareddy
    Collaborator

    @doug-lovett Ah...Sorry, my bad. I was using MHR endpoint for the MHR searches. All good now, thanks for clarifying:)

    Verified in DEV!

    image.png

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions