Skip to content

Routes (API)

Junbong Lee edited this page Feb 23, 2017 · 10 revisions

Meta Information API

[GET] /_info : Get overall server information

Document API

Basic CRUD

[GET] /:key : Get document with specified key

Response body:

{
  "key": "key_of_document"
  "value": "contents of document",
  "_created_at": 1487808000000
  "_expires_at": 1487810000000
}
  • key: Key of this document
  • value: Value of this document
  • _created_at: Timestamp that means when this document created
  • _expires_at: Timestamp that means when this document expired

[POST] /:key : Create new document with specified key

Request body:

/* Entire request body saved as value of document (as string) */

Query param options:

  • ttl : Option that when this document expired in seconds. If not set, document never be expired

Response body:

{
  "key": "key_of_document"
  "value": "contents of document",
  "_created_at": 1487808000000
  "_expires_at": 1487810000000
}
  • key: Key of this document
  • value: Value of this document
  • _created_at: Timestamp that means when this document created
  • _expires_at: Timestamp that means when this document expired

[DELETE] /:key : Remove document with specified key

Advance / Scan API

[GET] /_scan : Scan documents with key matched with specified regular expression

Query param options:

  • from: Key starts from
  • to: Key ends to

Response body:

{
  "documents": [
    /* Key of this document */
    "key": "key_of_document"
    /* Value of this document */
    "value": "contents of document",
    /* Timestamp that means when this document created */
    "_created_at": 1487808000000
    /* Timestamp that means when this document expired */
    "_expires_at": 1487810000000
  ]
}
  • documents: Array of documents as result
  • key: Key of this document
  • value: Value of this document
  • _created_at: Timestamp that means when this document created
  • _expires_at: Timestamp that means when this document expired

[DELETE] /_scan : Delete documents with key matched with specified regular expression

Query param options:

  • from: Key starts from
  • to: Key ends to
Clone this wiki locally