Eviction functions

These functions are used in the eviction SMS project.

Eviction intake settings

Function name: eviction-intake-settings

Parameters: event.flow_id which is the phone number associated with an executed flow. This is used to direct requests to production or staging based on a phone number.

Returns: An object containing:

  • id, the uuid for the intake settings

  • callback_number

  • node_id, the intake settings ID for the custom entity

  • callback_type

  • bypass, the bypass message

  • disclaimer

  • please_call, the please call message

  • we_call, the we call the client message

  • legalservername, the name specifically required by Legal Server for etransfer

  • organization, the organization name from our website to display to the user

Requires: Access to the ILAO’s API for intake settings.

Eviction content

Function name: eviction-content

Parameters: event.legal_issue, which is an integer representing the user’s selected legal issue.

Returns: A string which includes the titles and links of relevant content to return.

Requires: This is hand-coded but future iterations may use the ILAO’s API.

Note

This function will be updated to accommodate language codes.

HUD housing counselors

Function name: hud-housing-counselors

Parameters: event.zip, which is the zip code of the user.

Returns: An object containing:

  • An array of options. Each option contains:

    • name

    • address

    • city

    • phone

    • weburl

    • methods (counseling methods)

    • services (services offered)

  • A total, which is a number reflecting the total number of options.

Requires: Access to the JSON files containing housing data: https://files.consumerfinance.gov/a/assets/hud/jsons/[zipcode].json

Note

This function should be updated to return Spanish results when appropriate.