ARCHIVED: KMS REST: Document view

This content has been archived, and is no longer maintained by Indiana University. Information here may no longer be accurate, and links may no longer be available or reliable.

Request

KMS REST document view is a GET request at:

  /v0/document/$docid.(json|xhtml)

$docid is the document ID. It requires Basic Authentication (BasicAuth); pass credentials in the URL or via the Basic header.

The request is the same for both the test and production environments:

  https://rest-test.kb.iu.edu/
  https://rest.kb.iu.edu/
Note:
A request can use either headers or query string parameters or a mixture to pass parameters.
Headers Query string parameters
Accept: Pass the media type you wish returned. Accepted values are application/xhtml+xml and application/json
N/A
Use GET: /v0/document/$docid.json
or GET: /v0/document/$docid.xhtml

Response

  • Requesting a plain XHTML response using Accept: application/xhtml+xml returns a valid XHTML document.
  • Requesting a JSON response wrapper using Accept: application/json returns a JSON object. Example:
    {
       "status": "ok",
       "message": "A MESSAGE",
       "content": "THE XHTML DOCUMENT",
       "version": "THE API VERSION",
       "timestamp": "THE CURRENT TIMESTAMP"
    }

Explanation of response fields

  • status: May be "ok" or "error"
  • message: A simple message indicating the outcome of the response
  • content: The document in XHTML format
  • version: The REST API version requested
  • timestamp: The current timestamp of the request
  • stack: Returned on error when a stack trace is available

This is document bezb in the Knowledge Base.
Last modified on 2023-02-08 14:26:46.