You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
What Problem Does This Solve?
As the number of officers in the database expands, we need to do two things:
Prevent the Get All Officers API endpoint from taking an excessive amount of time to respond
Enable a user to narrow down the list of officers returned to help them find the individuals they're looking for.
This will impact API user of all stripes, including those who use the Web UI. The UX Updates that are planned for the front end will require these enhancements.
Describe the solution you'd like
To solve this, we should add some filtering to the Get All Officers endpoint. The filters that should be enabled have been defined in the most recent OAS Specification found here.
The required filters are as follows:
Active After: Filter officers who were active after this date. The date should be in the format YYYY-MM-DD.
Active Before: Filter officers who were active before this date. The date should be in the format YYYY-MM-DD.
Agency: Filter officers by the agency they are employed by. The value should be a comma-separated list of agency uids.
Rank: Filter officers by their rank. The value should be a comma-separated list of ranks.
Unit: Filter officers by their unit. The value should be a comma-separated list of unit uids.
Name: Filter officers by their name. The value should be a string in the format "first middle last suffix".
Ethnicity: Filter officers by their ethnicity. The value should be a comma-separated list of ethnicities.
Badge Number: Filter officers by their badge number. The value should be a comma-separated list of badge numbers.
Each of these values should be able to be included as Query Parameters when making a request the the API.
Example:
curl --request GET \
--url 'https://dev.nationalpolicedata.org/api/v1/officers?active_before=2023-01-15' \
--header 'accept: application/json'
Additional context
The Readme Documentation provides a detailed description of how the endpoint should work after this update. Get Officers
The text was updated successfully, but these errors were encountered:
What Problem Does This Solve?
As the number of officers in the database expands, we need to do two things:
Get All Officers
API endpoint from taking an excessive amount of time to respondThis will impact API user of all stripes, including those who use the Web UI. The UX Updates that are planned for the front end will require these enhancements.
Describe the solution you'd like
To solve this, we should add some filtering to the
Get All Officers
endpoint. The filters that should be enabled have been defined in the most recent OAS Specification found here.The required filters are as follows:
Each of these values should be able to be included as Query Parameters when making a request the the API.
Example:
Additional context
The Readme Documentation provides a detailed description of how the endpoint should work after this update.
Get Officers
The text was updated successfully, but these errors were encountered: