Commit Session (Normal Upload)

Open in ChatGPT Open in ChatGPT to ask questions about this page
Open in Claude Open in Claude to ask questions about this page
Copy as MarkdownCopy this page as markdown to use with AI assistants
View as Markdown Open this page as markdown in a new tab

Once all chunks are uploaded, user can use the commit API to complete the session and create/update the file. In the commit session API, storage and file size limit of the team, upload permission of the user, and file name validation will be performed.
All chunks should be uploaded before invoking the commit API. Session should be active, and it will be validated with expiry time. If the request is authorized, we will create/update a file and send a response with file's meta data.
During normal upload, after uploading all chunks, in order to finish uploading the chunks and complete the created session, this API is called.

Error codes:
  • 200 - Commit session completed successfully.
  • 400 - Commit session failed. Given upload-id is expired or upload session has expired.
  • 401 - Commit session failed.Given resource-id and upload session resource-id are not the same.
  • 404 - Commit session failed. Invalid Upload ID
  • 412 - Commit session failed. Upload session has already been completed or chunks are yet to be uploaded.
Endpoints

OAuth Scope

WorkDrive.files.CREATECopied!

Request Example

cURL
cURL
Deluge
Copied!
curl --request POST \
  --url 'https://www.zohoapis.com/workdrive/api/v1/uploadsession/commit?upload_id={upload_id}&parent_id={parent_id}' \
  --header 'Authorization: Zoho-oauthtoken d92d4xxxxxxxxxxxxx15f52'

Query Parameters

Note:

Query parameter name should be URL encoded with UTF-8 Charset. For more info, refer here

upload_idstring(Required)

Upload ID from the Create Session API.

parent_idstring(Required)

Parent folder ID in which the file will be uploaded.

file_namestring(Optional)

Name of the uploading file

name_conflictstring(Optional)

If the same name exists (default option is fail).

Allowed Values :
Show Values
failCopied!
renameCopied!
updateCopied!
Copied!Copy all as JSON Array

Response Example

200
200
400
401
412
Copied!
  {
    "data": [
      {
        "attributes": {
          "Permalink": "https://www.zohoapis.com/workdrive/file/3smnqc10ed7e4525342d4bb396d5ff795e549",
          "File INFO": {
            "ORG_ID": "6oq3d00e1e07d58c64077b4f1c1f28da4a777",
            "RESOURCE_ID": "3smnqc10ed7e4525342d4bb396d5ff795e549",
            "LIBRARY_ID": "5txno9b6ca82a4dd84f90b9bea038273d33e3",
            "PARENT_MODEL_ID": "s7llp4b105a761a10474695c5031562f2c1d1",
            "PARENT_ID": "s7llp4b105a761a10474695c5031562f2c1d1",
            "RESOURCE_TYPE": 2506,
            "WMS_SENT_TIME": "1681998140999",
            "TAB_ID": "-1",
            "OWNER": "667009621",
            "RESOURCE_GROUP": "FILE",
            "PARENT_MODEL_NAME": "file",
            "size": 1141420772,
            "OPERATION": "UPLOAD",
            "EVENT_ID": "-1",
            "AUDIT_INFO": {
              "uploadId": "CFU_NjY3MDA5NjIxXzc5OTEzMjIxMl81NzE5ODk5MDA1MDY4OTk5MDIz",
              "resource": {
                "owner": "667009621",
                "created_time": 1681998140949,
                "creator": "799132212",
                "service_type": 4,
                "extension": "zip",
                "resource_type": 2506,
                "name": "aa.zip"
              },
              "parentInfo": {
                "parentName": "Testing",
                "parentId": "s7llp4b105a761a10474695c5031562f2c1d1",
                "parentType": 1001
              },
              "libraryInfo": {
                "libraryName": "MYSPACE_LIBRARY",
                "libraryId": "5txno9b6ca82a4dd84f90b9bea038273d33e3",
                "libraryType": 20
              },
              "statusCode": "D201"
            },
            "ZUID": 799132212,
            "TEAM_ID": "6oq3d00e1e07d58c64077b4f1c1f28da4a777"
          },
          "parent_id": "s7llp4b105a761a10474695c5031562f2c1d1",
          "FileName": "aa.zip",
          "resource_id": "3smnqc10ed7e4525342d4bb396d5ff795e549"
        },
        "type": "files"
      }
    ]
  }
                
400 Bad Request
401 Unauthorized
412 Precondition Failed
Show full