Code Monkey home page Code Monkey logo

komic's Introduction

Komic API

Reference this API documention as necessary. It details all available endpoints with path parameters and HTTP request verbs. Have fun! ##User Register New users must provide an email, username and password. They will be granted an access_token upon registration which must then be passed in the header for all future requests.

  • Path: POST '/users/register'

  • Params:

    • email: string
    • password: string
    • username: string
  • Response:

    • Status Code: 201 if successful, 422 if unsuccessful
    • Example success:
      {
    "user": {
      "id": 1,
      "username": "tjterris",
      "email": "[email protected]",
      "access_token": "c4483f576226dbb213074bfa207412a1"
    }
    

}

* Example Failure:

{ "errors": [ "Email has already been taken", "Username has already been taken" ] }


##User Login
* Path: `POST '/users/login'`
* Params:
  * password: a string
  * username: a string
* Response:
  * Status Code: 201 if successful, 404 if not found
  * Example success:
  
  {

"user": { "id": 1, "username": "tjterris", "email": "[email protected]", "access_token": "c4483f576226dbb213074bfa207412a1" } }

* Example failure: 

{

"message": "No matching username or password found." }


##Show User
* Path: `GET '/user/:id'`
* Params:
* id: a string (ID of user)
* Response:
*Example success: 

{ "user": { "id": 1, "username": "tjterris", "email": "[email protected]" } }


##Show All Users (Index)
* Path: `GET '/users'`
* Params: none
* Response
*Example Response:

{ "users": [ { "id": 1, "username": "tjterris", "email": "[email protected]" }, { "id": 2, "username": "afranco", "email": "[email protected]" }, { "id": 3, "username": "twatts", "email": "[email protected]" } ] }





## Create Image

* Path: ` POST '/images' ` 
* Params: 
* image_url: "string"
* user_id: "integer"
* strip_id: "integer"
* ios: "integer"
* Response:
* Status Code: 200 if successful, 422 if unsuccessful
* Example success: 

{ "image": { "id": 1, "image_url": "http://blog.ghost.org/content/images/2015/03/markdown-guide-1.jpg", "user_id": 1 "strip_id": 1 "ios:" 1 "created_at": "2015-06-19T15:12:38.162Z", "updated_at": "2015-06-19T15:12:38.162Z" } }


## Show Image

* Path: ` GET '/images/:id' `
* Params: 
  * id: "integer"
* Response:
  * Status Code: 200 if successful
  * Example success:

{ "image": { "id": 1, "image_url": "http://blog.ghost.org/content/images/2015/03/markdown-guide-1.jpg", "user_id": 1 "strip_id": 1 "ios:" 1 "created_at": "2015-06-19T15:12:38.162Z", "updated_at": "2015-06-19T15:12:38.162Z" } }


## Show Image(s) w/ Accessories
This endpoint shows only images that have had accessories added and been saved.

* Path: ` GET '/images/edits' `
* Params: none
* Response
    * Status Code: 200 if successful
    * Example success:

{ "strip": { "id": 1, "name": "Comic Gallrey", "strip_url": "www.test.com", "created_at": "2015-06-28T16:43:37.350Z", "updated_at": "2015-06-28T16:45:20.864Z" }, "image": [ { "id": 1, "image_url": "https://comicbookish.s3.amazonaws.com/myImage_1435449153.49107.png", "created_at": "2015-06-27T23:52:34.971Z", "updated_at": "2015-06-28T16:44:11.794Z", "strip_id": 1, "ios": 1, "user_id": 2 }, { "id": 2, "image_url": "https://comicbookish.s3.amazonaws.com/myImage_1435449203.15627.png", "created_at": "2015-06-27T23:53:24.412Z", "updated_at": "2015-06-28T16:44:20.140Z", "strip_id": 1, "ios": 1, "user_id": 1 },

] }

## Show Accessories
* Path: ` GET '/accessories' `
* Params: none
* Response
    * Status Code: 200 if successful
    * Example success:

[ { "id": 12, "accessory_type": "symbol", "name": "hands", "accessory_url": "http://i.imgur.com/LpatKDM.png", "created_at": "2015-06-27T21:08:31.483Z", "updated_at": "2015-06-27T21:08:31.483Z" }, ]

  

komic's People

Contributors

tylerjones1223 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.