| Back | Main view

IMiS/Storage Connector Services REST - Entity content upload session

Product:IMiS/StorageConnector Services REST
Release:9.8.2110
Date:12/14/2021

Case: IMiS/Storage Connector Services REST - Entity content upload session

Description:

This example demonstrates operations which creates a session for uploading entity content by parts on the IMiS/ARChive Server.
Requests and responses are in JSON format.
Below is a description of operations for the entity content upload session.


1. Create upload session

Operation creates a session for uploading content by parts. Uploading content by parts takes place in several steps; the upload session is created first, followed by the sequential upload of content by parts. The upload finish operation is called to save the object. The delete operation is called to cancel the session for uploading content by parts (the entity close operation deletes all sessions for uploading content by parts).

Request
POST archives/{archiveId}/entities/H:{entityHandle}/create_sessions.json

Headers:
- Authorization: Bearer <session-token>

Body:
{
"content_type": "audio/wav"
}

Response

Body:
{
  "session": {
    "id": "<session-id>"
  }
}

2. Content upload in the upload session

Operation adds content to the session for uploading content by parts. Each part must be uploaded sequentially. The request header must send the size of the content part and the position of the content part in which the dataset is located.

Request
PUT archives/{archiveId}/entities/H:{entityHandle}/create_sessions/{sessionId}

Headers:
- Authorization: Bearer <session-token>
- content-range: [beginning of content part in bytes]-[end of content part in bytes]
- content-length: [size of content part in bytes]

Body:
<content-bytes>

Response

Body:
{
  "session": {
    "id": "<session-id>"
  }
}


3. Saving content in the upload session

Operation saves the content from the session for uploading content by parts to the entity. The request content can send a description of the content and the content container identifier. After a successful save, the session for uploading content by parts is removed.

Request
POST archives/{archiveId}/entities/H:{entityHandle}/create_sessions/{sessionId}/save.json

Headers:
- Authorization: Bearer <session-token>

Body:
{
  "description": "",
  "container_id": ""
}

Response

Body:
{
  "object": {
    "container_id" : "String",
    "id" : "String",
    "description" : "String",
    "size" : 0,
    "created" : "String - datetime",
    "accessed" : "String - datetime",
    "modified" : "String - datetime",
    "content_type" : "String",
    "extension" : "String",
    "effective_rights" : {
      "create_access" : true,
      "delete_access" : true,
      "read_access" : true,
      "write_access" : true
    },
    "child_count" : 0,
    "signed" : false,
    "indexed" : false,
    "parent_id" : "String"
  }
}

4. Canceling the upload session

Operation deletes the session for uploading content by parts.

Request
DELETE archives/{archiveId}/entities/H:{entityHandle}/create_sessions/{sessionId}.json

Headers:
- Authorization: Bearer <session-token>

Response

Operation returns status 200.



Related Documents:

Database 'IMiS Knowledge database', View 'By Product', Document 'IMiS/Storage Connector Services REST - Session' IMiS/Storage Connector Services REST - Session

| Back | Main view