You can edit documents via the user interface.
HTTPS requests can be made to https://dbshare.net
. HTTP requests will be 301
redirected to HTTPS, so clients should be configured to follow redirects.
/api/json
Creating a JSON document is accomplished by sending a POST
request to /api/json
. The body of the request should contain valid JSON that will used as the JSON document. Upon successfully storing the JSON blob, a 201
response will be returned. The Location
header in the response will be set to the URL at which the blob can be accessed with a GET
request. The body of the response is the JSON that was stored in the JSON blob.
curl -i -X "POST" -d '{"people":["bill", "steve", "bob"]}' -H "Content-Type: application/json" -H "Accept: application/json" https://dbshare.net/api/json
HTTP/1.1 201 Created
Location: https://dbshare.net/api/json/5226571730043f8b22dadc20
Content-Type: application/json
Transfer-Encoding: chunked
{"people":["bill","steve","bob"]}
In this example, the id of the JSON document is 5226571730043f8b22dadc20
(also known as the documentId
).
/api/json/<documentId>
Retrieving a JSON document is accomplished by sending a GET
request to /api/json/<documentId>
, where <documentId>
is the last part of the URL path returned from the POST
request. Upon successfully retrieving the JSON document, a 200
response will be returned. If no JSON document exists for the given <documentId>
, a 404
response will be returned. The body of the response is the JSON that was stored in the JSON document.
curl -i -H "Content-Type: application/json" -H "Accept: application/json" https://dbshare.net/api/json/5226571730043f8b22dadc20
HTTP/1.1 200 OK
Content-Type: application/json
Transfer-Encoding: chunked
{"people":["bill","steve","bob"]}
/api/json/<documentId>
Updating a JSON document is accomplished by sending a PUT
request to /api/json/<documentId>
. The request body should contain valid JSON that the stored JSON document will be replaced with. Upon successfully storing the new JSON document, a 200
response will be returned. If no JSON document exists for the given <documentId>
, a 404
response will be returned. The body of the response is the JSON that was stored in the JSON document.
curl -i -X "PUT" -d '{"people":["fred", "mark", "andrew"]}' -H "Content-Type: application/json" -H "Accept: application/json" https://dbshare.net/api/json/5226571730043f8b22dadc20
HTTP/1.1 200 OK
Content-Type: application/json
Transfer-Encoding: chunked
{"people":["fred","mark","andrew"]}
/api/json/<documentId>
Deleting a JSON document is accomplished by sending a DELETE
request to /api/json/<documentId>
. Upon successfully deleting the JSON document, a 200
response will be returned. If no JSON document exists for the given <documentId>
, a 404
response will be returned. If deleting blobs is not enabled, a 405
response will be returned.
curl -i -X "DELETE" https://dbshare.net/api/json/5226571730043f8b22dadc20
HTTP/1.1 200 OK