Create an application that helps user transer and store their business cards virtually.
https://bussiness-card-app.herokuapp.com/
The preferred JSON object to be returned by the API should be structured as follows:
Login
{
"status": 200,
"data": [
{
"id": 2,
"first_name": "Ikechukwu",
"last_name": " Nmeregini",
"email": "[email protected]",
"token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWJqZWN0IjoyLCJ1c2VybmFtZSI6Im5tZXJlZ2luaWlrZWNodWt3dUB5YWhvby5jb20iLCJpYXQiOjE1NjQ0MjUzMjgsImV4cCI6MTU2NDUxMTcyOH0.6_njjykrIyMgqctr0hDvKYi8kuyPoHoHz3TFAV2PgrE"
}
]
}
{
"status": 201,
"data": [
{
"first_name": "Ikechukwu",
"last_name": " Nmeregini",
"email": "[email protected]"
}
]
}
"status": 200,
"data": [
{
"id": "1",
"first_name": "Vincent",
"last_name": "Nmeregini",
"email": "[email protected]"
}
]
"status": 201,
"data": [
{
"event_name": "lambda build week",
"event_date : "22/8/2019",
"event_venue" : " zoom",
"event_location": "online",
"user_id" : 2,
}
]
If a request fails any validations, expect errors in the following format:
{
"status": 400,
"message": "User already exists"
}
}
401 for Unauthorized requests, when a request requires authentication but it isn't provided
403 for Forbidden requests, when a request may be valid but the user doesn't have permissions to perform the action
404 for Not found requests, when a resource can't be found to fulfill the request
POST /api/login
Example request body:
{
"user":{
"email": "[email protected]",
"password": "jakejake"
}
}
No authentication required, returns a User
Required fields: email
, password
POST /api/register
Example request body:
{
"email": "[email protected]",
"first_name" : "Ikechukwu",
"last_name" : " Nmeregini",
"password": "12345"
}
No authentication required, returns a User
Required fields: email
, username
, password
GET /api/user/:id
req.header.token = token
Authentication required, returns a User that's the current user
set token on the header and pass the token recieved during Login
POST /api/user/:id/event
where id id the users id
req.header.token = token
Authentication required, returns a User that's the current user set token on the header and pass the token recieved during Login
Example request body:
{
"event_name": "lambda build week",
"event_date : "22/8/2019",
"event_venue" : " zoom",
"event_location": "online",
}