Prototype RoR REST#

Introduction#

I'd like a RoR REST end point created to serve as a framework where Rails acts as the REST (CRUD) application server into a further REST interface as the data source

Development Environment#

The following has been setup as a sandbox for this

http://6d00711d.ngrok.io/api/login - POST using {
    "username": "martine",
    "password": "pw"
}

this will return the following json string:

{
    "_id": "martine",
    "_links": [
        "http://6d00711d.ngrok.io/api/employees/4325"
    ],
    "company": "edhealnsw",
    "db_id": "4325",
    "name": "APARNA MUKHERJEE",
    "role": "employee",
    "type": "user"
}

then using a GET, to get an employee record for "4325"

GET http://6d00711d.ngrok.io/api/employee/4325

will return the following json string:

"_links": {
        "collection": {
            "href": "http://6d00711d.ngrok.io/api/employees"
        },
        "expiries": {
            "description": "Licences and their expiry dates for employee 4325",
            "href": "http://6d00711d.ngrok.io/api/employees/4325/expiries",
            "method": "GET"
        },
        "notifications": {
            "description": "Notifications for employee 4325",
            "href": "http://6d00711d.ngrok.io/api/employees/4325/nfns",
            "method": "GET, POST"
        },
        "photo": {
            "description": "Photo of employee 4325",
            "href": "http://6d00711d.ngrok.io/api/employees/4325/image",
            "method": "GET"
        },
        "profile": {
            "description": "Skills and likes of employee 4325",
            "href": "http://6d00711d.ngrok.io/api/employees/4325/profile",
            "method": "GET"
        },
        "self": {
            "href": "http://6d00711d.ngrok.io/api/employees/4325"
        }
    },
    "address": {
        "lat": null,
        "long": null,
        "postcode": 2150,
        "state": "NSW",
        "street": "20/27 STATION STREET WEST",
        "suburb": "PARRAMATTA"
    },
    "birth_date": "17/05/58",
    "contacts": {
        "email": "APARNA1705@YAHOO.COM",
        "home": "0296339260",
        "mobile": "0425255715"
    },
    "employment_date": "16/06/16",
    "gender": "FEMALE",
    "name": {
        "first": "APARNA",
        "last": "MUKHERJEE",
        "preferred": null
    }
}

Requirements#

I would like a Rails 5.x API / REST application server, that uses a further REST service as it's data source