Description

The following use case will retrieve a list of service locations based on a AIRS service taxonomy term https://www.airs.org/i4a/pages/index.cfm?pageid=3386 and location area.

Quote of Use Case

“I would like to get a list of Food Pantries in zip code 49456”

Step 1 - Get an access token

This will retrieve an access token from CIE Identity Provider. Please note that if the system has already retrieved a access token that has not yet expired then that can be used with other calls. An access token is valid for 24 hours after it has been minted. The following explains on how to get Authorization

Step 2 - Call [GET /taxonomy] Get a list of valid taxonomy terms

The social services directory tags each service by a taxonomy term that can be used to filter the results of the Call. The following will get a list of taxonomy terms. Note that taxonomy terms change infrequently ; it may not be necessary to refresh the list of valid taxonomy terms every time a request is being made for resource information.

Example CURL

curl -X 'GET' \
  'https://directory-uat.mi-cie.org/v1/taxonomy' \
  -H 'accept: application/json' \
  -H 'x-api-key: ZGV2ZWxv******OTg2ODhlMDY4ZGNk' \
  -H 'authorization: Bearer eyJraWQiOiJsYmFFa05FR25XbWJ4****sccMLjqZxd_HtCudVAPbqdNS_e_w'
Request URL

Response

The following is a sample response. These taxonomy IDs (e.g., BD-1800.2000) can be used to filter the query to only resources that provide certain specific services (e.g., food pantries)

[
  {
    "id": 196,
    "taxonomy_id": "BD-1800.2000",
    "name": "Food Pantries",
    "vocabulary": "AIRS",
    "language": "English"
  }
  {
    "id": 3,
    "taxonomy_id": "LH-5000.0500",
    "name": "Adapted Health Care Devices",
    "vocabulary": "AIRS",
    "language": "English"
  }
]  

Step 3 - Call [GET /services/complete] call with the filter query string parameter

Now that we have the the taxonomy id, a zip code parameter can also be added in the example below.

The filter for this call will be {"$table.field": [{"service_taxonomy.taxonomy_id": "BD-1800.2000"}, {"physical_address.postal_code": "49456"}]}

curl -X 'GET' \
  'https://directory-dev.mi-cie.org/v1/services/complete?query=%7B%22%24table.field%22%3A%20%5B%7B%22service_taxonomy.taxonomy_id%22%3A%20%22BD-1800.2000%22%7D%2C%20%7B%22physical_address.postal_code%22%3A%20%2249456%22%7D%5D%7D' \
  -H 'accept: application/json' \
  -H 'x-api-key: ZGV2ZWxvcG1******tOTg2ODhlMDY4ZGNk' \
  -H 'authorization: Bearer eyJraWQiOiJsYmFFa05F***hmsrnqPtCIqhR8-gg'

Response

The following is a sample response from the query

[
  {
    "id": 6227,
    "organization_id": 4048,
    "location_id": 4049,
    "rtm_service_id": 5083,
    "program_id": null,
    "name": "FOOD PANTRIES AND PERSONAL CARE ITEMS",
    "alternate_name": null,
    "description": "Provides emergency food and personal care items. The personal care items, like shampoo, body wash, toothpaste and toothbrushes are not guaranteed, as it depends on what has been donated.",
    "url": null,
    "email": null,
    "status": "1",
    "interpretation_services": null,
    "application_process": "Foodlink Referral required; Foodlink will email referral to pantry as calls come in helpinghands@frontier.com. For personal/grooming supplies, client can call to check availability or Foodlink worker can inquire on referral.",
    "wait_time": null,
    "fees": "No fees",
    "accreditations": null,
    "licenses": null,
    "eligibility": "Residents of Cass County; Assistance available 12x per year",
    "language": null,
    "payment_accepted": "Not applicable",
    "required_document": "The head of household must provide current Cass County Photo ID and social security cards for every member of the home. First time guests need a referral from either their caseworker, or from 2-1-1.",
    "service_area": "Cass County",
    "region": "GRYP",
    "contacts": [
      {
        "id": "2309",
        "organization_id": "4048",
        "location_id": "4049",
        "service_id": "6227",
        "service_at_location_id": "",
        "name": "",
        "title": "",
        "department": "",
        "email": ""
      },
      {
        "id": "2310",
        "organization_id": "4048",
        "location_id": "4049",
        "service_id": "6227",
        "service_at_location_id": "",
        "name": "Julie Watts",
        "title": "",
        "department": "",
        "email": "helpinghands@frontier.com"
      }
    ],
    "regular_schedule": [
      {
        "id": "7959",
        "location_id": "4049",
        "service_id": "6227",
        "service_at_location_id": "",
        "weekday": "",
        "opens_at": "",
        "closes_at": "",
        "administrative_hours": "",
        "service_hours": "Tue and Thu 10am-3pmCome to back door, open vehicle trunk, ring doorbell, a",
        "site_hours": ""
      }
    ],
    "holiday_schedule": [],
    "phones": [
      {
        "id": "13308",
        "organization_id": "4048",
        "location_id": "4049",
        "service_id": "6227",
        "contact_id": "2309",
        "service_at_location_id": "",
        "number": "2694458104",
        "extension": "",
        "type": "Main",
        "department": "",
        "language": "",
        "description": ""
      }
    ],
    "service_taxonomy": [
      {
        "id": "8738",
        "service_id": "6227",
        "taxonomy_id": "BD-1800.2000",
        "taxonomy_detail": "Food Pantries",
        "category": "Clothing/Food/Personal Goods/Services",
        "subcategory": "Food"
      },
      {
        "id": "8739",
        "service_id": "6227",
        "taxonomy_id": "BM-6500.6500-650",
        "taxonomy_detail": "Personal/Grooming Supplies",
        "category": "Clothing/Food/Personal Goods/Services",
        "subcategory": "Material goods"
      }
    ],
    "physical_address": [
      {
        "id": "3937",
        "location_id": "4049",
        "attention": "",
        "address_1": "130 South Broadway Street",
        "address_2": "",
        "address_3": "",
        "address_4": "",
        "city": "Cassopolis",
        "county": "Cass",
        "region": "",
        "state_province": "MI",
        "postal_code": "49031",
        "country": "USA"
      }
    ],
    "locations": [
      {
        "id": "4049",
        "organization_id": "4048",
        "organization_name": "HELPING HANDS OF CASS COUNTY",
        "name": "HELPING HANDS OF CASS COUNTY",
        "alternate_name": "Helping Hands",
        "description": "From Dowagiac: M62-downtown Cassopolis. Address is 130 S. Broadway (Just past the intersection of M-60 & M-62 (State & Broadway). From Edwardsburg: M62 to M60. At M-60 (State St.) turn left. At light by courthouse turn left. Helping Hands will be mid-bloc",
        "transportation": "No public transportation available",
        "latitude": "41.9102900",
        "longitude": "86.0126026"
      }
    ]
  }
]