File API Resource

HDC WS for getting file content

POST /api/file/convert2drawing

Request Body
media type data type description
application/json array of HdcContentIdModelTO (JSON) list of objects with attachments to transform to drawings
Response Body
media type data type description
application/json HdcPathProcessStateTO (JSON) started transformation process state

Example of response:

{"processId":"f8b29857-da2e-4464-a40d-9a14908cad30","state":"4","userName":"olo","userId":20,"startDate":"2019-10-10T16:21:08.573062400+02:00","operationType":"GroupRasterTransformation","processTypeId":12}

Example

Request
POST /api/file/convert2drawing
Content-Type: application/json
Accept: application/json

                
[ { } ]
                
              
Response
HTTP/1.1 201 Created
Content-Type: application/json

                
{ }
                
              

GET /api/file/{fileId}

Get binary representation of given file

Request Parameters
name type description constraints
Range header  
fileId path The unique identifier of file long
download query Boolean parameter. If set true returned binary representation will be prepared to save. boolean
Response Body
media type data type description
application/json object (JSON) Binary representation of file
application/pdf object
application/zip object
image/* object

Example

Request
GET /api/file/{fileId}
Content-Type: */*
Accept: application/json
Range: ...

                
...
                
              
Response
HTTP/1.1 200 OK
Content-Type: application/json

                
...
                
              

POST /api/file/{fileId}

Request Parameters
name type description constraints
fileId path long
Response Body
media type data type description
application/json object (JSON)

Example

Request
POST /api/file/{fileId}
Content-Type: */*
Accept: application/json

                
...
                
              
Response
HTTP/1.1 201 Created
Content-Type: application/json

                
...
                
              

GET /api/file/dziinfo/{fileId}

Get dzi info of given file

Request Parameters
name type description constraints
fileId path The unique identifier of file long
Response Body
media type data type description
application/json HdcTileTO (JSON) JSON Response with tile information Example of response:

{format: "png", overlap: 1, tileSize: 1024, width: 99213, height: 70157}

Example

Request
GET /api/file/dziinfo/{fileId}
Content-Type: */*
Accept: application/json

                
...
                
              
Response
HTTP/1.1 200 OK
Content-Type: application/json

                
{
  "overlap" : 12345,
  "fileId" : 12345,
  "height" : 12345,
  "tileSize" : 12345,
  "levels" : 12345,
  "format" : "...",
  "width" : 12345
}
                
              

GET /api/file/info/{fileId}

Get information about file.

Request Parameters
name type description constraints
fileId path The unique identifier of file long
Response Body
media type data type description
application/json object (JSON) JSON Response with file information

Example of response:

{"md5":"ccc7fd75e33e59d041d5b98fe8b1e335","path":"path_to_file","size":1520296,"mimeType":"application/pdf","fileName":"floor_plan.pdf","contextId":0,"originalId":0}

Example

Request
GET /api/file/info/{fileId}
Content-Type: */*
Accept: application/json

                
...
                
              
Response
HTTP/1.1 200 OK
Content-Type: application/json

                
...
                
              

GET /api/file/status/{fileId}

Get information about file status and it's derived (converted) form.

Request Parameters
name type description constraints
fileId path The unique identifier of file long
Response Body
media type data type description
application/json HdcFileStateTO (JSON) JSON Response with file information

Example of response:

{id: 123,derivedId: 124,state: "CONVERTED", mimeType: "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"}

Example

Request
GET /api/file/status/{fileId}
Content-Type: */*
Accept: application/json

                
...
                
              
Response
HTTP/1.1 200 OK
Content-Type: application/json

                
{
  "pagingOffset" : 12345,
  "derivedMimeType" : "...",
  "derivedId" : 12345,
  "id" : 12345,
  "mimeType" : "...",
  "pagingLimit" : 12345,
  "errorMessage" : "...",
  "versionId" : 12345,
  "contentType" : "External",
  "state" : "CONVERTING"
}
                
              

DELETE /api/file/{classId}/{objectId}

Remove binary file from specified object

Request Parameters
name type description constraints
classId path The unique identifier of object class. long
objectId path The unique identifier of object. long
Response Body
media type data type description
application/json HdcSuccessTO (JSON) JSON Response with information, whether the removing has or has not been succeeded.

Example

Request
DELETE /api/file/{classId}/{objectId}
Content-Type: */*
Accept: application/json

                
...
                
              
Response
HTTP/1.1 204 No Content
Content-Type: application/json

                
{ }
                
              

POST /api/file/{classId}/{objectId}

Upload file and attach it to given object

Request Parameters
name type description constraints
classId path The unique identifier of object class. long
objectId path The unique identifier of object. long
Request Body
media type data type
multipart/form-data (custom)
Response Body
media type data type description
application/json HdcContentFileModelTO (JSON) JSON Response with information, whether the upload has or has not been succeeded.

Example

Request
POST /api/file/{classId}/{objectId}
Content-Type: multipart/form-data
Accept: application/json

                

                
              
Response
HTTP/1.1 201 Created
Content-Type: application/json

                
{ }
                
              

GET /api/file/convert2drawing/{classId}/{objectId}

Request Parameters
name type description constraints
classId path long
objectId path long
fileId query long
Response Body
media type data type description
application/json object (JSON) json transformed file data with success information

Example of response:

{"result":{"success":true},"contentId":"60569","contentType":2,"subType":0,"viewportId":0,"classId":"113","classLabel":"Architect","objectId":"243048","objectName":"666","isDefault":false,"success":false}

Example

Request
GET /api/file/convert2drawing/{classId}/{objectId}
Content-Type: */*
Accept: application/json

                
...
                
              
Response
HTTP/1.1 200 OK
Content-Type: application/json

                
...
                
              

POST /api/file/form/download/batch

Get binary representation of contents for given object set URLEncoded data

Example of request:

"0=%7B%22objectId%22%3A%2222720%22%2C%22classId%22%3A%22124%22%7D&1=%7B%22objectId%22%3A%2222721%22%2C%22classId%22%3A%22114%22%7D"

Request Body
media type data type
application/x-www-form-urlencoded (custom)
Response Body
media type data type description
application/zip object Zip file with contents

Example

Request
POST /api/file/form/download/batch
Content-Type: application/x-www-form-urlencoded
Accept: application/zip

                
...
                
              
Response
HTTP/1.1 201 Created
Content-Type: application/zip

                
...
                
              

GET /api/file/versions/json/{fileId}

Get information about version of given file

Request Parameters
name type description constraints
fileId path The unique identifier of file long
Response Body
media type data type description
application/json ObjectHistory (JSON) JSON with information about version

Example of response:

{"list":[{"versionDescription":"","versionPublishDate":"2018-03-14T10:46:45.611940Z","versionOperation":"insert","operationDate":"2018-03-14T10:49:46.336744Z","versionId":"5172","isCurrent":"true","dataUserFullName":"Demo User","isMaster":"true","versionOwnerFullName":"Version Owner","versionName":"version description","versionDate":"2018-03-14T10:46:45.611940Z","dataSource":"manual input"}]}

Example

Request
GET /api/file/versions/json/{fileId}
Content-Type: */*
Accept: application/json

                
...
                
              
Response
HTTP/1.1 200 OK
Content-Type: application/json

                
{ }
                
              

GET /api/file/attachmenttile/{fileId}/{level}/{col}/{row}

Get pointed attachment dzi tail

Request Parameters
name type description constraints
col path column number int
fileId path The unique identifier of file long
level path level of tailing int
row path row number int
Response Body
media type data type description
image/* object Binary representation of specified attachment dzi tail

Example

Request
GET /api/file/attachmenttile/{fileId}/{level}/{col}/{row}
Content-Type: */*
Accept: image/*

                
...
                
              
Response
HTTP/1.1 200 OK
Content-Type: image/*

                
...
                
              

GET /api/file/tile/{fileId}/{level}/{col}/{row}

Get pointed raster tail

Request Parameters
name type description constraints
col path column number int
fileId path The unique identifier of file long
level path level of tailing int
row path row number int
Response Body
media type data type description
image/* object Binary representation of specified raster tail

Example

Request
GET /api/file/tile/{fileId}/{level}/{col}/{row}
Content-Type: */*
Accept: image/*

                
...
                
              
Response
HTTP/1.1 200 OK
Content-Type: image/*

                
...