admin/md/api_docs.md
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 |
### docs (LiteStore Documents) A document is the main resource type managed by LiteStore. Any LiteStore document can be represented as a JSON object exposing the following properties: * id: The unique identifier of the document. * data: The document contents (base64-encoded if binary). * created: The document creation date expressed as combined date and time in UTC ([ISO 8601](http://en.wikipedia.org/wiki/ISO_8601) compliant). * modified: The document modification date (if applicable) expressed as combined date and time in UTC ([ISO 8601](http://en.wikipedia.org/wiki/ISO_8601) compliant). * tags: A list of tags associated to the document. #### Example Document ``` { "id": "test_document", "data": "This is a test document", "created": "2015-02-07T10:36:09Z", "modified": null, "tags": ["$type:text", "$subtype:plain", "$format:text", "another_tag"] } ``` #### OPTIONS docs Returns the allowed HTTP verbs for this resource. ##### Example ``` $ curl -i -X OPTIONS http://127.0.0.1:9500/docs HTTP/1.1 200 OK Content-Length: 0 Access-Control-Allow-Methods: HEAD,GET,OPTIONS,POST Allow: HEAD,GET,OPTIONS,POST Access-Control-Allow-Headers: Content-Type Access-Control-Allow-Origin: * Server: LiteStore/1.0.0 ``` #### OPTIONS docs/:id Returns the allowed HTTP verbs for this resource. ##### Example ``` curl -i -X OPTIONS http://0.0.0.0:9500/docs/test HTTP/1.1 200 OK Content-Length: 0 Allow: HEAD,GET,PUT,PATCH,DELETE,OPTIONS ``` #### POST docs ``` $ curl -i -X POST -d 'A document with a randomly-generated ID.' http://127.0.0.1:9500/docs --header "Content-Type:text/plain" HTTP/1.1 201 Created Content-Length: 197 Content-Type: application/json Access-Control-Allow-Headers: Content-Type Access-Control-Allow-Origin: * Server: LiteStore/1.0.0 {"id": "555f93e82190e77500000000", "data": "A document with a randomly-generated ID.", "created": "2015-05-22T08:39:04Z", "modified": null, "tags": ["$type:text", "$subtype:plain", "$format:text"]} ``` #### HEAD docs ``` $ curl -i -X HEAD http://127.0.0.1:9500/docs HTTP/1.1 200 OK Content-Length: 0 Content-Type: application/json Access-Control-Allow-Headers: Content-Type Access-Control-Allow-Origin: * Server: LiteStore/1.0.0 ``` #### HEAD docs/:id ``` $ curl -i -X HEAD http://127.0.0.1:9500/docs/test HTTP/1.1 200 OK Content-Length: 0 Content-Type: application/json Access-Control-Allow-Headers: Content-Type Access-Control-Allow-Origin: * Server: LiteStore/1.0.0 ``` #### GET docs ``` ... ``` ##### Query String Options The following query string options are supported: * **search** * **tags** * **limit** * **offset** * **sort** * **contents** * **raw** #### GET docs/:id ``` $ curl -i http://127.0.0.1:9500/docs/test HTTP/1.1 200 OK Content-Length: 24 Content-Type: text/plain Access-Control-Allow-Headers: Content-Type Access-Control-Allow-Origin: * Server: LiteStore/1.0.0 This is a test document. ``` #### PUT docs/:id ``` $ curl -i -X PUT -d 'This is a test document.' http://127.0.0.1:9500/docs/test --header "Content-Type:text/plain" HTTP/1.1 201 Created Content-Length: 161 Content-Type: application/json Access-Control-Allow-Headers: Content-Type Access-Control-Allow-Origin: * Server: LiteStore/1.0.0 {"id": "test", "data": "This is a test document.", "created": "2015-05-22T08:40:00Z", "modified": null, "tags": ["$type:text", "$subtype:plain", "$format:text"]} ``` #### PATCH docs/:id ``` ... ``` #### DELETE docs/:id ``` ... ``` |