DS AP

DS API - Family Promise

/openapi.json

GET/infoGet Url

Verify we can connect to the database, and return the database URL in this format: dialect://user:password@host/dbname The password will be hidden with ***

Parameters

Cancel

No parameters

ExecuteClear

Responses

Curl

curl -X 'GET' \
  'http://family-promise-dev.us-east-1.elasticbeanstalk.com/info' \
  -H 'accept: application/json'

Request URL

http://family-promise-dev.us-east-1.elasticbeanstalk.com/info

Server response

CodeDetails

200

Response body

Download

{

"database_url": "postgresql://aztugzfejptrww:***@ec2-107-22-245-82.compute-1.amazonaws.com:5432/db9egku1e3j21v"

}

Response headers

 connection: keep-alive  content-length: 112  content-type: application/json  date: Thu,14 Oct 2021 15:26:09 GMT  server: nginx/1.20.0 

Responses

CodeDescriptionLinks

200

Successful Response

Media typeapplication/jsonControls Accept header.

  • Example Value

  • Schema

"string"

No links

POST/vizmap/{query_json}Visual

Creates an interactive map with dots pertaining to location of service. The dots on the map are color coded by service. Because there is no latitude or longitude in BE database, we geocode in order to get latitude and longitude. With the acquired latitude and longitude, the map visualization can be created and sent to the BE in JSON form.

Input:

query_json : JSON object Sent to DS API from BE

Output:

JSON object sent back to BE

Parameters

Cancel

NameDescription

query_json *(path)

Execute

Responses

CodeDescriptionLinks

200

Successful Response

Media typeapplication/jsonControls Accept header.

  • Example Value

  • Schema

"string"

No links

422

Validation Error

Media typeapplication/json

  • Example Value

  • Schema

{

"detail": [

{
  "loc": [
    "string"
  ],
  "msg": "string",
  "type": "string"
}

] } | No links |

POST/veteran_counts/{query_json}Veteran Counts

This function will return a bar chart of the count of veterans being served by Family Promise, in JSON form.

Parameters

Cancel

NameDescription

query_json *(path)

Execute

Responses

CodeDescriptionLinks

200

Successful Response

Media typeapplication/jsonControls Accept header.

  • Example Value

  • Schema

"string"

No links

422

Validation Error

Media typeapplication/json

  • Example Value

  • Schema

{

"detail": [

{
  "loc": [
    "string"
  ],
  "msg": "string",
  "type": "string"
}

] } | No links |

POST/age_metric/{query_json}Age Metric

This function will return a table visual of the count of recipients by age group being served by Family Promise, in JSON form.

Parameters

Cancel

NameDescription

query_json *(path)

Execute

Responses

CodeDescriptionLinks

200

Successful Response

Media typeapplication/jsonControls Accept header.

  • Example Value

  • Schema

"string"

No links

422

Validation Error

Media typeapplication/json

  • Example Value

  • Schema

{

"detail": [

{
  "loc": [
    "string"
  ],
  "msg": "string",
  "type": "string"
}

] } | No links |

POST/eligibility/{household_id}Check Eligibility

Checks for eligibility for services based on service provider data.

Parameters


id A household_id entry from the households table.

Returns


JSON "resident_assistance_eligibility": bool "reduced_bus_fare_eligibility": bool

Parameters

Cancel

NameDescription

household_id *string(path)

Execute

Responses

CodeDescriptionLinks

200

Successful Response

Media typeapplication/jsonControls Accept header.

  • Example Value

  • Schema

"string"

No links

422

Validation Error

Media typeapplication/json

  • Example Value

  • Schema

{

"detail": [

{
  "loc": [
    "string"
  ],
  "msg": "string",
  "type": "string"
}

] } | No links |

GET/total_servedGet Total Served

Returns the total number of recipients TODO: Return recipients relavent to user

Returns


int total_served

Parameters

Cancel

No parameters

ExecuteClear

Responses

Curl

curl -X 'GET' \
  'http://family-promise-dev.us-east-1.elasticbeanstalk.com/total_served' \
  -H 'accept: application/json'

Request URL

http://family-promise-dev.us-east-1.elasticbeanstalk.com/total_served

Server response

CodeDetails

200

Response body

Download

115

Response headers

 connection: keep-alive  content-length: 3  content-type: application/json  date: Thu,14 Oct 2021 15:26:36 GMT  server: nginx/1.20.0 

Responses

CodeDescriptionLinks

200

Successful Response

Media typeapplication/jsonControls Accept header.

  • Example Value

  • Schema

"string"

No links

GET/families_servedGet Families Served

Returns the total number of families TODO: Return only those relavent to the user

Returns


int families_served

Parameters

Cancel

No parameters

Execute

Responses

CodeDescriptionLinks

200

Successful Response

Media typeapplication/jsonControls Accept header.

  • Example Value

  • Schema

"string"

No links

GET/children_servedGet Children Served

Returns the number of recipients under 18, not inclusive.

Returns


int children_served

Parameters

Cancel

No parameters

ExecuteClear

Responses

Curl

curl -X 'GET' \
  'http://family-promise-dev.us-east-1.elasticbeanstalk.com/children_served' \
  -H 'accept: application/json'

Request URL

http://family-promise-dev.us-east-1.elasticbeanstalk.com/children_served

Server response

CodeDetails

200

Response body

Download

71

Response headers

 connection: keep-alive  content-length: 2  content-type: application/json  date: Thu,14 Oct 2021 15:27:14 GMT  server: nginx/1.20.0 

Responses

CodeDescriptionLinks

200

Successful Response

Media typeapplication/jsonControls Accept header.

  • Example Value

  • Schema

"string"

No links

GET/genders_servedGet Genders Served

Returns the count of each gender served.

Returns


list genders_served

Parameters

Cancel

No parameters

ExecuteClear

Responses

Curl

curl -X 'GET' \
  'http://family-promise-dev.us-east-1.elasticbeanstalk.com/genders_served' \
  -H 'accept: application/json'

Request URL

http://family-promise-dev.us-east-1.elasticbeanstalk.com/genders_served

Server response

CodeDetails

200

Response body

Download

[

{

"gender": "Female",
"total": 5

}, { "gender": "Male", "total": 12 }, { "gender": "Transgender: M to F", "total": 4 }, { "gender": "Transgender: F to M", "total": 5 }, { "gender": "Gender fluid", "total": 6 }, { "gender": "Agender", "total": 5 }, { "gender": "Androgynous", "total": 8 }, { "gender": "Bi-gender", "total": 8 }, { "gender": "Non-binary", "total": 4 }, { "gender": "Demi-boy", "total": 3 }, { "gender": "Demi-girl", "total": 6 }, { "gender": "Genderqueer", "total": 7 }, { "gender": "Gender nonconforming", "total": 2 }, { "gender": "Tri-gender", "total": 6 }, { "gender": "All genders", "total": 6 }, { "gender": "In the middle of boy and girl", "total": 8 }, { "gender": "Intersex", "total": 10 }, { "gender": "Not sure", "total": 2 }, { "gender": "Prefer not to say", "total": 7 }, { "gender": "Other", "total": 0 } ]

Response headers

 connection: keep-alive  content-length: 716  content-type: application/json  date: Thu,14 Oct 2021 15:27:21 GMT  server: nginx/1.20.0 

|

Responses

CodeDescriptionLinks

200

Successful Response

Media typeapplication/jsonControls Accept header.

  • Example Value

  • Schema

"string"

No links

GET/races_servedGet Races Served

Returns the count of each race served.

Returns


list races_served

Parameters

Cancel

No parameters

Execute

Responses

CodeDescriptionLinks

200

Successful Response

Media typeapplication/jsonControls Accept header.

  • Example Value

  • Schema

"string"

No links

GET/ethnicities_servedGet Ethnicities Served

Returns the count of each ethnicity served.

Returns


list ethnicities_served

Parameters

Cancel

No parameters

ExecuteClear

Responses

Curl

curl -X 'GET' \
  'http://family-promise-dev.us-east-1.elasticbeanstalk.com/ethnicities_served' \
  -H 'accept: application/json'

Request URL

http://family-promise-dev.us-east-1.elasticbeanstalk.com/ethnicities_served

Server response

CodeDetails

200

Response body

Download

[

{

"ethnicity": "Hispanic/Latino",
"total": 61

}, { "ethnicity": "Non-Hispanic/Non-Latino", "total": 51 }, { "ethnicity": "Prefer not to say", "total": 2 } ]

Response headers

 connection: keep-alive  content-length: 139  content-type: application/json  date: Thu,14 Oct 2021 15:27:29 GMT  server: nginx/1.20.0 

|

Responses

CodeDescriptionLinks

200

Successful Response

Media typeapplication/jsonControls Accept header.

  • Example Value

  • Schema

"string"

No links

GET/program_enrollmentGet Program Enrollment

Returns the count of services done for each program.

Returns


list program_enrollment

Parameters

Cancel

No parameters

ExecuteClear

Responses

Curl

curl -X 'GET' \
  'http://family-promise-dev.us-east-1.elasticbeanstalk.com/program_enrollment' \
  -H 'accept: application/json'

Request URL

http://family-promise-dev.us-east-1.elasticbeanstalk.com/program_enrollment

Server response

CodeDetails

200

Response body

Download

[

{

"program_name": "Shelter Support",
"total": 174

}, { "program_name": "Prevention/Diversion", "total": 177 }, { "program_name": "Aftercare", "total": 151 }, { "program_name": "Test setup by Admin ", "total": 0 } ]

Response headers

 connection: keep-alive  content-length: 191  content-type: application/json  date: Thu,14 Oct 2021 15:27:34 GMT  server: nginx/1.20.0 

|

Responses

CodeDescriptionLinks

200

Successful Response

Media typeapplication/jsonControls Accept header.

  • Example Value

  • Schema

"string"

No links

GET/services_givenGet Services Given

Returns the count of each service provided.

Returns


list services_given

Parameters

Try it out

No parameters

Responses

CodeDescriptionLinks

200

Successful Response

Media typeapplication/jsonControls Accept header.

  • Example Value

  • Schema

"string"

No links

GET/locations_of_serviceGet Locations

Returns the count of services at each type of location.

Returns


list locations_of_service

Parameters

Cancel

No parameters

ExecuteClear

Responses

Curl

curl -X 'GET' \
  'http://family-promise-dev.us-east-1.elasticbeanstalk.com/locations_of_service' \
  -H 'accept: application/json'

Request URL

http://family-promise-dev.us-east-1.elasticbeanstalk.com/locations_of_service

Server response

CodeDetails

200

Response body

Download

[

{

"location_type": "Personal Home",
"total": 146

}, { "location_type": "Halfway House", "total": 142 }, { "location_type": "Service Distribution Center", "total": 110 }, { "location_type": "Unaffiliated Service Distribution Location", "total": 104 } ]

Response headers

 connection: keep-alive  content-length: 228  content-type: application/json  date: Thu,14 Oct 2021 15:27:41 GMT  server: nginx/1.20.0 

|

Responses

CodeDescriptionLinks

200

Successful Response

Media typeapplication/jsonControls Accept header.

  • Example Value

  • Schema

"string"

No links

POST/geocode/Get Latitude Longitude

Please post an address as a JSON object with this format:

{"address": "123 Gilman Dr W", "address_line2": "", "city": "Seattle", "state": "WA", "zip": "98119", "country": "United States"}

The output will be a JSON object with the following format:

{"latitude": 47.64971, "longitude": -117.39764}

Parameters

Cancel

No parameters

Request body

application/jsonExecuteClear

Responses

Curl

curl -X 'POST' \
  'http://family-promise-dev.us-east-1.elasticbeanstalk.com/geocode/' \
  -H 'accept: application/json' \
  -H 'Content-Type: application/json' \
  -d '{}'

Request URL

http://family-promise-dev.us-east-1.elasticbeanstalk.com/geocode/

Server response

CodeDetails

200

Response body

Download

{

"latitude": 47.64971,

"longitude": -117.39764

}

Response headers

 access-control-allow-credentials: true  access-control-allow-origin: *  connection: keep-alive  content-length: 44  content-type: application/json  date: Thu,14 Oct 2021 15:27:47 GMT  server: nginx/1.20.0 

Responses

CodeDescriptionLinks

200

Successful Response

Media typeapplication/jsonControls Accept header.

  • Example Value

  • Schema

"string"

No links

422

Validation Error

Media typeapplication/json

  • Example Value

  • Schema

{

"detail": [

{
  "loc": [
    "string"
  ],
  "msg": "string",
  "type": "string"
}

] } | No links |

Schemas

HTTPValidationError{

detail

Detail[...]

}ValidationError{

loc*

Location[...]

msg*

string title: Message

type*

string title: Error Type

}

Last updated