NLW Valoriza (1.0.0)

Download OpenAPI specification:Download

The rest api of a simple compliments system, just for learning porpouses.

user

Everything about the users

Creates a new user

If you not authenticated yet you should register yourself

Request Body schema: application/json

Created user object

name
string
email
string
password
string
admin
boolean

Responses

Request samples

Content type
application/json
{
  • "name": "string",
  • "email": "string",
  • "password": "string",
  • "admin": true
}

Response samples

Content type
application/json
{
  • "id": 0,
  • "name": "string",
  • "password": "string",
  • "admin": true,
  • "created_at": "string",
  • "updated_at": "string"
}

List all users in the system

If you are an admin user you can check all existing users in the system

Responses

Response samples

Content type
application/json
[
  • {
    }
]

List all sent compliments

Will list all compliments which you have been the sender

Responses

Response samples

Content type
application/json
[
  • {
    }
]

List all received compliments

Will list all compliments which you have been the receiver

query Parameters
includes
Array of any
Items Enum: "sender" "receiver" "tag"

Idicates which entiry relation should be displayed on response

Responses

Response samples

Content type
application/json
[
  • {
    }
]

compliment

The compliments history

Creates a new compliment

If you not authenticated yet you should register yourself

Request Body schema: application/json

Created user object

tag_id
string
user_receiver
string
message
string

Responses

Request samples

Content type
application/json
{
  • "tag_id": "string",
  • "user_receiver": "string",
  • "message": "string"
}

Response samples

Content type
application/json
{
  • "id": "string",
  • "user_sender": "string",
  • "user_receiver": "string",
  • "tag_id": "string",
  • "message": "string",
  • "created_at": "string"
}

tag

The default tags registered

Creates a new tag

You can create if you want use a new tag

Request Body schema: application/json

Tag information

name
string

Responses

Request samples

Content type
application/json
{
  • "name": "string"
}

Response samples

Content type
application/json
{
  • "id": "string",
  • "name": "string",
  • "created_at": "string",
  • "updated_at": "string"
}

List all available tags

You can check it out all the tags in the system

Responses

Response samples

Content type
application/json
[
  • {
    }
]

authentication

System authorization

Authenticates an user

If you not authenticated yet you should ahthenticate getting your access token

Request Body schema: application/json

Authenticates an user

email
string
password
string

Responses

Request samples

Content type
application/json
{
  • "email": "string",
  • "password": "string"
}

Response samples

Content type
application/json
{
  • "token": "string"
}