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)
Name | Content-Type | Description |
---|---|---|
string; any value | application/json | Description 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)
Name | Content-Type | Description |
---|---|---|
string; any value | application/octet-stream | Content is Document binary |
Form part 3 (optional)
Name | Content-Type | Description |
---|---|---|
string; any value | image/png | Content 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"}]