GithubHelp home page GithubHelp logo

aimeric33 / wagon-chat-api Goto Github PK

View Code? Open in Web Editor NEW

This project forked from lewagon/wagon-chat-api

0.0 0.0 0.0 69 KB

Wagon chat API for challenge @LeWagon

JavaScript 3.28% Ruby 77.06% CSS 1.97% HTML 17.27% SCSS 0.31% Procfile 0.12%

wagon-chat-api's Introduction

Wagon-Chat API documentation

An API (Application Programming Interface) is just like a web-site that communicates raw data (like JSON) instead of well structured and designed data (like HTML/CSS). You can see an API as the poor-version of a standard website meant to be used by computers, not by human beings.

  • An API is designed for communication between machines
  • A standard website has a nicer human-readable interface as it's designed for humans. You can see a website as a "AHI" (Application Human Interface).

APIs are everywhere and proposed by all serious services. Here you'll read your first API documentation on a very simple example, the wagon-chat API!

Base URL

The base URL of the API is https://wagon-chat.herokuapp.com/. Feel free to test the API using Postman or in the JS console directly.

Get messages GET '/:channel/messages'

Will get you the JSON file of all messages for the batch :channel. E.g:

{
  "channel": "general",
  "messages": [
    {
      "id": 1,
      "author": "Boris",
      "content": "Salut",
      "channel": "general",
      "created_at": "2014-11-06T14:23:26.104Z",
      "updated_at": "2014-11-06T14:23:26.104Z"
    },
    {
      "id": 2,
      "author": "Seb",
      "content": "Yo",
      "channel": "general",
      "created_at": "2014-11-06T14:23:49.323Z",
      "updated_at": "2014-11-06T14:23:49.323Z"
    }
  ]
}

Post a comment POST '/:channel/messages'

Will post a new comment on our API's database for the promo :channel. In the request body, you have to send the details of the post, in the following JSON format:

{
  "author": "Seb",
  "content": "Yo Yo Yo"
}

The API will respond with the full details of the comment you've posted (in JSON format), e.g:

{
  "id": 8,
  "author": "Seb",
  "content": "Yo Yo Yo",
  "channel": "general",
  "created_at": "2014-11-06T14:23:49.323Z",
  "updated_at": "2014-11-06T14:23:49.323Z"
}

wagon-chat-api's People

Contributors

ssaunier avatar papillard avatar dependabot[bot] avatar eschults avatar caioertai avatar dmilon avatar davidbordeleau avatar grmnlrt avatar yannklein avatar db0sch 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.