Giter VIP home page Giter VIP logo

mininote's Introduction

Mininote

Mininote is a web service that provides a convenient JSON REST API for work with notes.

For using Mininote you should start MongoDB instance.

#API Reference

###Register new user

Request: POST /user

Request body:

{
	"username": "String",
	"password": "String"
}

Response:

{
	"success": "Boolean",
	"message": "String",
	"data": "None"
}
  • Length of username and password should be no more than 20 characters

cURL example request: curl -i -X POST -H "Content-Type: application/json" -d '{"username":"username","password":"password"}' http://localhost:5000/api/user

###Get list of user's notes

Request: GET /notes

Response:

{
	"success": "Boolean",
	"message": "String",
	"data": [{
	"note_id": "String",
	"subject": "String",
	"creation_time": "Integral",
	"modification_time": "Integral"
	},]
}
  • Service use Basic HTTP Auth; every request must contains username and password
  • If user has not any notes, service return empty list

cURL example request: curl -i -u username:password http://localhost:5000/api/notes

###Get one note

Request: GET /notes/<note_id>

Response:

{
	"success": "Boolean",
	"message": "String",
	"data": {
	"note_id": "String",
	"subject": "String",
	"body": "String",
	"creation_time": "Integral",
	"modification_time": "Integral"
	}
}
  • Service use Basic HTTP Auth; every request must contains username and password

cURL example request: curl -i -u username:password http://localhost:5000/api/notes/<note_id>

###Make note

Request: POST /notes

Request body:

{
	"subject": "String",
	"body": "String"
}

Response:

{
	"success": "Boolean",
	"message": "String",
	"data": "None"
}
  • Service use Basic HTTP Auth; every request must contains username and password

cURL example request: curl -i -u username:password -X POST -H "Content-Type: application/json" -d '{"subject":"Hello world","body":"Lorem ipsum"}' http://localhost:5000/api/notes

###Edit note

Request: PUT /notes/<note_id>

Request body:

{
	"subject": "String",
	"body": "String"
}

Response:

{
	"success": "Boolean",
	"message": "String",
	"data": "None"
}
  • Service use Basic HTTP Auth; every request must contains username and password
  • Send an empty subject or body fielf if you do not need to change it

cURL example request: curl -i -u username:password -X PUT -H "Content-Type: application/json" -d '{"subject":"","body":"Dolor sit amet"}' http://localhost:5000/api/notes/<note_id>

###Delete note

Request: DELETE /notes/<note_id>

Response:

{
	"success": "Boolean",
	"message": "String",
	"data": "None"
}
  • Service use Basic HTTP Auth; every request must contains username and password

cURL example request: curl -i -u username:password -X DELETE -H "Content-Type: application/json" http://localhost:5000/api/notes/<note_id>

mininote's People

Contributors

a-stringfield avatar ahushh avatar

Watchers

 avatar

Forkers

ahushh

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.