Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

  • Expose directory structure-like URIs.
  • Transfer XML, JavaScript Object Notation (JSON), or both.
  • Use HTTP methods explicitly.
  • Be stateless.

DocStore API as per design principles of REST

6.1   Create

Create one or more documents with text content:

URL

http://localhost:8080/ oledocstore/documents

 

Method

POST

 

Request body

POST XML

Request XML

Returns

201 Created & Location

Response XML
Need to add "Location" field for each document in response xml

 

401 Unauthorized

 

 

415 Unsupported Media Type

 

 

Modify a document:

If the specified document does not exist, it is not created by this command.Create a documents with binary content (PDF, DOC etc)

URL

http://localhost:8080/ oledocstore/documents/[uuid]

 

Method

PUT POST

 

Request body

XML

Request XML Multi-part binary

Bag content

Returns

200 OK

  201 Created & Location

Response XML

 

401 Unauthorized

 

 

404 Not Found

 

 

415 Unsupported Media Type

 

Modify one or more documents:

If the specified document does not exist, it is not created by this command.6.2   Retrieve

Retrieve a document (Checkout)

URL

http://localhost:8080/ oledocstore/documents/[uuid]

 

Method

PUT GET

 

Request Body

XML

Request XML

Returns

200 OK  & XML or other content

XML or binary content of the document

 

401 Unauthorized

 

 

404 Not Found

 

 

Q: How to handle authentication? (identification of user)

Retrieve (references to) one or more documents: (like getUUIDs function in docstore)

URL

http://localhost:8080/ oledocstore/documents

 

Method

GET

 

Query string

category=
type=
format=
start=
end=

 

Returns

200 OK and XML

Response xml with start, end, and next(url) fields
and link info about documents in this page

 

401 Unauthorized

 

 

404 Not Found

 

Retrieve one or more documents with binary content (PDF, DOC etc)

URL

http://localhost:8080/ oledocstore/documents

 

Method

GET

 

Query string

requestContent=

Request XML

Returns

201 Created & Location

Bag content with response.xml and content files (PDF, DOC etc)

 

401 Unauthorized

 

 

415 Unsupported Media Type

 

6.3   Update

If the specified document does not exist, it is not created by this command.

Modify a document:

URL

http://localhost:8080/ oledocstore/documents/[uuid]

 

Method

PUT

 

Request

XML

Request XML

Returns

200 OK and response XML

Response XML

 

401 Unauthorized

 

 

404 Not Found

 

 

415 Unsupported Media Type

 


Retrieve a documentModify one or more documents:

URL

http://localhost:8080/ oledocstore/documents/[uuid]

Method

GET

 

Method

PUT

 

Request Body

XML

Request XML

Returns

200 OK & and response

Response XML

 

401 Unauthorized

 

 

404 Not Found

...

 

 

415 Unsupported Media Type

 

Modify one or more documents with binary content (PDF, DOC etc):

URL

http://localhost:8080/ oledocstore/documents

Method

GET

Query string

Category=
Type=
Format=
Start=
End=

 

  

Method

PUT

 

Request Body

Multi-part binary

Bag content

Returns

200 OK and response

Response XML

 

401 Unauthorized

 

 

404 Not Found

 

 

415 Unsupported Media Type

 

6.4   Delete


Delete a document:

URL

http://localhost:8080/ oledocstore/ documents/[uuid]

 

Method  

DELETE

 

Returns

204 No Content
On success, no response body is returned.

 

 

401 Unauthorized

 

 

404 Not Found

 

 

415 Unsupported Media Type

 

Delete one or more documents

URL

http://localhost:8080/ oledocstore/ documents/

 

Method

DELETE

 

Request Body

XML

Request XML

Returns

200 OK and response

  Response XML

 

401 Unauthorized

 

 

404 Not Found

 

 

415 Unsupported Media Type

 

...