REST API - createDocument - POST

The table summarizes the REST API - createDocument using a POST.

Request - POST

Format
POST <baseurl>/document/createx
				  
Body The document is embedded in the body using mime encoding, or a URL is provided to the location of the document.

If a URL is provided, the acceptable formats are http:// and file://. Note that http URLs only work if the content can be obtained anonymously, that is, not using username/password or any other authentication. For file URLs, network paths are supported if the server is running Windows, for example 'file:////myserver/share/file.doc'. If it is a UNIX server, only files on the local server file system, or network shares that have been mounted on the server's file system, can be accessed.

Response - POST

JSON Returns a JSON representation of the content of the createDocumentResponse element.
XML Returns the content of the createDocumentResponse element (from the DocumentService schema).

Example - POST

Request
POST <baseurl>/document/createx
Body
{
  "CreateDocumentRequest": {
    "owner": { "caseReference": "BDS-1-com.example.ordermodel.Order-1-0" },
    "name": "errors.png",
    "mimeType": "image/png",
    "contentURL": "file:////docserver/Share/errors.png"
  }
}
Response
{ "reference": "DocumentID-64195ab9-5658-4efb-8a53-f432cd7845e5;1.0" }