Public Repository

Last pushed: a year ago
Short Description
A simple mock API that returns randomized responses when attempting to create an assistance request.
Full Description

Fake API

A simple mock API that returns randomized responses when attempting to create an assistance request.

# Run the Fake API in the foreground
docker run -p 49567:49567 uniteus/fake_api:latest

Supported End-Points

All end points return only JSON to the client.

GET /api/service-types

Return the available service types for assistance requests.

Request

GET /api/service-types HTTP/1.1
Host: localhost:49567
Content-Type: application/json
Accept: application/json
Cache-Control: no-cache

Response

{
    "data": [
        {
            "display_name": "Benefits",
            "id": "benefits"
        },
        {
            "display_name": "Employment",
            "id": "employment"
        },
        {
            "display_name": "Healthcare",
            "id": "healthcare"
        },
        {
            "display_name": "Housing",
            "id": "housing"
        },
        {
            "display_name": "Legal",
            "id": "legal"
        }
    ]
}

POST /api/assistance-requests

Create a new assistance request (nothing is persisted). The following responses are returned, at random.

Status Code Message
201 "Your assistance request has been successfully submitted."
401 "Sorry, you are not authorized to make this request."
500 "Oh no! Something completely unexpected happened!"
503 "We're down!!!!!! Come back later.....(please)"

Request

POST /api/assistance-requests HTTP/1.1
Host: localhost:49567
Content-Type: application/json
Accept: application/json
Cache-Control: no-cache

{
  "assistance_request": {
    "contact": {
      "first_name": "Ulysses",
      "last_name": "Grant",
      "email": "ulysses@union.mil"
    },
    "service_type": "benefits",
    "description": "The friend in my adversity I shall always cherish most. I can better trust those who have helped to relieve the gloom of my dark hours than those who are so ready to enjoy with me the sunshine of my prosperity."
  }
}

Successful Response

{
    "echo": {
        "assistance_request": {
            "service_type": "benefits",
            "description": "The friend in my adversity I shall always cherish most. I can better trust those who have helped to relieve the gloom of my dark hours than those who are so ready to enjoy with me the sunshine of my prosperity.",
            "contact": {
                "first_name": "Ulysses",
                "last_name": "Grant",
                "email": "ulysses@union.mil"
            }
        }
    },
    "message": "Your assistance request has been successfully submitted."
}
Docker Pull Command
Owner
uniteus

Comments (0)