6.1 Create and Upload Document

POST https://{{domain}}/api/v2/document

Adds a document along with its metadata and optional thumbnail. The DocumentGUID is returned in the response.

Request:

Content-Type: multipart/form-data

Form part 1 (required)

NameContent-TypeDescription
string; any valueapplication/jsonDescription and meta data of Document

JSON object schema

  • DocumentGUID (guid, optional) :
    In case of existing document GUID specified it will be updated;
  • Name (string, required) : Name of the document
  • Meta (object, required) : Meta information about the document containing:
    • Size (integer, optional) : Size in bytes, default null
    • Pages (array, required) : Array containing information about each page in the document.
      • Width (real, required) : Width in Units
      • Height (real, required) : Height in Units
  • IsAsset (boolean, optional, default false) : Defines if the document is an Asset
  • IsTemporary (boolean, optional, default false) : When set the source file of the document will be deleted when the document is deleted

Form part 2 (optional)

NameContent-TypeDescription
string; any valueapplication/octet-streamContent is Document binary

Form part 3 (optional)

NameContent-TypeDescription
string; any valueimage/pngContent is Document Thumbnail binary

Response:

200 OK

{ "Message": "Document successfully saved",
"DocumentGUID": "guid",
"ResourceId": "guid" }

Request Body

[{"name"=>"DocumentMetadata.json", "value"=>"", "datatype"=>"null"}, {"name"=>"DocumnetBinary.pdf", "value"=>"", "datatype"=>"null"}, {"name"=>"DocumentThumbnail.png", "value"=>"", "datatype"=>"null"}]