Generate Embed Code for a Files/Folders

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

This API will create published permalink_url for files and folders to share the file with the external world.

One can place the permalink_url generated in an src (source) attribute of a website or blog's IFRAME.

External users can view, download, and print the embedded files and folders from websites and blogs.

Endpoints

OAuth Scope

WorkDrive.files.sharing.CREATECopied!

Request Example

cURL
cURL
Deluge
Copied!
curl --request POST \
  --url https://www.zohoapis.com/workdrive/api/v1/permissions \
  --header 'Authorization: Zoho-oauthtoken d92d4xxxxxxxxxxxxx15f52' \
  --header 'content-type: application/vnd.api+json' \
  --data '{"data":{"attributes":{"shared_type":"publish","role_id":"34","resource_id":"cjrrr55b395f872ad4b0a8c52b02eab98c1c5"},"type":"permissions"}}'

Request Body

application/vnd.api+json
dataJSON Object(Required)
Hide Sub-Attributes
attributesJSON Object(Required)
Hide Sub-Attributes
shared_typestring(Required)

Should be "publish".

role_idinteger(Required)

Allowed role ID for files / folders: 34 - View

resource_idstring(Required)

The unique ID of the file.

typestring(Required)

The JSON:API resource type. Always "permissions".

Allowed Values :
Show Values
permissionsCopied!
Copied!Copy all as JSON Array

Body Parameters

Copied!
  {
    "data": {
      "attributes": {
        "shared_type": "publish",
        "role_id": "34",
        "resource_id": "cjrrr55b395f872ad4b0a8c52b02eab98c1c5"
      },
      "type": "permissions"
    }
  }
                
Show full

Response Example

R910

R910

R012

R914

R208

R913

R220

COL005

R955

R955

R952

R974

R953

R950

R214

R973

R971

R905

R708

R956

R253

R260

200
200
401
405
422
500
Copied!
  {
    "data": {
      "id": "cjrrr55b395f872ad4b0a8c52b02eab98c1c5-public",
      "type": "permissions",
      "attributes": {
        "owner": "747937818",
        "allow_sharing_outside": false,
        "shared_type": "publish",
        "shared_time_in_millis": 1618923070525,
        "shared_by": "Zylker Creation",
        "expiry_in_millis": 0,
        "delete_from_propagated_space": false,
        "relation_type": 0,
        "expiration_date": "",
        "message": "",
        "share_to_entity_info": {},
        "share_to": "public",
        "share_to_member_type": 1,
        "is_expired": false,
        "shared_to_member_type": 1,
        "role_id": 34,
        "shared_time_i18": "Apr 20, 6:21 PM",
        "shared_time": "Apr 20, 6:21 PM",
        "is_password_protected": false,
        "resource_id": "cjrrr55b395f872ad4b0a8c52b02eab98c1c5",
        "shared_status": "ACTIVE",
        "permalink": "https://workdrive.zohoexternal.com/file/cjrrr55b395f872ad4b0a8c52b02eab98c1c5",
        "shared_by_zuid": "747938014",
        "can_link_to_docs": true
      },
      "links": {
        "self": "https://www.zohoapis.com/workdrive/permissions/cjrrr55b395f872ad4b0a8c52b02eab98c1c5-public"
      }
    }
  }
                
  {
    "errors": [
      {
        "id": "R910",
        "title": "External User Email share is not allowed"
      }
    ]
  }
                
  {
    "errors": [
      {
        "id": "R012",
        "title": "Resource is not in active status to process this action"
      }
    ]
  }
                
  {
    "errors": [
      {
        "id": "R914",
        "title": "External User Email share is allowed only for white listed domains and users"
      }
    ]
  }
                
  {
    "errors": [
      {
        "id": "R208",
        "title": "Can not share libraries to user"
      }
    ]
  }
                
  {
    "errors": [
      {
        "id": "R913",
        "title": "Anyone on internet and publish share are not allowed"
      }
    ]
  }
                
  {
    "errors": [
      {
        "id": "R220",
        "title": "Can not change the role of a user with higher permission"
      }
    ]
  }
                
  {
    "errors": [
      {
        "id": "COL005",
        "title": "The expiration date format should be in yyyy-mm-dd or yyyy-m-d hh:mm"
      }
    ]
  }
                
  {
    "errors": [
      {
        "id": "R955",
        "title": "Sharing resource outside org with share permission is restricted."
      }
    ]
  }
                
  {
    "errors": [
      {
        "id": "R952",
        "title": "User doesn't provide permission for sharing to outside org user."
      }
    ]
  }
                
  {
    "errors": [
      {
        "id": "R974",
        "title": "External Sharing has been restricted via DLP Classification label\""
      }
    ]
  }
                
  {
    "errors": [
      {
        "id": "R953",
        "title": "User doesn't provide permission for sharing to non zoho user."
      }
    ]
  }
                
  {
    "errors": [
      {
        "id": "R950",
        "title": "Insufficient permission to share to yourself"
      }
    ]
  }
                
  {
    "errors": [
      {
        "id": "R214",
        "title": "Unknown shareTo zuid / emailid"
      }
    ]
  }
                
  {
    "errors": [
      {
        "id": "R973",
        "title": "Warn on External Sharing has been enforced via DLP Classification label to external user"
      }
    ]
  }
                
  {
    "errors": [
      {
        "id": "R971",
        "title": "Warn on External Sharing has been enforced via DLP Classification label to non zoho user"
      }
    ]
  }
                
  {
    "errors": [
      {
        "id": "R905",
        "title": "External share is not allowed"
      }
    ]
  }
                
  {
    "errors": [
      {
        "id": "R708",
        "title": "Group with mentioned id not available"
      }
    ]
  }
                
  {
    "errors": [
      {
        "id": "R956",
        "title": "Recieving resource from outside is restricted for Share_to user Org"
      }
    ]
  }
                
  {
    "errors": [
      {
        "id": "R253",
        "title": "Client user cannot perform any action on another client user"
      }
    ]
  }
                
  {
    "errors": [
      {
        "id": "R260",
        "title": "Cross org share limit exceeded"
      }
    ]
  }
                
Show full