Skip to content

RESTful API bookmark

Guido Krömer edited this page Jan 27, 2014 · 3 revisions

GET api/1/bookmark

Get all bookmarks.

Example response

{
  "status": 200,
  "response": [
    {
      "url":  "https:\/\/github.com/Cacodaimon/CacoCloud", 
      "name": "Cacodaimon/CacoCloud", 
      "date": 1390523848, 
      "id":   1
    },
    {
      "url":  "http:\/\/www.cacodaemon.de", 
      "name": "Cacomania", 
      "date": 1390524132, 
      "id":   2
    },
  ]
}

POST api/1/bookmark

Create a bookmark

Example request

{
  "url":  "http:\/\/www.example.com",
  "name": "Example Com"
}

Example response

{
  "status": 201,
  "response": 3 /*Id of newly added bookmark*/
}

GET api/1/bookmark/:id

Get a bookmark by its id

Example request api/1/bookmark/1

Example response

{
  "status": 200,
  "response": { 
    "url":  "https:\/\/github.com/Cacodaimon/CacoCloud",
    "name": "Cacodaimon/CacoCloud",
    "date": 1390523848,
    "id":   1
  }
}

PUT api/1/bookmark/:id

Edit a bookmark specified by its id

Example request api/1/bookmark/3

{
  "url":  "http:\/\/www.example.com\/",
  "name": "Example Dot Com"
}

Example response

{
  "status":   200,
  "response": 3
}

DELETE api/1/bookmark/:id

Delete a bookmark specified by its id

Example request api/1/bookmark/3

Example response

{
  "status":   200,
  "response": 3
}
Clone this wiki locally