D4Science D4Science Don't have a D4Science account? Create one Could not find what you are looking for? Contact us.

WorkspaceManager Resource

Manage the workspace

GET

Get info of an item referred through its path

Request Parameters
name type description
Authorization header Bearer token, see https://dev.d4science.org/how-to-access-resources
exclude query a list of fields to exclude from the returned item
Multivalued
Optional
relPath query relative path
Response Codes
code condition
200 Item retrieved.
406 Item not found.
Response Body
media type data type description
application/json ItemWrapper (JSON) workspace item

Example

Request
GET /?relPath=folder1/folder2/file.txt&exclude=owner
Content-Type: */*
Accept: application/json
Authorization: ...

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

                
{
  "item" : {
    "trashed" : true,
    "externalManaged" : true,
    "shared" : true,
    "locked" : true,
    "publicItem" : true,
    "title" : "...",
    "description" : "...",
    "lastModifiedBy" : "...",
    "lastModificationTime" : 12345,
    "creationTime" : 12345,
    "lastAction" : "MOVED",
    "hidden" : true,
    "ownerNode" : {
      "userName" : "...",
      "userId" : "..."
    },
    "accounting" : {
      "entries" : [ { }, { } ]
    },
    "metadata" : {
      "map" : {
        "property1" : { },
        "property2" : { }
      }
    },
    "owner" : "...",
    "name" : "...",
    "relatedNode" : { },
    "path" : "...",
    "parentId" : "...",
    "id" : "...",
    "parentPath" : "...",
    "primaryType" : "..."
  }
}
                
              

GET /trash

Get info on the trash folder

Request Parameters
name type description
Authorization header Bearer token, see https://dev.d4science.org/how-to-access-resources
exclude query a list of fields to exclude from the returned item
Multivalued
Optional
Response Codes
code condition
200 Success.
Response Body
media type data type description
application/json ItemWrapper (JSON) info on the trash folder

Example

Request
GET /trash
Content-Type: */*
Accept: application/json
Authorization: ...

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

                
{
  "item" : {
    "trashed" : true,
    "externalManaged" : true,
    "shared" : true,
    "locked" : true,
    "publicItem" : true,
    "title" : "...",
    "description" : "...",
    "lastModifiedBy" : "...",
    "lastModificationTime" : 12345,
    "creationTime" : 12345,
    "lastAction" : "UPDATED",
    "hidden" : true,
    "ownerNode" : {
      "userName" : "...",
      "userId" : "..."
    },
    "accounting" : {
      "entries" : [ { }, { } ]
    },
    "metadata" : {
      "map" : {
        "property1" : { },
        "property2" : { }
      }
    },
    "owner" : "...",
    "name" : "...",
    "relatedNode" : { },
    "path" : "...",
    "parentId" : "...",
    "id" : "...",
    "parentPath" : "...",
    "primaryType" : "..."
  }
}
                
              

DELETE /trash/empty

Empty the trash folder

Request Parameters
name type description
Authorization header Bearer token, see https://dev.d4science.org/how-to-access-resources
exclude query a list of fields to exclude from the returned item
Multivalued
Optional
Response Codes
code condition
200 Trash emptied.
Response Body
media type data type description
text/plain string trash folder id

Example

Request
DELETE /trash/empty
Content-Type: */*
Accept: text/plain
Authorization: ...

                
...
                
              
Response
HTTP/1.1 200 OK
Content-Type: text/plain

                
5f4b3b4e-4b3b- ... -4b3b4e4b3b4e
                
              

PUT /trash/restore

Restore a trashed item.

Request Parameters
name type description
destinationId form destination folder id
trashedItemId form item id
Authorization header Bearer token, see https://dev.d4science.org/how-to-access-resources
exclude query a list of fields to exclude from the returned item
Multivalued
Optional
Request Body
media type data type
application/x-www-form-urlencoded (custom)
Response Codes
code condition
200 Item restored.
406 Source or destination item does not exist.
409 Source and destination are the same item.
415 Wrong content type.
Response Body
media type data type description
application/json string (JSON) id of the restored item

Example

Request
PUT /trash/restore
Content-Type: application/x-www-form-urlencoded
Accept: application/json
Authorization: ...

trashedId=17dae181-f33c- ... - 3fa22198dd30&destinationId=19863b4e-b33f- ... -5b6d2e0e1eee

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

                
...
                
              

POST /volatile

Upload a file in the volatile area

Request Parameters
name type description
file form multipart/form-data file parameter, with optional 'filename' and 'size' (see example below)
Authorization header Bearer token, see https://dev.d4science.org/how-to-access-resources
exclude query a list of fields to exclude from the returned item
Multivalued
Optional
Request Body
media type data type
multipart/form-data (custom)
Response Codes
code condition
200 File created.
400 File not provided.
415 Wrong content type.
500 Wrong set of parameters.
Response Body
media type data type description
text/plain string public link to the created file

Example

Request
POST /volatile
Content-Type: multipart/form-data
Accept: text/plain
Authorization: ...

--------boundaryString
Content-Disposition: form-data; name="file"; filename="doc.pdf"; size=426018;
Content-Type: application/pdf

(data)
--------boundaryString--

                
...
                
              
Response
HTTP/1.1 200 OK
Content-Type: text/plain

                
...
                
              

GET /vrefolder

Get info on the VRE folder associated to the current token

Request Parameters
name type description
Authorization header Bearer token, see https://dev.d4science.org/how-to-access-resources
exclude query a list of fields to exclude from the returned item
Multivalued
Optional
Response Codes
code condition
200 Success.
Response Body
media type data type description
application/json ItemWrapper (JSON) VRE folder info

Example

Request
GET /vrefolder
Content-Type: */*
Accept: application/json
Authorization: ...

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

                
{
  "item" : {
    "trashed" : true,
    "externalManaged" : true,
    "shared" : true,
    "locked" : true,
    "publicItem" : true,
    "title" : "...",
    "description" : "...",
    "lastModifiedBy" : "...",
    "lastModificationTime" : 12345,
    "creationTime" : 12345,
    "lastAction" : "CLONED",
    "hidden" : true,
    "ownerNode" : {
      "userName" : "...",
      "userId" : "..."
    },
    "accounting" : {
      "entries" : [ { }, { } ]
    },
    "metadata" : {
      "map" : {
        "property1" : { },
        "property2" : { }
      }
    },
    "owner" : "...",
    "name" : "...",
    "relatedNode" : { },
    "path" : "...",
    "parentId" : "...",
    "id" : "...",
    "parentPath" : "...",
    "primaryType" : "..."
  }
}
                
              

GET /vrefolder/recents

Get a list of recent documents from VRE folders

Request Parameters
name type description
Authorization header Bearer token, see https://dev.d4science.org/how-to-access-resources
exclude query a list of fields to exclude from the returned item
Multivalued
Optional
Response Codes
code condition
200 Success.
Response Body
media type data type description
application/json ItemList (JSON) list of recent documents

Example

Request
GET /vrefolder/recents
Content-Type: */*
Accept: application/json
Authorization: ...

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

                
{
  "itemlist" : [ {
    "trashed" : true,
    "externalManaged" : true,
    "shared" : true,
    "locked" : true,
    "publicItem" : true,
    "title" : "...",
    "description" : "...",
    "lastModifiedBy" : "...",
    "lastModificationTime" : 12345,
    "creationTime" : 12345,
    "lastAction" : "CREATED",
    "hidden" : true,
    "ownerNode" : {
      "userName" : "...",
      "userId" : "..."
    },
    "accounting" : {
      "entries" : [ { }, { } ]
    },
    "metadata" : {
      "map" : {
        "property1" : { },
        "property2" : { }
      }
    },
    "owner" : "...",
    "name" : "...",
    "relatedNode" : { },
    "path" : "...",
    "parentId" : "...",
    "id" : "...",
    "parentPath" : "...",
    "primaryType" : "..."
  }, {
    "trashed" : true,
    "externalManaged" : true,
    "shared" : true,
    "locked" : true,
    "publicItem" : true,
    "title" : "...",
    "description" : "...",
    "lastModifiedBy" : "...",
    "lastModificationTime" : 12345,
    "creationTime" : 12345,
    "lastAction" : "RENAMED",
    "hidden" : true,
    "ownerNode" : {
      "userName" : "...",
      "userId" : "..."
    },
    "accounting" : {
      "entries" : [ { }, { } ]
    },
    "metadata" : {
      "map" : {
        "property1" : { },
        "property2" : { }
      }
    },
    "owner" : "...",
    "name" : "...",
    "relatedNode" : { },
    "path" : "...",
    "parentId" : "...",
    "id" : "...",
    "parentPath" : "...",
    "primaryType" : "..."
  } ]
}
                
              

GET /vrefolders

Get a list of VRE folders for which the user is member

Request Parameters
name type description
Authorization header Bearer token, see https://dev.d4science.org/how-to-access-resources
exclude query a list of fields to exclude from the returned item
Multivalued
Optional
Response Body
media type data type description
application/json ItemList (JSON) list of VRE folders

Example

Request
GET /vrefolders
Content-Type: */*
Accept: application/json
Authorization: ...

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

                
{
  "itemlist" : [ {
    "trashed" : true,
    "externalManaged" : true,
    "shared" : true,
    "locked" : true,
    "publicItem" : true,
    "title" : "...",
    "description" : "...",
    "lastModifiedBy" : "...",
    "lastModificationTime" : 12345,
    "creationTime" : 12345,
    "lastAction" : "CREATED",
    "hidden" : true,
    "ownerNode" : {
      "userName" : "...",
      "userId" : "..."
    },
    "accounting" : {
      "entries" : [ { }, { } ]
    },
    "metadata" : {
      "map" : {
        "property1" : { },
        "property2" : { }
      }
    },
    "owner" : "...",
    "name" : "...",
    "relatedNode" : { },
    "path" : "...",
    "parentId" : "...",
    "id" : "...",
    "parentPath" : "...",
    "primaryType" : "..."
  }, {
    "trashed" : true,
    "externalManaged" : true,
    "shared" : true,
    "locked" : true,
    "publicItem" : true,
    "title" : "...",
    "description" : "...",
    "lastModifiedBy" : "...",
    "lastModificationTime" : 12345,
    "creationTime" : 12345,
    "lastAction" : "UPDATED",
    "hidden" : true,
    "ownerNode" : {
      "userName" : "...",
      "userId" : "..."
    },
    "accounting" : {
      "entries" : [ { }, { } ]
    },
    "metadata" : {
      "map" : {
        "property1" : { },
        "property2" : { }
      }
    },
    "owner" : "...",
    "name" : "...",
    "relatedNode" : { },
    "path" : "...",
    "parentId" : "...",
    "id" : "...",
    "parentPath" : "...",
    "primaryType" : "..."
  } ]
}
                
              

GET /vrefolders/paged

Get a paged list of VRE folders for which the user is member

Request Parameters
name type description
Authorization header Bearer token, see https://dev.d4science.org/how-to-access-resources
exclude query a list of fields to exclude from the returned item
Multivalued
Optional
limit query maximum number of items returned
Possible values: integers
start query start index, counting from 0
Possible values: integers
Response Body
media type data type description
application/json ItemList (JSON) list of VRE folders

Example

Request
GET /vrefolders/paged?start=0&limit=10
Content-Type: */*
Accept: application/json
Authorization: ...

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

                
{
  "itemlist" : [ {
    "trashed" : true,
    "externalManaged" : true,
    "shared" : true,
    "locked" : true,
    "publicItem" : true,
    "title" : "...",
    "description" : "...",
    "lastModifiedBy" : "...",
    "lastModificationTime" : 12345,
    "creationTime" : 12345,
    "lastAction" : "CLONED",
    "hidden" : true,
    "ownerNode" : {
      "userName" : "...",
      "userId" : "..."
    },
    "accounting" : {
      "entries" : [ { }, { } ]
    },
    "metadata" : {
      "map" : {
        "property1" : { },
        "property2" : { }
      }
    },
    "owner" : "...",
    "name" : "...",
    "relatedNode" : { },
    "path" : "...",
    "parentId" : "...",
    "id" : "...",
    "parentPath" : "...",
    "primaryType" : "..."
  }, {
    "trashed" : true,
    "externalManaged" : true,
    "shared" : true,
    "locked" : true,
    "publicItem" : true,
    "title" : "...",
    "description" : "...",
    "lastModifiedBy" : "...",
    "lastModificationTime" : 12345,
    "creationTime" : 12345,
    "lastAction" : "MOVED",
    "hidden" : true,
    "ownerNode" : {
      "userName" : "...",
      "userId" : "..."
    },
    "accounting" : {
      "entries" : [ { }, { } ]
    },
    "metadata" : {
      "map" : {
        "property1" : { },
        "property2" : { }
      }
    },
    "owner" : "...",
    "name" : "...",
    "relatedNode" : { },
    "path" : "...",
    "parentId" : "...",
    "id" : "...",
    "parentPath" : "...",
    "primaryType" : "..."
  } ]
}