API Filters

From Charitylog Manual
Jump to: navigation, search

Go to API overview

Helpheader small.png

If you want to filter your results, you can keep adding up to 10 key/value pairs to the URL. The value can usually take multiple values separated by a semi-colon.

The following fields can be used as filters in the /clients endpoint:

  • accommodation
  • active
  • age_range
  • blue_badge_holder
  • consent
  • county
  • deceased
  • district
  • employment_status
  • ethnicity
  • external_id
  • gender
  • gp_name
  • gp_surgery
  • id
  • main_disability
  • main_language
  • marital_status
  • nhs_number
  • people_in_household
  • postcode
  • preferred_communication_method
  • registered_disabled
  • religion
  • school
  • sexual_orientation
  • social_services_number
  • usual_support_worker

The example below would get all clients that have a religion (org_religion) ID of 1,3 or 10 and an ethnicity (org_ethnic_group) ID of 1.

[GET] https://api.dizions.co.uk/v2/clients/religion/1;3;10/ethnicity/1

The following fields can be used as filters in the /referrals endpoint:

  • additional_org_person
  • client
  • client_accommodation
  • client_active
  • client_age_range
  • client_blue_badge_holder
  • client_county
  • client_district
  • client_employment_status
  • client_ethnicity
  • client_external_id
  • client_gender
  • client_gp_name
  • client_gp_surgery
  • client_main_disability
  • client_main_language
  • client_marital_status
  • client_nhs_number
  • client_people_in_household
  • client_postcode
  • client_preferred_communication_method
  • client_registered_disabled
  • client_religion
  • client_school
  • client_sexual_orientation
  • client_type
  • contact_method
  • contact_type
  • date
  • description
  • funding_sponsor
  • id
  • introduction_source
  • priority
  • project
  • project_active
  • project_category
  • project_name
  • referral_complete
  • referrer
  • response_method
  • stage
  • template
  • updated

The following fields can be used as filters in the /done_contacts endpoint:

  • client
  • client_accommodation
  • client_active
  • client_age_range
  • client_blue_badge_holder
  • client_county
  • client_district
  • client_employment_status
  • client_ethnicity
  • client_external_id
  • client_gender
  • client_gp_name
  • client_gp_surgery
  • client_main_disability
  • client_main_language
  • client_marital_status
  • client_nhs_number
  • client_people_in_household
  • client_postcode
  • client_preferred_communication_method
  • client_registered_disabled
  • client_religion
  • client_school
  • client_sexual_orientation
  • client_type
  • contact_method
  • contact_type
  • due_stage
  • end_date
  • funding_sponsor
  • id
  • introduction_source
  • priority
  • project
  • project_active
  • project_category
  • project_name
  • referral
  • referral_complete
  • referrer
  • response_method
  • stage
  • template
  • travel_mileage
  • travel_time
  • user

The example below would get completed actions for project ID 5, where the client was unemployed and registered disabled.

[GET] https://api.dizions.co.uk/v2/done_contacts/client_registered_disabled/Y/client_employment_status/N/project/5


You can also filter by the record ID (getting a single record), e.g.

[GET] https://api.dizions.co.uk/v2/referrals/id/510.

For referrals and clients you can filter by single record extension database value(s).

[GET] https://api.dizions.co.uk/v2/clients/website_photo_consent/109

For referrals, contacts and schedules you can restrict the results to a date range.

[GET] https://api.dizions.co.uk/v2/referrals/date_active/2018-10-01,2018-10-31