# DS AP

### DS API - Family Promise

#### <http://family-promise-dev.us-east-1.elasticbeanstalk.com/#/Geocode/get_latitude_longitude_geocode__post>

{% embed url="<http://family-promise-dev.us-east-1.elasticbeanstalk.com/#/Geocode/get_latitude_longitude_geocode__post>" %}

[/openapi.json](http://family-promise-dev.us-east-1.elasticbeanstalk.com/openapi.json)

#### [Database](http://family-promise-dev.us-east-1.elasticbeanstalk.com/#/Database) <a href="#operations-tag-database" id="operations-tag-database"></a>

GET[/info](http://family-promise-dev.us-east-1.elasticbeanstalk.com/#/Database/get_url_info_get)Get 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**

```bash
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**

<table><thead><tr><th>Code</th><th>Details</th></tr></thead><tbody><tr><td>200</td><td><p><strong>Response body</strong></p><p>Download</p><pre class="language-json"><code class="lang-json">{
</code></pre></td></tr><tr><td>"database_url": "postgresql://aztugzfejptrww:***@ec2-107-22-245-82.compute-1.amazonaws.com:5432/db9egku1e3j21v"</td><td></td></tr><tr><td><p>}</p><p><strong>Response headers</strong></p><pre><code> connection: keep-alive  content-length: 112  content-type: application/json  date: Thu,14 Oct 2021 15:26:09 GMT  server: nginx/1.20.0 
</code></pre></td><td></td></tr></tbody></table>

**Responses**

<table><thead><tr><th>Code</th><th>Description</th><th>Links</th></tr></thead><tbody><tr><td>200</td><td><p>Successful Response</p><p>Media typeapplication/jsonControls <code>Accept</code> header.</p><ul><li>Example Value</li><li>Schema</li></ul><pre class="language-json"><code class="lang-json">"string"
</code></pre></td><td><em>No links</em></td></tr></tbody></table>

#### [Visualizations](http://family-promise-dev.us-east-1.elasticbeanstalk.com/#/Visualizations) <a href="#operations-tag-visualizations" id="operations-tag-visualizations"></a>

POST[/vizmap/{query\_json}](http://family-promise-dev.us-east-1.elasticbeanstalk.com/#/Visualizations/visual_vizmap__query_json__post)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

| Name                 | Description |
| -------------------- | ----------- |
| query\_json \*(path) |             |

Execute

**Responses**

<table><thead><tr><th>Code</th><th>Description</th><th>Links</th></tr></thead><tbody><tr><td>200</td><td><p>Successful Response</p><p>Media typeapplication/jsonControls <code>Accept</code> header.</p><ul><li>Example Value</li><li>Schema</li></ul><pre class="language-json"><code class="lang-json">"string"
</code></pre></td><td><em>No links</em></td></tr><tr><td>422</td><td><p>Validation Error</p><p>Media typeapplication/json</p><ul><li>Example Value</li><li>Schema</li></ul><pre class="language-json"><code class="lang-json">{
</code></pre></td><td></td></tr><tr><td>"detail": [</td><td></td><td></td></tr></tbody></table>

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

] } | *No links* |

POST[/veteran\_counts/{query\_json}](http://family-promise-dev.us-east-1.elasticbeanstalk.com/#/Visualizations/veteran_counts_veteran_counts__query_json__post)Veteran Counts

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

**Parameters**

Cancel

| Name                 | Description |
| -------------------- | ----------- |
| query\_json \*(path) |             |

Execute

**Responses**

<table><thead><tr><th>Code</th><th>Description</th><th>Links</th></tr></thead><tbody><tr><td>200</td><td><p>Successful Response</p><p>Media typeapplication/jsonControls <code>Accept</code> header.</p><ul><li>Example Value</li><li>Schema</li></ul><pre class="language-json"><code class="lang-json">"string"
</code></pre></td><td><em>No links</em></td></tr><tr><td>422</td><td><p>Validation Error</p><p>Media typeapplication/json</p><ul><li>Example Value</li><li>Schema</li></ul><pre class="language-json"><code class="lang-json">{
</code></pre></td><td></td></tr><tr><td>"detail": [</td><td></td><td></td></tr></tbody></table>

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

] } | *No links* |

POST[/age\_metric/{query\_json}](http://family-promise-dev.us-east-1.elasticbeanstalk.com/#/Visualizations/age_metric_age_metric__query_json__post)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

| Name                 | Description |
| -------------------- | ----------- |
| query\_json \*(path) |             |

Execute

**Responses**

<table><thead><tr><th>Code</th><th>Description</th><th>Links</th></tr></thead><tbody><tr><td>200</td><td><p>Successful Response</p><p>Media typeapplication/jsonControls <code>Accept</code> header.</p><ul><li>Example Value</li><li>Schema</li></ul><pre class="language-json"><code class="lang-json">"string"
</code></pre></td><td><em>No links</em></td></tr><tr><td>422</td><td><p>Validation Error</p><p>Media typeapplication/json</p><ul><li>Example Value</li><li>Schema</li></ul><pre class="language-json"><code class="lang-json">{
</code></pre></td><td></td></tr><tr><td>"detail": [</td><td></td><td></td></tr></tbody></table>

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

] } | *No links* |

#### [Eligibility](http://family-promise-dev.us-east-1.elasticbeanstalk.com/#/Eligibility) <a href="#operations-tag-eligibility" id="operations-tag-eligibility"></a>

POST[/eligibility/{household\_id}](http://family-promise-dev.us-east-1.elasticbeanstalk.com/#/Eligibility/check_eligibility_eligibility__household_id__post)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

| Name                         | Description |
| ---------------------------- | ----------- |
| household\_id \*string(path) |             |

Execute

**Responses**

<table><thead><tr><th>Code</th><th>Description</th><th>Links</th></tr></thead><tbody><tr><td>200</td><td><p>Successful Response</p><p>Media typeapplication/jsonControls <code>Accept</code> header.</p><ul><li>Example Value</li><li>Schema</li></ul><pre class="language-json"><code class="lang-json">"string"
</code></pre></td><td><em>No links</em></td></tr><tr><td>422</td><td><p>Validation Error</p><p>Media typeapplication/json</p><ul><li>Example Value</li><li>Schema</li></ul><pre class="language-json"><code class="lang-json">{
</code></pre></td><td></td></tr><tr><td>"detail": [</td><td></td><td></td></tr></tbody></table>

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

] } | *No links* |

#### [Metrics](http://family-promise-dev.us-east-1.elasticbeanstalk.com/#/Metrics) <a href="#operations-tag-metrics" id="operations-tag-metrics"></a>

GET[/total\_served](http://family-promise-dev.us-east-1.elasticbeanstalk.com/#/Metrics/get_total_served_total_served_get)Get 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**

```bash
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**

<table><thead><tr><th>Code</th><th>Details</th></tr></thead><tbody><tr><td>200</td><td><p><strong>Response body</strong></p><p>Download</p><pre class="language-json"><code class="lang-json">115
</code></pre><p><strong>Response headers</strong></p><pre><code> connection: keep-alive  content-length: 3  content-type: application/json  date: Thu,14 Oct 2021 15:26:36 GMT  server: nginx/1.20.0 
</code></pre></td></tr></tbody></table>

**Responses**

<table><thead><tr><th>Code</th><th>Description</th><th>Links</th></tr></thead><tbody><tr><td>200</td><td><p>Successful Response</p><p>Media typeapplication/jsonControls <code>Accept</code> header.</p><ul><li>Example Value</li><li>Schema</li></ul><pre class="language-json"><code class="lang-json">"string"
</code></pre></td><td><em>No links</em></td></tr></tbody></table>

GET[/families\_served](http://family-promise-dev.us-east-1.elasticbeanstalk.com/#/Metrics/get_families_served_families_served_get)Get 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**

<table><thead><tr><th>Code</th><th>Description</th><th>Links</th></tr></thead><tbody><tr><td>200</td><td><p>Successful Response</p><p>Media typeapplication/jsonControls <code>Accept</code> header.</p><ul><li>Example Value</li><li>Schema</li></ul><pre class="language-json"><code class="lang-json">"string"
</code></pre></td><td><em>No links</em></td></tr></tbody></table>

GET[/children\_served](http://family-promise-dev.us-east-1.elasticbeanstalk.com/#/Metrics/get_children_served_children_served_get)Get Children Served

Returns the number of recipients under 18, not inclusive.

#### Returns

***

int children\_served

**Parameters**

Cancel

No parameters

ExecuteClear

**Responses**

**Curl**

```bash
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**

<table><thead><tr><th>Code</th><th>Details</th></tr></thead><tbody><tr><td>200</td><td><p><strong>Response body</strong></p><p>Download</p><pre class="language-json"><code class="lang-json">71
</code></pre><p><strong>Response headers</strong></p><pre><code> connection: keep-alive  content-length: 2  content-type: application/json  date: Thu,14 Oct 2021 15:27:14 GMT  server: nginx/1.20.0 
</code></pre></td></tr></tbody></table>

**Responses**

<table><thead><tr><th>Code</th><th>Description</th><th>Links</th></tr></thead><tbody><tr><td>200</td><td><p>Successful Response</p><p>Media typeapplication/jsonControls <code>Accept</code> header.</p><ul><li>Example Value</li><li>Schema</li></ul><pre class="language-json"><code class="lang-json">"string"
</code></pre></td><td><em>No links</em></td></tr></tbody></table>

GET[/genders\_served](http://family-promise-dev.us-east-1.elasticbeanstalk.com/#/Metrics/get_genders_served_genders_served_get)Get Genders Served

Returns the count of each gender served.

#### Returns

***

list genders\_served

**Parameters**

Cancel

No parameters

ExecuteClear

**Responses**

**Curl**

```bash
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**

<table><thead><tr><th>Code</th><th>Details</th></tr></thead><tbody><tr><td>200</td><td><p><strong>Response body</strong></p><p>Download</p><pre class="language-json"><code class="lang-json">[
</code></pre></td></tr><tr><td>{</td><td></td></tr></tbody></table>

```
"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**

<table><thead><tr><th>Code</th><th>Description</th><th>Links</th></tr></thead><tbody><tr><td>200</td><td><p>Successful Response</p><p>Media typeapplication/jsonControls <code>Accept</code> header.</p><ul><li>Example Value</li><li>Schema</li></ul><pre class="language-json"><code class="lang-json">"string"
</code></pre></td><td><em>No links</em></td></tr></tbody></table>

GET[/races\_served](http://family-promise-dev.us-east-1.elasticbeanstalk.com/#/Metrics/get_races_served_races_served_get)Get Races Served

Returns the count of each race served.

#### Returns

***

list races\_served

**Parameters**

Cancel

No parameters

Execute

**Responses**

<table><thead><tr><th>Code</th><th>Description</th><th>Links</th></tr></thead><tbody><tr><td>200</td><td><p>Successful Response</p><p>Media typeapplication/jsonControls <code>Accept</code> header.</p><ul><li>Example Value</li><li>Schema</li></ul><pre class="language-json"><code class="lang-json">"string"
</code></pre></td><td><em>No links</em></td></tr></tbody></table>

GET[/ethnicities\_served](http://family-promise-dev.us-east-1.elasticbeanstalk.com/#/Metrics/get_ethnicities_served_ethnicities_served_get)Get Ethnicities Served

Returns the count of each ethnicity served.

#### Returns

***

list ethnicities\_served

**Parameters**

Cancel

No parameters

ExecuteClear

**Responses**

**Curl**

```bash
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**

<table><thead><tr><th>Code</th><th>Details</th></tr></thead><tbody><tr><td>200</td><td><p><strong>Response body</strong></p><p>Download</p><pre class="language-json"><code class="lang-json">[
</code></pre></td></tr><tr><td>{</td><td></td></tr></tbody></table>

```
"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**

<table><thead><tr><th>Code</th><th>Description</th><th>Links</th></tr></thead><tbody><tr><td>200</td><td><p>Successful Response</p><p>Media typeapplication/jsonControls <code>Accept</code> header.</p><ul><li>Example Value</li><li>Schema</li></ul><pre class="language-json"><code class="lang-json">"string"
</code></pre></td><td><em>No links</em></td></tr></tbody></table>

GET[/program\_enrollment](http://family-promise-dev.us-east-1.elasticbeanstalk.com/#/Metrics/get_program_enrollment_program_enrollment_get)Get Program Enrollment

Returns the count of services done for each program.

#### Returns

***

list program\_enrollment

**Parameters**

Cancel

No parameters

ExecuteClear

**Responses**

**Curl**

```bash
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**

<table><thead><tr><th>Code</th><th>Details</th></tr></thead><tbody><tr><td>200</td><td><p><strong>Response body</strong></p><p>Download</p><pre class="language-json"><code class="lang-json">[
</code></pre></td></tr><tr><td>{</td><td></td></tr></tbody></table>

```
"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**

<table><thead><tr><th>Code</th><th>Description</th><th>Links</th></tr></thead><tbody><tr><td>200</td><td><p>Successful Response</p><p>Media typeapplication/jsonControls <code>Accept</code> header.</p><ul><li>Example Value</li><li>Schema</li></ul><pre class="language-json"><code class="lang-json">"string"
</code></pre></td><td><em>No links</em></td></tr></tbody></table>

GET[/services\_given](http://family-promise-dev.us-east-1.elasticbeanstalk.com/#/Metrics/get_services_given_services_given_get)Get Services Given

Returns the count of each service provided.

#### Returns

***

list services\_given

**Parameters**

Try it out

No parameters

**Responses**

<table><thead><tr><th>Code</th><th>Description</th><th>Links</th></tr></thead><tbody><tr><td>200</td><td><p>Successful Response</p><p>Media typeapplication/jsonControls <code>Accept</code> header.</p><ul><li>Example Value</li><li>Schema</li></ul><pre class="language-json"><code class="lang-json">"string"
</code></pre></td><td><em>No links</em></td></tr></tbody></table>

GET[/locations\_of\_service](http://family-promise-dev.us-east-1.elasticbeanstalk.com/#/Metrics/get_locations_locations_of_service_get)Get Locations

Returns the count of services at each type of location.

#### Returns

***

list locations\_of\_service

**Parameters**

Cancel

No parameters

ExecuteClear

**Responses**

**Curl**

```bash
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**

<table><thead><tr><th>Code</th><th>Details</th></tr></thead><tbody><tr><td>200</td><td><p><strong>Response body</strong></p><p>Download</p><pre class="language-json"><code class="lang-json">[
</code></pre></td></tr><tr><td>{</td><td></td></tr></tbody></table>

```
"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**

<table><thead><tr><th>Code</th><th>Description</th><th>Links</th></tr></thead><tbody><tr><td>200</td><td><p>Successful Response</p><p>Media typeapplication/jsonControls <code>Accept</code> header.</p><ul><li>Example Value</li><li>Schema</li></ul><pre class="language-json"><code class="lang-json">"string"
</code></pre></td><td><em>No links</em></td></tr></tbody></table>

#### [Geocode](http://family-promise-dev.us-east-1.elasticbeanstalk.com/#/Geocode) <a href="#operations-tag-geocode" id="operations-tag-geocode"></a>

POST[/geocode/](http://family-promise-dev.us-east-1.elasticbeanstalk.com/#/Geocode/get_latitude_longitude_geocode__post)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**

```bash
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**

<table><thead><tr><th>Code</th><th>Details</th></tr></thead><tbody><tr><td>200</td><td><p><strong>Response body</strong></p><p>Download</p><pre class="language-json"><code class="lang-json">{
</code></pre></td></tr><tr><td>"latitude": 47.64971,</td><td></td></tr><tr><td>"longitude": -117.39764</td><td></td></tr><tr><td><p>}</p><p><strong>Response headers</strong></p><pre><code> 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 
</code></pre></td><td></td></tr></tbody></table>

**Responses**

<table><thead><tr><th>Code</th><th>Description</th><th>Links</th></tr></thead><tbody><tr><td>200</td><td><p>Successful Response</p><p>Media typeapplication/jsonControls <code>Accept</code> header.</p><ul><li>Example Value</li><li>Schema</li></ul><pre class="language-json"><code class="lang-json">"string"
</code></pre></td><td><em>No links</em></td></tr><tr><td>422</td><td><p>Validation Error</p><p>Media typeapplication/json</p><ul><li>Example Value</li><li>Schema</li></ul><pre class="language-json"><code class="lang-json">{
</code></pre></td><td></td></tr><tr><td>"detail": [</td><td></td><td></td></tr></tbody></table>

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

] } | *No links* |

**Schemas**

HTTPValidationError{

|        |              |
| ------ | ------------ |
| detail | Detail\[...] |
|        |              |

}ValidationError{

|        |                                    |
| ------ | ---------------------------------- |
| loc\*  | Location\[...]                     |
| msg\*  | <p>string<br>title: Message</p>    |
| type\* | <p>string<br>title: Error Type</p> |
|        |                                    |

}

![](/files/ru4id06R9yHqlMRHDsVG)


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://bryan-guner.gitbook.io/my-docs/lambda-labs/docs/ds-ap.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
