File
  • PDF

File

  • PDF

# File

Description

It is an API to manage files for the WORKBOX service.

Search API

Searches the file information.

Request URL

GET https://workbox.apigw.ntruss.com/file-api/workbox-file-server/file-api/v1/files/{fileId}

Request header

Header name Description
x-ncp-apigw-timestamp This is the number of milliseconds that have elapsed since January 1, 1970 00:00:00 UTC.
If the time difference compared to the API Gateway server is more than 5 minutes, then the request is considered invalid.

x-ncp-apigw-timestamp:{Timestamp}
x-ncp-iam-access-key Value of access key ID issued on the NAVER Cloud Platform portal
x-ncp-iam-access-key:{Account Access Key}
x-ncp-apigw-signature-v2 Signature encrypted with the access key ID value and secret key
x-ncp-apigw-signature-v2:{API Gateway Signature}
x-ncp-workbox-loginId Login email address for WORKBOX service
x-ncp-workbox-loginId:{Login ID}
Content-Type It specifies the content type of the request body as application/json.
Content-Type: application/json

Request path parameter

Parameter Type Requirement status Description
fileId long Y File ID (FileId)

Request examples

GET https://workbox.apigw.ntruss.com/file-api/workbox-file-server/file-api/v1/files/18614377

GET file-api/workbox-file-server/file-api/v1/files/18614377
HOST: workbox.apigw.ntruss.com
Content-Type: application/json
x-ncp-apigw-timestamp : 1649054672370
x-ncp-iam-access-key: toAvmFdP1rtPTMz2dpdy
x-ncp-apigw-signature-v2 : sks3TlqeoWnd08TkfdmfAjrdjTekRhRlAhRhWlvmeka=
x-ncp-workbox-loginId : gildong@sample.co.kr

Response examples

HTTP/1.1 200 OK
access-control-allow-credentials: true 
access-control-allow-methods: GET,POST,PUT,DELETE,OPTIONS 
access-control-max-age: 3600 
connection: keep-alive 
content-type: application/json;charset=UTF-8 
date: Tue, 05 Apr 2022 01:05:10 GMT 
server: nginx 
strict-transport-security: max-age=31536000; includeSubDomains, max-age=31536000; includeSubDomains 
transfer-encoding: chunked 
x-ncp-apigw-response-origin: ENDPOINT 
x-ncp-trace-id: 32p9p70p32pj36acph6com2p1g 
{
  "id": 18614377,
  "type": 2,
  "folderType": 1,
  "path": "gildong/naver.jpg",
  "uprFolderId": 2485554,
  "size": 5076,
  "creYmdt": "2022-04-05T01:04:32.185+0000",
  "modYmdt": "2022-04-05T01:04:32.000+0000",
  "allSubFoldersCount": 0,
  "allSubFilesCount": 0,
  "creator": {
    "userId": "bb891238-88cf-50f9-572e-9fe0111234a3",
    "userNm": "gildong hong",
    "userPhoto": null,
    "loginId": "gildong@sample.co.kr"
  },
  "modifier": {
    "userId": "bb891238-88cf-50f9-572e-9fe0111234a3",
    "userNm": "gildong hong",
    "userPhoto": null,
    "loginId": "gildong@sample.co.kr"
  },
  "uploadYmdt": "2022-04-05T01:04:32.000+0000",
  "userModYmdt": "2022-04-05T01:04:32.185+0000"
}

Delete API

Deletes a file.

Request URL

DELETE https://workbox.apigw.ntruss.com/file-api/workbox-file-server/file-api/v1/files/{fileId}

Request header

Header name Description
x-ncp-apigw-timestamp This is the number of milliseconds that have elapsed since January 1, 1970 00:00:00 UTC.
If the time difference compared to the API Gateway server is more than 5 minutes, then the request is considered invalid.

x-ncp-apigw-timestamp:{Timestamp}
x-ncp-iam-access-key Value of access key ID issued on the NAVER Cloud Platform portal
x-ncp-iam-access-key:{Account Access Key}
x-ncp-apigw-signature-v2 Signature encrypted with the access key ID value and secret key
x-ncp-apigw-signature-v2:{API Gateway Signature}
x-ncp-workbox-loginId Login email address for WORKBOX service
x-ncp-workbox-loginId:{Login ID}
Content-Type It specifies the content type of the request body as application/json.
Content-Type: application/json

Request path parameter

Parameter Type Requirement status Description
fileId Long Y File ID (FileId)

Request examples

DELETE https://workbox.apigw.ntruss.com/file-api/workbox-file-server/file-api/v1/files/18629575

DELETE /file-api/workbox-file-server/file-api/v1/files/18629575
HOST: workbox.apigw.ntruss.com
Content-Type: application/json
x-ncp-apigw-timestamp : 1649054672370
x-ncp-iam-access-key: toAvmFdP1rtPTMz2dpdy
x-ncp-apigw-signature-v2 : sks3TlqeoWnd08TkfdmfAjrdjTekRhRlAhRhWlvmeka=
x-ncp-workbox-loginId : gildong@sample.co.kr

Response examples

HTTP/1.1 200 OK
access-control-allow-credentials: true 
access-control-allow-methods: GET,POST,PUT,DELETE,OPTIONS 
access-control-allow-origin: https://workbox.apigw.ntruss.com 
access-control-max-age: 3600 
connection: keep-alive 
content-length: 0 
date: Tue, 05 Apr 2022 06:10:21 GMT 
server: nginx 
strict-transport-security: max-age=31536000; includeSubDomains, max-age=31536000; includeSubDomains 
x-ncp-apigw-response-origin: ENDPOINT 
x-ncp-trace-id: 3copjc5i32opj3gd9i74sjgcr2 

Modify API

Modifies the file name.

Request URL

PATCH https://workbox.apigw.ntruss.com/file-api/workbox-file-server/file-api/v1/files/{fileId}

Request header

Header name Description
x-ncp-apigw-timestamp This is the number of milliseconds that have elapsed since January 1, 1970 00:00:00 UTC.
If the time difference compared to the API Gateway server is more than 5 minutes, then the request is considered invalid.

x-ncp-apigw-timestamp:{Timestamp}
x-ncp-iam-access-key Value of access key ID issued on the NAVER Cloud Platform portal
x-ncp-iam-access-key:{Account Access Key}
x-ncp-apigw-signature-v2 Signature encrypted with the access key ID value and secret key
x-ncp-apigw-signature-v2:{API Gateway Signature}
x-ncp-workbox-loginId Login email address for WORKBOX service
x-ncp-workbox-loginId:{Login ID}
Content-Type It specifies the content type of the request body as application/json.
Content-Type: application/json

Request path parameter

Parameter Type Requirement status Description
fileId Long Y File ID (FileId)

Request query parameter

Parameter Type Requirement status Description
newName String Y Name to be changed to

Request examples

PATCH https://workbox.apigw.ntruss.com/file-api/workbox-file-server/file-api/v1/files/18614377?newName=test_newName_0001

PATCH /file-api/workbox-file-server/file-api/v1/files/18614377?newName=test_newName_0001
HOST: workbox.apigw.ntruss.com
Content-Type: application/json
x-ncp-apigw-timestamp : 1649054672370
x-ncp-iam-access-key: toAvmFdP1rtPTMz2dpdy
x-ncp-apigw-signature-v2 : sks3TlqeoWnd08TkfdmfAjrdjTekRhRlAhRhWlvmeka=
x-ncp-workbox-loginId : gildong@sample.co.kr

Response examples

HTTP/1.1 200 OK
 access-control-allow-credentials: true 
 access-control-allow-methods: GET,POST,PUT,DELETE,OPTIONS 
 access-control-allow-origin: https://workbox.apigw.ntruss.com 
 access-control-max-age: 3600 
 connection: keep-alive 
 content-length: 0 
 date: Tue, 05 Apr 2022 04:18:02 GMT 
 server: nginx 
 strict-transport-security: max-age=31536000; includeSubDomains, max-age=31536000; includeSubDomains 
 x-ncp-apigw-response-origin: ENDPOINT 
 x-ncp-trace-id: 32c1o75hmae1j68c1p6oom4d1j 

File download API

Downloads a file.

Request URL

GET https://workbox.apigw.ntruss.com/file-api/workbox-file-server/file-api/v1/files/{fileId}/download

Request header

Header name Description
x-ncp-apigw-timestamp This is the number of milliseconds that have elapsed since January 1, 1970 00:00:00 UTC.
If the time difference compared to the API Gateway server is more than 5 minutes, then the request is considered invalid.

x-ncp-apigw-timestamp:{Timestamp}
x-ncp-iam-access-key Value of access key ID issued on the NAVER Cloud Platform portal
x-ncp-iam-access-key:{Account Access Key}
x-ncp-apigw-signature-v2 Signature encrypted with the access key ID value and secret key
x-ncp-apigw-signature-v2:{API Gateway Signature}
x-ncp-workbox-loginId Login email address for WORKBOX service
x-ncp-workbox-loginId:{Login ID}
Content-Type It specifies the content type of the request body as application/json.
Content-Type: application/json

Request path parameter

Parameter Type Requirement status Description
fileId Long Y File ID (FileId)

Request examples

GET https://workbox.apigw.ntruss.com/file-api/workbox-file-server/file-api/v1/files/18618459/download

GET /file-api/workbox-file-server/file-api/v1/files/18618459/download
HOST: workbox.apigw.ntruss.com
Content-Type: application/json
x-ncp-apigw-timestamp : 1649054672370
x-ncp-iam-access-key: toAvmFdP1rtPTMz2dpdy
x-ncp-apigw-signature-v2 : sks3TlqeoWnd08TkfdmfAjrdjTekRhRlAhRhWlvmeka=
x-ncp-workbox-loginId : gildong@sample.co.kr

Response examples

HTTP/1.1 200 OK
access-control-allow-credentials: true 
access-control-allow-methods: GET,POST,PUT,DELETE,OPTIONS 
access-control-max-age: 3600 
connection: keep-alive 
content-disposition: attachment;filename*=UTF-8''naver.jpg 
content-length: 5076 
content-type: image/jpeg 
date: Tue, 05 Apr 2022 04:26:42 GMT 
server: nginx 
strict-transport-security: max-age=31536000; includeSubDomains, max-age=31536000; includeSubDomains 
x-ncp-apigw-response-origin: ENDPOINT 
x-ncp-trace-id: 3gp326tj38pho38ohp6os38opm 
Downloads the file

File upload API

Uploads a file to a specific folder.

Request URL

POST https://workbox.apigw.ntruss.com/file-api/workbox-file-server/file-api/v1/files

Request header

Header name Description
x-ncp-apigw-timestamp This is the number of milliseconds that have elapsed since January 1, 1970 00:00:00 UTC.
If the time difference compared to the API Gateway server is more than 5 minutes, then the request is considered invalid.

x-ncp-apigw-timestamp:{Timestamp}
x-ncp-iam-access-key Value of access key ID issued on the NAVER Cloud Platform portal
x-ncp-iam-access-key:{Account Access Key}
x-ncp-apigw-signature-v2 Signature encrypted with the access key ID value and secret key
x-ncp-apigw-signature-v2:{API Gateway Signature}
x-ncp-workbox-loginId Login email address for WORKBOX service
x-ncp-workbox-loginId:{Login ID}
Content-Type It specifies the content type of the request body as multipart/form-data.
Content-Type: multipart/form-data

Request query parameter

Parameter Type Requirement status Description
action int Y 1:Nomal 2:Overwrite 3:Rename
size int Y File size
actionForm formData N formData to be used when delivered with a form
file formData Y File to be uploaded

Request examples

POST https://workbox.apigw.ntruss.com/file-api/workbox-file-server/file-api/v1/files?action=1&folderId=2485554&size=5076

POST /file-api/workbox-file-server/file-api/v1/files?action=1&folderId=2485554&size=5076
HOST: workbox.apigw.ntruss.com
Content-Type: multipart/form-data
x-ncp-apigw-timestamp : 1649054672370
x-ncp-iam-access-key: toAvmFdP1rtPTMz2dpdy
x-ncp-apigw-signature-v2 : sks3TlqeoWnd08TkfdmfAjrdjTekRhRlAhRhWlvmeka=
x-ncp-workbox-loginId : gildong@sample.co.kr

Response examples

HTTP/1.1 200 OK
access-control-allow-credentials: true 
access-control-allow-methods: GET,POST,PUT,DELETE,OPTIONS 
access-control-allow-origin: https://workbox.apigw.ntruss.com 
access-control-max-age: 3600 
connection: keep-alive 
content-type: application/json;charset=UTF-8 
date: Tue, 05 Apr 2022 07:21:22 GMT 
server: nginx 
strict-transport-security: max-age=31536000; includeSubDomains, max-age=31536000; includeSubDomains 
transfer-encoding: chunked 
x-ncp-apigw-response-origin: ENDPOINT 
x-ncp-trace-id: 62d9icpgj0pj338cb264qjie1i 
{
  "folderId": 2485554,
  "folderType": 1,
  "fileType": "jpg",
  "creYmdt": "2022-04-05T07:21:21.923+0000",
  "modYmdt": "2022-04-05T07:21:21.923+0000",
  "folderNm": "gildong001",
  "folderPath": "gildong001",
  "creator": {
    "userId": "bb891238-88cf-50f9-572e-9fe0111234a3",
    "userNm": "gildong hong",
    "userPhoto": null,
    "loginId": "gildong@sample.co.kr"
  },
  "filePath": "gildong001/naver.jpg",
  "sharedMemberCount": 0,
  "sharedMembers": null,
  "userModYmdt": "2022-04-05T07:21:21.923+0000",
  "id": 18637745,
  "name": "naver.jpg",
  "size": 5076,
  "userModYmdtMills": 1649143281923
}

Copy file API

Copies a file to a specific folder.

Request URL

POST https://workbox.apigw.ntruss.com/file-api/workbox-file-server/file-api/v1/files/copy-batch

Request header

Header name Description
x-ncp-apigw-timestamp This is the number of milliseconds that have elapsed since January 1, 1970 00:00:00 UTC.
If the time difference compared to the API Gateway server is more than 5 minutes, then the request is considered invalid.

x-ncp-apigw-timestamp:{Timestamp}
x-ncp-iam-access-key Value of access key ID issued on the NAVER Cloud Platform portal
x-ncp-iam-access-key:{Account Access Key}
x-ncp-apigw-signature-v2 Signature encrypted with the access key ID value and secret key
x-ncp-apigw-signature-v2:{API Gateway Signature}
x-ncp-workbox-loginId Login email address for WORKBOX service
x-ncp-workbox-loginId:{Login ID}
Content-Type It specifies the content type of the request body as application/json.
Content-Type: application/json

Request body parameter

Parameter Type Requirement status Description
files List<FileItem> Y File information

Request examples

POST https://workbox.apigw.ntruss.com/file-api/workbox-file-server/file-api/v1/files/copy-batch

POST /file-api/workbox-file-server/file-api/v1/files/copy-batch
HOST: workbox.apigw.ntruss.com
Content-Type: application/json
x-ncp-apigw-timestamp : 1649054672370
x-ncp-iam-access-key: toAvmFdP1rtPTMz2dpdy
x-ncp-apigw-signature-v2 : sks3TlqeoWnd08TkfdmfAjrdjTekRhRlAhRhWlvmeka=
x-ncp-workbox-loginId : gildong@sample.co.kr
{
  "files": [
    {
      "action": 1,
      "destFolderId": 2486666,
      "id": 18637745
    },
{
      "action": 1,
      "destFolderId": 2486666,
      "id": 18614377
    }
  ]
}

Response examples

HTTP/1.1 200 OK
access-control-allow-credentials: true 
access-control-allow-methods: GET,POST,PUT,DELETE,OPTIONS 
access-control-allow-origin: https://workbox.apigw.ntruss.com 
access-control-max-age: 3600 
connection: keep-alive 
content-type: application/json;charset=UTF-8 
date: Tue, 05 Apr 2022 09:15:42 GMT 
server: nginx 
strict-transport-security: max-age=31536000; includeSubDomains, max-age=31536000; includeSubDomains 
transfer-encoding: chunked 
x-ncp-apigw-response-origin: ENDPOINT 
x-ncp-trace-id: 3cp9i65j66p9j6ae1gc8qjid31 
{
  "conflictContents": []
}

Move file API

Moves a file to a specific folder.

Request URL

POST https://workbox.apigw.ntruss.com/file-api/workbox-file-server/file-api/v1/files/move-batch

Request header

Header name Description
x-ncp-apigw-timestamp This is the number of milliseconds that have elapsed since January 1, 1970 00:00:00 UTC.
If the time difference compared to the API Gateway server is more than 5 minutes, then the request is considered invalid.

x-ncp-apigw-timestamp:{Timestamp}
x-ncp-iam-access-key Value of access key ID issued on the NAVER Cloud Platform portal
x-ncp-iam-access-key:{Account Access Key}
x-ncp-apigw-signature-v2 Signature encrypted with the access key ID value and secret key
x-ncp-apigw-signature-v2:{API Gateway Signature}
x-ncp-workbox-loginId Login email address for WORKBOX service
x-ncp-workbox-loginId:{Login ID}
Content-Type It specifies the content type of the request body as application/json.
Content-Type: application/json

Request body parameter

Parameter Type Requirement status Description
files List<FileItem> Y File information
topMoveFolders List<Integer> N The value is configured by pairing the ID of the file to be moved and the ID of the folder to be moved to.

Request examples

POST https://workbox.apigw.ntruss.com/file-api/workbox-file-server/file-api/v1/files/move-batch

POST /file-api/workbox-file-server/file-api/v1/files/move-batch
HOST: workbox.apigw.ntruss.com
Content-Type: application/json
x-ncp-apigw-timestamp : 1649054672370
x-ncp-iam-access-key: toAvmFdP1rtPTMz2dpdy
x-ncp-apigw-signature-v2 : sks3TlqeoWnd08TkfdmfAjrdjTekRhRlAhRhWlvmeka=
x-ncp-workbox-loginId : gildong@sample.co.kr
{
  "files": [
    {
      "action": 1,
      "destFolderId": 2485768,
      "id": 18651018
    },
    {
      "action": 1,
      "destFolderId": 2485768,
      "id": 18651017
    }
  ],
"topMoveFolders":[18651018, 2485768, 18651017, 2485768]  
}

Response examples

HTTP/1.1 200 OK
access-control-allow-credentials: true 
access-control-allow-methods: GET,POST,PUT,DELETE,OPTIONS 
access-control-allow-origin: https://workbox.apigw.ntruss.com 
access-control-max-age: 3600 
connection: keep-alive 
content-type: application/json;charset=UTF-8 
date: Wed, 06 Apr 2022 01:58:27 GMT 
server: nginx 
strict-transport-security: max-age=31536000; includeSubDomains, max-age=31536000; includeSubDomains 
transfer-encoding: chunked 
x-ncp-apigw-response-origin: ENDPOINT 
x-ncp-trace-id: 30e9h6hgjadb230e31c8qj8c1p 
{
  "conflictContents": [],
  "topMoveFolders": [
    18651018,
    2485768,
    18651017,
    2485768
  ]
}

Response

Returned as an HTTP status code and delivered as body information.

HTTP status code Response message Description
200 OK General request made successfully
201 Created Resource successfully created
400 Bad Request Used for general request failure (usually used to respond to a request format that the server can't understand)
500 Internal Server Error - Response code to general server errors
While 4xx error codes represent client-side errors,
5xx error codes represent server-side errors.

Action

Code Description
1 Normal (skip), default
2 Overwrite
3 Rename

FileItem

Parameter Type Requirement status Description
id long Y File ID
destFolderId Long Y ID of the folder where the copied file will be located; the top level folder when set as 0
action int N Action

Was this article helpful?

What's Next