/notifications_api

User Notifications API

Primary LanguageRuby

Small Notifications API

  • This API exposes user notification data for this Small Notifications App
  • It's built using Rails 5.2.8 with a Postgres database
  • Ruby version 2.7.2

Getting Started

  • Clone this repo
  • run bundle install with the project directory

Database setup

  • If you don't have Postgres setup, follow these instructions here
  • rails db:setup
  • rails db:seed

Run the tests

bundle exec rspec

Start the server

rails s -p 5000

Database Schema

Screen Shot 2022-05-25 at 4 49 01 PM

Endpoints

Notifications

Request

GET /api/v1/user/notifications

Response

{
    "data": [
        {
            "id": "1",
            "type": "notifications",
            "attributes": {
                "content": "Your articles of incorporation are complete!",
                "formatted_time": "Sat May 21"
            }
        },
        {
            "id": "2",
            "type": "notifications",
            "attributes": {
                "content": "Your application for EIN has been successfully completed",
                "formatted_time": "Sat May 21"
            }
        },
        {
            "id": "3",
            "type": "notifications",
            "attributes": {
                "content": "Your application for EIN has been successfully completed",
                "formatted_time": "Sat May 21"
            }
        }
    ]
}