{"swagger":"2.0","info":{"version":"1.0.0","title":"2-1-1 MH Search API","description":"Search 2-1-1 MH Resources","contact":{"name":"Mile High United Way"},"license":{"name":"MIT"}},"securityDefinitions":{"auth_name":{"type":"apiKey","name":"X-UW211-KEY","in":"header"}},"host":"api.211colorado.org","schemes":["https"],"consumes":["application/json"],"produces":["application/json"],"paths":{"/api/search":{"post":{"description":"<ul><li>Returns search results if the user has access.</li><li>Either term or code is required for each search submitted.</li><li>Multiple parameters are treated as ANDs (i.e. giving an age range and open now as true will return only those results that meet both criteria).</li><li>Multiple values within a parameter are treated as OR (i.e. giving two taxonomy codes will return results with either of those codes).</li></ul>","operationId":"create","tags":["search"],"parameters":[{"name":"page","in":"query","description":"Results page number","required":true,"type":"integer","format":"int64","default":1},{"name":"service_area","in":"query","description":"Service Area - State or city name (zip codes should not be used). This searches for resources that serve the area given.","required":true,"type":"string","default":"CO"},{"name":"term","in":"query","description":"Search term. Either search term or taxonomy code are required.","required":false,"type":"string"},{"name":"terms","in":"query","description":"Search terms array. Either search term or terms array are required for text search.","required":false,"type":"array","items":{"type":"string"}},{"name":"code","in":"query","description":"Taxonomy Code. Either search term or taxonomy code are required. Taxonomy codes can be found via the taxonomy code endpoint.","required":false,"type":"string"},{"name":"tp","in":"query","description":"Target population. These can be found under the Y taxonomy codes. A valid value is an array of strings (i.e. ['3242','23423'] or ['3242'])","required":false,"type":"array","items":{"type":"string"}},{"name":"age_range","in":"query","description":"An age range, requested in one of the following, exact formats. Age range must be one of: \"0,8\" \"9,16\" \"17,24\" \"25,55\" \"56,65\" \"65,100\"","required":false,"type":"string"},{"name":"area_sort","in":"query","description":"This flag will present nationwide and statewide resources as the first results, if those resources exist. If they do not exist, search will be unchanged. \"true\" is the only valid value.","required":false,"type":"boolean"},{"name":"open_now","in":"query","description":"This flag will present resources open now, if those resources exist. If they do not exist, no results will appear. \"true\" is the only value that will filter/have an effect.","required":false,"type":"boolean"},{"name":"open_on","in":"query","description":"Provides the resources that are open on the indicated day(s) of the week, represented by integers. The following integers should be used for the day Sunday - 0, Monday - 1, Tuesday - 2, Wednesday - 3, Thursday - 4, Friday - 5, Saturday - 6. Valid format is an array (i.e. [1] or [1,3,4]). Values in an array are or (i.e. in the example, it will search for Programs open on Monday or Wednesday or Thursday)","required":false,"type":"array","items":{"type":"integer"}},{"name":"after","in":"query","description":"Provides the resources that have been updated since after time. Value should be in ISO-8601 format.","required":false,"type":"string","format":"date-time"},{"name":"gender","in":"query","description":"Provides the resources that exclusively serve the specified gender. Valid values are male or female","required":false,"type":"string"},{"name":"agency_id","in":"query","description":"Filter returned programs by an agency","required":false,"type":"integer"},{"name":"program_id","in":"query","description":"Filter results to a single program","required":false,"type":"integer"}],"responses":{"200":{"description":"search response","schema":{"type":"array","items":{"$ref":"#/definitions/Search"}}},"401":{"description":"unauthorized","schema":{"type":"array","items":{"$ref":"#/definitions/ErrorModel"}}},"default":{"description":"unexpected error","schema":{"$ref":"#/definitions/ErrorModel"}}}}},"/api/taxonomies":{"get":{"description":"Returns a list of all taxonomy codes and names assigned to programs and the associated category codes/names.","operationId":"index","produces":["application/json","text/html"],"tags":["taxonomies"],"responses":{"200":{"description":"taxonomy response","schema":{"type":"array","items":{"$ref":"#/definitions/Taxonomies"}}},"401":{"description":"unauthorized","schema":{"type":"array","items":{"$ref":"#/definitions/ErrorModel"}}},"default":{"description":"unexpected error","schema":{"$ref":"#/definitions/ErrorModel"}}}}},"/api/v2/agencies.{format}":{"get":{"description":"Returns all agencies","parameters":[{"name":"format","in":"path","description":"Format of response","required":true,"type":"string","enum":["json","hsds"]},{"name":"page","in":"query","description":"Page for paginated results. 1 based.","required":false,"type":"integer","format":"int64"},{"name":"after","in":"query","description":"Provides the agencies that have been updated since after time. Value should be in ISO-8601 format.","required":false,"type":"string","format":"date-time"}]}},"/api/v2/agencies/{id}.{format}":{"get":{"description":"Returns a single agency","parameters":[{"name":"id","in":"path","description":"ID of agency","required":true,"type":"integer","format":"int64"},{"name":"format","in":"path","description":"Format of response","required":true,"type":"string","enum":["json","hsds"]}]}},"/api/problem_statements.json":{"get":{"description":"Returns all problem statements that meet the filter criteria","parameters":[{"name":"problem_statement","in":"query","description":"Filters the problem statements to those that match the statement","required":false,"type":"string"},{"name":"since","in":"query","description":"Provides the problem statements that have been updated after the specified date. Value should be in ISO-8601 format.","required":false,"type":"string","format":"date-time"}]}},"/api/service_areas.json":{"get":{"description":"Returns all service areas, filtered by `since`, if present.","parameters":[{"name":"since","in":"query","description":"Provides the service areas that have been updated after the specified date. Value should be in ISO-8601 format.","required":false,"type":"string","format":"date-time"}]}}},"definitions":{"Search":{"required":["page","service_area"],"properties":{"page":{"type":"integer","format":"int64"},"service_area":{"type":"string"},"term":{"type":"string"}}},"Taxonomies":{"required":["code","name","category_code","category_name"],"properties":{"code":{"type":"string"},"name":{"type":"string"},"category_code":{"type":"string"},"category_name":{"type":"string"}}},"TaxonomyOutput":{"allOf":[{"$ref":"#/definitions/Taxonomies"},{"required":["total_results","last_update","copyright","api_version"],"properties":{"total_results":{"type":"integer","format":"int64"},"last_update":{"type":"string","format":"YYYY-MM-DD"},"copyright":{"type":"string"},"api_version":{"type":"string"}}}]},"ErrorModel":{"required":["code","message"],"properties":{"code":{"type":"integer","format":"int32"},"message":{"type":"string"}}}}}