Get a list of service locations filtered by AIRS service taxonomy term and location area (zip code, county).

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 https://brightstreetgroup.atlassian.net/wiki/spaces/CIEP/pages/1309802703

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