- Home
- Resources
- ItemsCreator
Manage item creation.
POST /items/{id}/create/ARCHIVE
Upload an archive from the provided url and extract its content on-the-fly in a new folder.
Request Parameters
| name |
type |
description |
| parentFolderName |
form |
name of the newly-created folder containing extracted
files |
| url |
form |
address of the archive to be uploaded |
| Authorization |
header |
Bearer token, see https://dev.d4science.org/how-to-access-resources |
| id |
path |
destination folder id |
Request Body
| media type |
data type |
| application/x-www-form-urlencoded |
(custom)
|
Response Codes
| code |
condition |
| 200 |
Archive extracted. |
| 400 |
Wrong set of parameters. |
| 406 |
Unable to extract archive. |
| 415 |
Wrong content type. |
Response Body
| media type |
data type |
description |
| text/plain |
string
|
id of the created folder containing extracted files |
Example
Request
POST /items/{id}/create/ARCHIVE
Content-Type: application/x-www-form-urlencoded
Accept: text/plain
Authorization: ...
name=sampleZip.zip&description=This+is+a+sample+zip&url="https://getsamplefiles.com/download/zip/sample-1.zip"
...
Response
HTTP/1.1 200 OK
Content-Type: text/plain
5f4b3b4e-4b3b- ... -4b3b4e4b3b4e
POST /items/{id}/create/ARCHIVE
Upload the provided archive and extract its content on-the-fly in a new folder.
Request Parameters
| name |
type |
description |
| file |
form |
multipart/form-data file parameter, with optional
'filename' and 'size' (see example below) |
| parentFolderName |
form |
name of the newly-created folder containing extracted
files |
| Authorization |
header |
Bearer token, see https://dev.d4science.org/how-to-access-resources |
| id |
path |
destination folder id |
Request Body
| media type |
data type |
| multipart/form-data |
(custom)
|
Response Codes
| code |
condition |
| 200 |
Archive extracted. |
| 400 |
Wrong set of parameters. |
| 406 |
Unable to extract archive. |
| 415 |
Wrong content type. |
Response Body
| media type |
data type |
description |
| text/plain |
string
|
id of the created folder containing extracted files |
Example
Request
POST /items/{id}/create/ARCHIVE
Content-Type: multipart/form-data
Accept: text/plain
Authorization: ...
--------boundaryString
Content-Disposition: form-data; name="file"; filename="archive.zip"; size=1560238;
Content-Type: application/zip
(compressed data)
--------boundaryString
Content-Disposition: form-data; name="parentFolderName="
my documents
--------boundaryString--
...
Response
HTTP/1.1 200 OK
Content-Type: text/plain
5f4b3b4e-4b3b- ... -4b3b4e4b3b4e
POST /items/{id}/create/FILE
Upload a file retrieved from the provided url.
Request Parameters
| name |
type |
description |
| description |
form |
description meta-info for the created file |
| name |
form |
destination file name |
| url |
form |
address of the file to be uploaded |
| Authorization |
header |
Bearer token, see https://dev.d4science.org/how-to-access-resources |
| id |
path |
destination folder id |
Request Body
| media type |
data type |
| application/x-www-form-urlencoded |
(custom)
|
Response Codes
| code |
condition |
| 200 |
File created. |
| 400 |
Wrong set of parameters. |
| 406 |
Unable to create file. |
| 415 |
Wrong content type. |
Response Body
| media type |
data type |
description |
| text/plain |
string
|
id of the created file |
Example
Request
POST /items/{id}/create/FILE
Content-Type: application/x-www-form-urlencoded
Accept: text/plain
Authorization: ...
name=d4science_logo.png&description=D4Science+logo&url="https://www.d4science.org/image/layout_set_logo?img_id=12630&t=1720538711657"
...
Response
HTTP/1.1 200 OK
Content-Type: text/plain
5f4b3b4e-4b3b- ... -4b3b4e4b3b4e
POST /items/{id}/create/FILE
Upload the provided file.
Note: It is recommended to include the file as the last parameter in the POST request.
Request Parameters
| name |
type |
description |
| description |
form |
description meta-info for the created file |
| file |
form |
multipart/form-data file parameter, with optional
'filename' and 'size' (see example below) |
| name |
form |
destination file name |
| size |
form |
size of the file in bytes |
| Authorization |
header |
Bearer token, see https://dev.d4science.org/how-to-access-resources |
| id |
path |
destination folder id |
Response Codes
| code |
condition |
| 200 |
File created. |
| 400 |
Wrong set of parameters. |
| 406 |
Unable to create file. |
| 415 |
Wrong content type. |
Response Body
| media type |
data type |
description |
| text/plain |
string
|
id of the created file |
Example
Request
POST /items/{id}/create/FILE
Content-Type: */*
Accept: text/plain
Authorization: ...
--------boundaryString
Content-Disposition: form-data; name="name"
doc.pdf
--------boundaryString
Content-Disposition: form-data; name="description"
"This is just a sample PDF file"
--------boundaryString
Content-Disposition: form-data; name="size"
426018
--------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
5f4b3b4e-4b3b- ... -4b3b4e4b3b4e
POST /items/{id}/create/FOLDER
Create a folder.
Request Parameters
| name |
type |
description |
| description |
form |
description meta-info for the created folder |
| hidden |
form |
hidden folder if true
Possible values: true, false
Optional default: false |
| name |
form |
destination folder name |
| Authorization |
header |
Bearer token, see https://dev.d4science.org/how-to-access-resources |
| id |
path |
destination parent folder id |
Request Body
| media type |
data type |
| application/x-www-form-urlencoded |
(custom)
|
Response Codes
| code |
condition |
| 200 |
Folder created. |
| 400 |
Wrong set of parameters. |
| 415 |
Wrong content type. |
Response Body
| media type |
data type |
description |
| text/plain |
string
|
id of the created folder |
Example
Request
POST /items/{id}/create/FOLDER
Content-Type: application/x-www-form-urlencoded
Accept: text/plain
Authorization: ...
name=sampleFolder&description=This+is+a+sample+folder&hidden=false
...
Response
HTTP/1.1 200 OK
Content-Type: text/plain
5f4b3b4e-4b3b- ... -4b3b4e4b3b4e
POST /items/{id}/create/URL
Create a URL.
Request Parameters
| name |
type |
description |
| description |
form |
description meta-info for the created URL |
| name |
form |
destination URL name |
| value |
form |
URL address |
| Authorization |
header |
Bearer token, see https://dev.d4science.org/how-to-access-resources |
| id |
path |
destination parent folder id |
Request Body
| media type |
data type |
| application/x-www-form-urlencoded |
(custom)
|
Response Codes
| code |
condition |
| 200 |
URL created. |
| 400 |
Wrong set of parameters. |
| 406 |
Unable to create URL. |
| 415 |
Wrong content type. |
Response Body
| media type |
data type |
description |
| text/plain |
object
|
id of the created URL |
Example
Request
POST /items/{id}/create/URL
Content-Type: application/x-www-form-urlencoded
Accept: text/plain
Authorization: ...
name=d4science&description=D4Science+URL&value=www.d4science.org
...
Response
HTTP/1.1 200 OK
Content-Type: text/plain
5f4b3b4e-4b3b- ... -4b3b4e4b3b4e