BreezeChMS / breeze-api-v1

The Breeze API v1 allows you to build custom applications integrated with the Breeze database.
https://www.breezechms.com/api
5 stars 3 forks source link

api/people with details=1 returns different results for details if filter_json is included or not #7

Open cgmcgavern opened 2 years ago

cgmcgavern commented 2 years ago

When querying people (https://yoursubdomain.breezechms.com/api/people), I'm getting different results when ?details=1 (or True) depending on whether or not I include the filter_json. Details with unfiltered results look substantially different from details with filtered results. There is much more detail when the filter is not used than when the filter is used. And how the details are organized is different to (e.g. there is a nested ‘details’ key within a ‘details’ key when the results are fixed whereas there is only one ‘details’ key in unfiltered results). I have to handle the returned json differently depending on whether or not I’ve filtered the results.

For the project I'm working on presently, the details I need are in both filtered and unfiltered results. But, I have to handle the JSON's differently. Is anyone else seeing this behavior?

Example:

https://yoursubdomain.breezechms.com/api/people?details=1&filter_json={"200013805":"1-2}

filtered yields: {'id': '12345678', 'first_name': 'Jean', 'force_first_name': 'Jean', 'nick_name': '', 'middle_name': '', 'maiden_name': '', 'last_name': 'Smith', 'thumb_path': '', 'path': 'img/profiles/generic/gray.png', 'details': {'id': '12307894', 'first_name': 'Jean', 'force_first_name': 'Jean', 'nick_name': '', 'middle_name': '', 'maiden_name': '', 'last_name': 'Smith', 'thumb_path': '', 'path': 'img/profiles/generic/gray.png', 'details': {'phone_field_id': 663467676, 'home': '(281) 555-1212', 'email_primary_field_id': 3214569896, 'email_primary': '', 'address_field_id': 7899877899, 'street_address': '1234 Coral Ridge Ln', 'city': 'Denver', 'state': 'MO', 'zip': '12345-3456', 'longitude': '-##.#####', 'latitude': '##.######', 'birthdate_field_id': 187243342, 'birthdate': '1945-01-01', 'age_years': '76', 'age_months': '9', 'age_days': '16'}}}

verses without the filter, many more detail and a different

https://yoursubdomain.breezechms.com/api/people?details=1

unfiltered yields: {'id': '12345678', 'first_name': 'Jean', 'force_first_name': 'Jean', 'last_name': 'Smith', 'nick_name': '', 'middle_name': '', 'maiden_name': '', 'path': 'img/profiles/generic/gray.png', 'details': {'person_id': '1234567', '3216549878': 'Jean Smith', 'single_line': '', '7896456234': 'Museum Director', '4567896541': '3-1', '4569871324': '3', '1234567890': '1', '3215648481': 'FALSE', '663467676': [{'field_type': 'phone', 'phone_number': '(281) 555-1212', 'phone_type': 'home', 'do_not_text': '0', 'is_private': '0'}, {'field_type': 'phone', 'phone_number': '', 'phone_type': None, 'do_not_text': None, 'is_private': None}, {'field_type': 'phone', 'phone_number': '', 'phone_type': None, 'do_not_text': None, 'is_private': None}], '0': 'on', '': 'on', '3214569896': [{'address': '', 'is_primary': '1', 'allow_bulk': '1', 'is_private': '0', 'field_type': 'email_primary'}], '7899877899': [{'field_type': 'address_primary', 'street_address': '1234 Coral Ridge Ln, 'city': 'Denver', 'state': 'MO', 'zip': '12345-3456', 'longitude': '-##.#####', 'latitude': '##.######', 'is_primary': '1', 'is_private': '0'}], '7894563210': {'value': '7', 'name': 'Yes'}, '2031316497': '', '6486486848': {'value': '10', 'name': 'Confirmed'}, '7418529635': '', '3691472585': {'value': '14', 'name': 'Member 16 and over'}, '1973468251': {'value': '65', 'name': 'Yes'}, '3699633688': '501', '4546563535': 'Ms', '7979794648': '', '1855896831': {'value': '2', 'name': 'Female'}, '200013805': {'value': '1', 'name': 'Member'}, '9009090945': {'value': '5', 'name': 'Widowed'}, '3677883302': '1945-01-01', 'birthdate': '1945-01-01'}, 'family': []}

verses results without any details:

https://yoursubdomain.breezechms.com/api/people

no details yields: {'id': '12345678', 'first_name': 'Jean', 'force_first_name': 'Jean', 'last_name': 'Smith', 'path': 'img/profiles/generic/gray.png'}

pl22740 commented 2 years ago

I saw this as well. I just started using the API so my first query was details=1 for all people (with a limit of 5) and the JSON was different than with filter_json active.