Skip to content
federicodallo17 edited this page Mar 5, 2025 · 1 revision

API

Content

  1. Authentication
  2. Posts

Authentication

Sign up - POST /auth/sign_up

Creates a user with the given data, requirese an email and a password (8 characters, number and special character required)

Input

{
    "email": "example@neocoast.com",
    "password": "Password1!"
}

Outputs

If correct input

{
  status: 200,
  response: {
    "success": "true"
  }
}

If invalid password

{
  status: 422,
  response: {
    "message": "Password must cointain at least 8 characters"
  }
}

Sign in - POST /auth/sign_in

Logs in as an already created user

Input

{
    "email": "example@neocoast.com",
    "password": "Password1!"
}

Outputs

If correct input

{
  status: 200,
  response: {
    "success": "true"
  }
}

If incorrect email or password

{
  status: 401,
  response: {
    "message": "Invalid email or password"
  }
}

Posts

Index posts - GET /posts

Shows every post available to the user, paginated per 25 posts.

Input

{
    "page": 1,
    "per_page": 25
}

Outputs

{
  status: 200,
  response: {
    "success": "true"
  }
}
Clone this wiki locally