POST/groups/{groupId}/folder/files/{fileId}

조직/그룹 폴더 파일을 업로드하기 위한 URL을 생성한다. 사용자는 이 URL로 파일을 업로드한다.

참고
API를 이용한 콘텐츠 업로드 방법은 파일 업로드/다운로드를 참고한다.

Authorization

oauth2

OAuth 2.0 인증.
자세한 인증 방식은 인가·인증을 참고한다.

Scope

group.folder
file

HTTP Request

POSThttps://www.worksapis.com/v1.0/groups/{groupId}/folder/files/{fileId}

Path Parameters

ParameterTypeDescription
groupId string 

조직/그룹 ID


required
example : group127-8545-4463-603b-04d550d23bf 
fileId string 

파일 ID


required
example : NzExNTMwMDF8MTQ2NzA1NjAxMDAwMHxGfDA 

Header Parameters

HeadertypeDescription
Authorization string 

Bearer {token}


required 
Content-Type string 

application/json


required
example : application/json 

Request Body

PropertyTypeDescription
fileName string 

파일 이름


required
minLength : 1
maxLength : 200 
modifiedTime string 

파일 수정 날짜


minLength : 1
format : date-time 
fileSize integer 

파일 크기


required
maximum : 10737418240
format : int64 
overwrite boolean 

파일 덮어쓰기 여부


default : false 
suffixOnDuplicate boolean 

자동 번호 추가 여부
이 값이 true이면 업로드할 폴더에 이름이 중복되는 파일이나 폴더가 존재할 때 파일 이름 뒤에 자동으로 번호가 추가된다.


default : false 
resume boolean 

이어올리기 여부.
업로드 실패 시점부터 다시 업로드하려면 동일한 업로드 요청에 resume:true로 설정한다.


default : false 

Request Example

example

1{2  "fileName": "works.txt",3  "modifiedTime": "2019-08-24T14:15:22Z",4  "fileSize": 100,5  "overwrite": false,6  "resume": false,7  "suffixOnDuplicate": false8}

example(resume)

1{2  "fileName": "works.txt",3  "modifiedTime": "2019-08-24T14:15:22Z",4  "fileSize": 100,5  "overwrite": false,6  "resume": true,7  "suffixOnDuplicate": false8}

Response

HTTP 200

OK

PropertyTypeDescription
uploadUrl string 

파일 업로드 URL


required 
offset integer 

업로드 요청 시 resume:true이면 이전에 실패한 업로드 요청의 이어올리기를 위해 설정하는 값.
단, 이어올리기 파일이 없으면 offset은 0으로 설정된다.
이어올리기를 수행하려면 Content-Range 헤더에 해당 offset값을 전달해야 한다.

예) fileSize가 1000이고, offset이 100인 경우
Content-Range=100-999/1000


format : int64 

Response Example

example

1{2  "uploadUrl": "https://apis-storage.worksmobile.com/k1/drive/r/24101/160521/160521/100001500064253/3472589353794602761?param=ewogICJwYXJlbnRLZXkiIDogInJvb3QiLAogICJmaWxlTmFtZSIgOiAi7ZWc6riALnR4dCIsCiAgImZpbGVTaXplIiA6IDMsCiAgIm1vZGlmaWVkVGltZSIgOiAiMjAxOS0wOC0yNFQxNDoxNToyMloiLAogICJhZGRvbktleSIgOiBudWxsCn0&writeMode=none&auth=OPEN",3  "offset": 04}

example(resume)

1{2  "uploadUrl": "https://apis-storage.worksmobile.com/k1/drive/r/24101/160521/160521/100001500064253/3472589353794602761?param=ewogICJwYXJlbnRLZXkiIDogInJvb3QiLAogICJmaWxlTmFtZSIgOiAi7ZWc6riALnR4dCIsCiAgImZpbGVTaXplIiA6IDMsCiAgIm1vZGlmaWVkVGltZSIgOiAiMjAxOS0wOC0yNFQxNDoxNToyMloiLAogICJhZGRvbktleSIgOiBudWxsCn0&writeMode=resume&rangeStartOffset=100&auth=OPEN",3  "offset": 1004}