A microservice to manage data about visits of users.
- Creates a user in the db
name
should be a non-empty, alphanumeric value
Headers
Content-Type: 'application/json'
Example JSON body
{
"name": "Randy Marsh"
}
- Creates a visit for the specified user
location
should be a non-empty, alphanumeric valueuserId
is the ID provided to you when the user record was created via thePOST /user
endpoint
Headers
Content-Type: 'application/json'
Example JSON body
{
"location": "Whole Foods, Columbus Circle",
"userId": 1
}
- Required path parameter:
visitId
- Returns exactly one Visit object in a JSON array pertainin to the visitId
Example response
[
{
"visitId": 4,
"userId": 1,
"location": "Trader Joe's, DUMBO"
}
]
- Required query parameters:
userId
&searchString
- Returns JSON array of visit objects. These objects are queried using fuzzy matching.
Example response
[
{
"visitId": 12,
"userId": 1,
"location": "wasHingTon STATE"
},
{
"visitId": 11,
"userId": 1,
"location": "WASHINGTON DC"
},
{
"visitId": 10,
"userId": 1,
"location": "WASHINGTON HEIGHTS"
},
{
"visitId": 5,
"userId": 1,
"location": "washington square park"
}
]