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

Creates a URL for uploading a file to a team/group folder. Users can use this URL to upload files.

Note

  • For how to download content using the API, see Upload or Download Files.

Authorization

oauth2

OAuth 2.0 authentication.
For more information, see Authentication and Authorization.

Scope

group.folder
file

HTTP Request

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

Path Parameters

ParameterTypeDescription
groupId string 

Team/group ID


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

File 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 

File name


required
minLength : 1
maxLength : 200 
modifiedTime string 

File update date


minLength : 1
format : date-time 
fileSize integer 

File size


required
maximum : 10737418240
format : int64 
overwrite boolean 

Indicates whether to overwrite the file.


default : false 
suffixOnDuplicate boolean 

Indicates whether to use automatic numbering
If it is true, a number is automatically added to a file or folder name when a file or folder with the same name already exists in the destination folder.


default : false 
resume boolean 

Indicates whether the upload is resumable.
To resume the upload from where it left off, set resume:true for the same upload request.


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 

File upload URL


required 
offset integer 

It is used to resume the previously interrupted upload if resume:true is set.
Note that it is set to 0 if there is no upload to resume.
To resume the upload, you need to pass the offset value in the Content-Range header.

Example) If fileSize is 1000 and offset is 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}