Coder Social home page Coder Social logo

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 comments GET '/:promo_id/comments'

Will get you the JSON file of all comments ot the promo :promo_id. E.g:

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

Post a comment POST '/:promo_id/comments'

Will post a new comment on our API's database for the promo :promo_id. 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",
  "promo_id": 1,
  "created_at": "2014-11-06T14:23:49.323Z",
  "updated_at": "2014-11-06T14:23:49.323Z"
}

wagon-chat-api's People

Contributors

papillard avatar ssaunier avatar

Watchers

James Cloos avatar Jordi Fernandez 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.