Git Product home page Git Product logo

message_board's Introduction

Message Board API

Epicodus Practice in Ruby on Rails, December 11, 2017

By Kelsey Langlois

Description

This is an API for an example message board. It allows users to sign up, view groups and messages, log in, and create/update/delete their own messages.

Installation and Setup

To install on your own machine, follow the instructions below:

  • Clone this repository.
  • Run the following commands in the project root directory:
    bundle update
    rake db:setup
    rails db:seed
    rails s -p 3001
    
  • Open localhost:3001 in your web browser

Specifications

Version 1

Authorization

All API calls besides creating a new user require an api key.

Posting, editing, and deleting messages requires an authentication token acquired from the Post /authenticate in addition to the api key.

Limited to 1000 requests per day per api key.

API calls:

Preface all api calls with /api/v1

  • Post /users
    • Parameters
      • email: string (required)
      • name: string (required)
      • password: string (required)
    • Creates an account with the given user name, email, and password, and returns the user's api key.
  • POST /authenticate
    • Parameters
      • key: string (required)
      • email: string (required)
      • password: string (required)
    • Returns an authentication token for the user with provided email and password.
  • GET /groups
    • Parameters
      • key: string (required)
    • Returns all groups.
  • GET /groups/{group_id}
    • Parameters
      • key: string (required)
    • Returns information about the group with provided group_id.
  • GET /groups/{group_id}/messages
    • Parameters
      • key: string (required)
      • start_time: timestamp (optional)
      • end_time: timestamp (optional)
    • Returns all messages for the group with provided group_id. Limits to messages created between start_time and end_time if both params are provided.
  • POST /groups/{group_id}/messages
    • Headers
      • Authorization: string (required)
    • Parameters
      • key: string (required)
    • Posts a new message to the group with provided group_id.
  • PUT /groups/{group_id}/messages/{message_id}
    • Headers
      • Authorization: string (required)
    • Parameters
      • key: string (required)
    • Edits the message with provided message_id in group with group_id.
  • DELETE /groups/{group_id}/messages/{message_id}
    • Headers
      • Authorization: string (required)
    • Parameters
      • key: string (required)
    • Deletes the message with provided message_id in group with group_id.

Support and contact details

Please contact [email protected] with questions, comments, or issues.

Technologies Used

  • Ruby
  • Rails
  • Rack::Throttle

Token-Based Authentication from this tutorial.

License

Copyright (c) 2017 Kelsey Langlois

This software is licensed under the MIT license.

message_board's People

Contributors

langlk avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.