Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 9 Current »

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": 36780,
    "organization_id": 24828,
    "location_id": 24829,
    "rtm_service_id": 28732,
    "program_id": null,
    "name": "EMERGENCY FOOD AND MATERIAL GOODS",
    "alternate_name": null,
    "description": "Provides food, personal care items, formula, baby food, and diapers to assist families/individuals in short term emergency situations. Also has special foods for individuals with diabetes or hypertension and high protein foods for individuals who have had gastric bypass surgery. Individuals may only receive assistance every 30 days, according to family circumstances, and must also attend MSU Extension nutrition classes after 3 visits to the pantry. May also have small kitchen appliances including slow cookers, hot plates, microwaves, fry pans, can openers and toasters.",
    "url": null,
    "email": null,
    "status": "1",
    "interpretation_services": null,
    "application_process": "Call for appointment.",
    "wait_time": null,
    "fees": "No fees",
    "accreditations": null,
    "licenses": null,
    "eligibility": "Low-Income individuals and families. Families living outside of Muskegon Heights, Norton Shores and Roosevelt Park must first attempt to access other pantries closer to them before contacting MAP for assistance.",
    "language": null,
    "payment_accepted": "Not applicable",
    "required_document": "Picture ID of self or the person they're picking up food for, must also provide social security card for self and all persons living in the home.",
    "service_area": "Muskegon County",
    "region": "CALL",
    "contacts": [],
    "regular_schedule": [
      {
        "id": "291",
        "location_id": "24829",
        "service_id": "36780",
        "service_at_location_id": "",
        "weekday": "",
        "opens_at": "",
        "closes_at": "",
        "administrative_hours": "",
        "service_hours": "Call to make an appointment. Appointments are scheduled for Mon, Wed, Fri 1",
        "site_hours": ""
      }
    ],
    "holiday_schedule": [],
    "phones": [
      {
        "id": "3613",
        "organization_id": "24828",
        "location_id": "24829",
        "service_id": "36780",
        "contact_id": "",
        "service_at_location_id": "",
        "number": "2317339672",
        "extension": "",
        "type": "Phone for Web/API display",
        "department": "",
        "language": "",
        "description": ""
      }
    ],
    "service_taxonomy": [
      {
        "id": "75",
        "service_id": "36780",
        "taxonomy_id": "BD-1800.2000",
        "taxonomy_detail": "Food Pantries",
        "category": "Clothing/Food/Personal Goods/Services",
        "subcategory": "Food"
      },
      {
        "id": "76",
        "service_id": "36780",
        "taxonomy_id": "BD-1800.8200-250",
        "taxonomy_detail": "Formula/Baby Food",
        "category": "Clothing/Food/Personal Goods/Services",
        "subcategory": "Food"
      },
      {
        "id": "77",
        "service_id": "36780",
        "taxonomy_id": "BD-1800.8200-780",
        "taxonomy_detail": "Special Diet Food",
        "category": "Food and Meals",
        "subcategory": "Food"
      },
      {
        "id": "78",
        "service_id": "36780",
        "taxonomy_id": "BM-6500.1500-150",
        "taxonomy_detail": "Diapers",
        "category": "Clothing/Food/Personal Goods/Services",
        "subcategory": "Clothing"
      },
      {
        "id": "79",
        "service_id": "36780",
        "taxonomy_id": "BM-6500.6500-650",
        "taxonomy_detail": "Personal/Grooming Supplies",
        "category": "Clothing/Food/Personal Goods/Services",
        "subcategory": "Material goods"
      },
      {
        "id": "80",
        "service_id": "36780",
        "taxonomy_id": "TI-1800.2000",
        "taxonomy_detail": "Food Donation Programs",
        "category": "Volunteers/Donations",
        "subcategory": "Donation Services"
      }
    ],
    "physical_address": [
      {
        "id": "1527",
        "location_id": "24829",
        "attention": "",
        "address_1": "2500 Jefferson Street",
        "address_2": "",
        "address_3": "",
        "address_4": "",
        "city": "Muskegon Heights",
        "county": "Muskegon",
        "region": "",
        "state_province": "MI",
        "postal_code": "49444",
        "country": "USA"
      }
    ],
    "locations": [
      {
        "id": "24829",
        "organization_id": "24828",
        "organization_name": "MISSION FOR AREA PEOPLE",
        "name": "MISSION FOR AREA PEOPLE",
        "alternate_name": "MAP",
        "description": "Located one block north of the Chicken Coop, across the street from Muskegon Heights High School",
        "transportation": "Public transportation available",
        "latitude": "43.2069091",
        "longitude": "86.2470191"
      }
    ]
  }
]


  • No labels