- Previous: Search API
- Up: Overview
- Next: Workflow API
Links API
Deep Links
Deep links provide a reference back to a file or folder in the Web UI. If you need fine grained control, please use the Links API below.
Deep Links to Files and Folders in the Web UI
Use deep links to direct collaborators to the preview page for a file or folder in the browser. Deep links work on any Egnyte Web UI. The user must already have permission to view the file or folder.
To get an id-based deep link address in the Web UI, select a file or folder and click on the Details option. The link address is located under "Secured access for people with permissions".
Alternatively, you can use path-based deep links for files:
e.g. https://apidemo.egnyte.com/navigate/path/Shared/Projects/Presentation.pptx
Links API
The Public API Links endpoint allows you to list the file and folder links in your domain, show the details of an individual link, create new links, and delete links. If you want a link address that provides a reference to a file or folder, please use Deep Links.
List Links
Lists all links except for deleted links. Please note, that if the user executing this method is not an admin, then only links created by the user will be listed.
Request Examples
GET /pubapi/v1/links HTTP/1.1 Host: apidemo.egnyte.com Authorization: Bearer 68zc95e3xv954u6k3hbnma3q
curl -v -H "Authorization: Bearer 68zc95e3xv954u6k3hbnma3q" \ https://apidemo.egnyte.com/pubapi/v1/links
require 'egnyte' # Establish a session and a client session = Egnyte::Session.new({domain:'apidemo', access_token:'68zc95e3xv954u6k3hbnma3q'}) client = Egnyte::Client.new(session) # Call the endpoint and save result to a variable links = client.links # Or, if you want to call the endpoint without a client. # my_link = Egnyte::Link.all(session)
Sample Response Body
{ "ids":[ "owTMm8H8Sg", "KsiryUUgEo", "ZJ8s7xmil5", "hhkfvX6nq8", "Kjw93J55sm" ], "offset":0, "count":0, "total_count":5 }
Request Parameters
Parameter | Description | Required |
---|---|---|
path | List links to a file or folder specified by its full path. | No |
username | List links created by this user. | No |
created_before | List links created before a given date (ISO-8601 or YYYY-MM-DD). | No |
created_after | List links created after a given date (ISO-8601 or YYYY-MM-DD). | No |
type | Filter to "file" or "folder" items only. | No |
accessibility | Filter to links whose accessibility is "anyone," "password," "domain," or "recipients." | No |
offset | The 0-based index of the initial record being requested. | No |
count | Limit number of entries per page. By default the max count of 500 entries is returned. | No |
Response Parameters
Element | Description |
---|---|
ids | An array containing the IDs of all links for your domain that this user can see. |
offset | The 0-based index of the initial record being requested. |
count | The count of items returned. If this field is not specified, the count value will be 0. |
total_count | The number of links visible to the user in the domain. |
List Links v2
Lists all links. Please note, that if the user executing this method is not an admin, then only links created by the user will be listed.
Request Examples
GET /pubapi/v2/links HTTP/1.1 Host: apidemo.egnyte.com Authorization: Bearer 68zc95e3xv954u6k3hbnma3q
curl -v -H "Authorization: Bearer 68zc95e3xv954u6k3hbnma3q" \ https://apidemo.egnyte.com/pubapi/v2/links
Sample Response Body
{ "links": [ { "path": "/Shared/abcd/123.png", "type": "file", "accessibility": "anyone", "protection": "NONE", "recipients": [], "notify": false, "url": "https://apidemo.egnyte.com/dl/6a7ILnZZZ", "id": "6a7ILnZZZ", "link_to_current": false, "creation_date": "2022-03-13T06:15:27+0000", "created_by": "admin", "resource_id": "6cc7ca12-c22e-4d22-b2ff-22222bc2228c", "expiry_clicks": 4, "last_accessed": "2022-03-16T10:34:12.000+0000" }, { "path": "/Private/someone", "type": "folder", "accessibility": "anyone", "protection": "NONE", "recipients": [], "notify": false, "url": "https://apidemo.egnyte.com/fl/e0ABCVDbo9", "id": "e0ABCVDbo9", "link_to_current": false, "creation_date": "2022-03-12T11:30:01+0000", "created_by": "admin", "resource_id": "111a1111-32e1-111f-b164-1fe57c11caf1", "expiry_date": "2021-10-07T06:59:59+0000", "last_accessed": "2021-09-15T15:14:34.000+0000" } ], "count": 2 }
Request Parameters
Parameter | Description | Required |
---|---|---|
path | List links to a file or folder specified by its full path. | No |
username | List links created by this user. | No |
created_before | List links created before a given date (ISO-8601 e.g., 2022-03-05T14:55:59+0000). Please, note that the plus sign "+" must be present and URI-encoded (with "%2B"). | No |
created_after | List links created after a given date (ISO-8601 e.g., 2022-03-05T14:55:59+0000). Please, note that the plus sign "+" must be present and URI-encoded (with "%2B"). | No |
type | Filter to "file" or "folder" items only. | No |
accessibility | Filter to links whose accessibility is "anyone," "password," "domain," or "recipients." | No |
offset | The 0-based index of the initial record being requested. | No |
count | Limit number of entries per page. By default the max count of 500 entries is returned. | No |
Response Parameters
Element | Description |
---|---|
links | An array containing the full json information for all links for your domain that this user can see within any specified ranges |
count | The number of links visible to the user in the domain that are returned |
path | The absolute path of the target resource, either file or folder. |
type | The type of link, either file, folder, or upload |
accessibility | Who a link is accessible by, one of anyone, password, domain, or recipients. |
protection | If "PREVIEW" for a file (or folder) link, it is a a preview-only link to the file (folder), otherwise it is "NONE" |
recipients | An array of valid email addresses to which the link was sent. |
notify | Boolean as to whether the link creator will be notified via email when link is accessed. |
url | The full url of the link |
id | The id of the link |
link_to_current | Boolean as to whether the link will always refer to the current version of file. Only applicable for file links. |
creation_date | Date and time of creation of the link |
created_by | Username of the user that created the link |
resource_id | Id of the associated resource, either group id if it is a file link, or the folder id if it is a folder or upload link |
expiry_clicks | Number of clicks left on the link before expiration. This field is only shown if the link is to expire via clicks |
expiry_date | Date and time of the expiration of the link. This field is only shown if the link is to expire by date |
last_accessed | Date and time of the last access of the link. This field is only shown if the link has been accessed at least once |
Show Link Details
View the details of a link.
Request Examples
GET /pubapi/v1/links/owTMm8H8Sg HTTP/1.1 Host: apidemo.egnyte.com Authorization: Bearer 68zc95e3xv954u6k3hbnma3q
curl -v -H "Authorization: Bearer 68zc95e3xv954u6k3hbnma3q" \ https://apidemo.egnyte.com/pubapi/v1/links/owTMm8H8Sg
require 'egnyte' # Establish a session and a client session = Egnyte::Session.new({domain:'apidemo', access_token:'68zc95e3xv954u6k3hbnma3q'}) client = Egnyte::Client.new(session) # Call the link endpoint and save result to a variable my_link = client.link("owTMm8H8Sg") # Or, if you want to call the endpoint without a client. # my_link = Egnyte::Link.find(session,"owTMm8H8Sg")
Sample Response Body
{ "links": [ { "id": "47b774f66f344a67", "url": "https://domain.egnyte.com/h-s/20130717/47b774f66f344a67", "recipients": [ "jsmith@acme.com" ] }, { "id": "47b774f66f344a68", "url": "https://domain.egnyte.com/h-s/20130717/47b774f66f344a68", "recipients": [ "mjones@acme.com" ] } ], "path": "/Shared/Documents/example.txt", "type": "file", "accessibility": "recipients", "notify": true, "link_to_current": false, "expiry_date": "2021-05-27", "creation_date": "2021-05-02", "created_by": "gbrown", "last_accessed": "2021-05-20T11:41:34.000+0000" }
Create a Link
POST /pubapi/v1/links HTTP/1.1 Host: apidemo.egnyte.com Authorization: Bearer 68zc95e3xv954u6k3hbnma3q Content-Type: application/json Content-Length: 133 { "path":"/Shared/Documents/Engineering/Tech Talks/Aquamacs Manual.pdf", "type":"file", "accessibility": "anyone" }
curl -v --request POST -H "Authorization: Bearer 68zc95e3xv954u6k3hbnma3q" \ -H "Content-Type: application/json" \ --data '{"path":"/Shared/Documents/Engineering/Tech Talks/Aquamacs Manual.pdf", "type":"file", "accessibility": "anyone"}' \ https://apidemo.egnyte.com/pubapi/v1/links
require 'egnyte' # Establish a session and a client session = Egnyte::Session.new({domain:'apidemo', access_token:'68zc95e3xv954u6k3hbnma3q'}) client = Egnyte::Client.new(session) # Create the link my_link = client.create_link({ path: "/Shared/Documents/Engineering/Tech Talks/Aquamacs Manual.pdf", type: "file", accessibility: "anyone" })
Please, note that boolean type parameters (true, false) only accept lowercase inputs.
Parameter | Description | Required | Possible Values |
---|---|---|---|
path | The absolute path of the target file or folder. | Yes | A target file must include the filename. |
type | This determines what type of link will be created. | Yes | file, folder, or upload |
accessibility | Determines who a link is accessible by. | Yes (except upload links or links with "useDefaultSettings" = true) | anyone, password, domain, or recipients |
useDefaultSettings | Determines whether to use the default parameters for link creation. When useDefaultSettings is set to "true", the link will be created with the accessibility level adhering to all the restrictions and defaults for links set at the domain level (default link type), folder level (whether "public" links are allowed) and restrictions iimposed by "Content Safeguards" policies. | No (not required when "accessibility" parameter is provided or it is an upload link) | true, false |
send_email | If true is set, link will be sent via email by Egnyte. | No | true, false |
recipients | List email addresses of recipients of the link. Only required if send_email is true. | No | An array of valid email addresses. |
message | Personal message to be sent in link email. Only applies if send_email is true. | No | Plain text, HTML tags <br> and <p> are also supported |
copy_me | If true is set, a copy of the link message will be sent to the link creator. Only applies if send_email is true. Defaults to false. | No | true, false |
notify | If true is set, link creator will be notified via email when link is accessed. | No | true, false |
link_to_current | If true is set, the link will always refer to current version of file. If false is set, the link will always refer to the latest available version of the file. Only applicable for file links. |
No | true, false |
expiry_date | The expiry date for the link. If expiry_date is specified, expiry_clicks cannot be set. | No | Any future date in YYYY-MM-DD format. |
expiry_clicks | The number of clicks the link is valid for. If expiry_clicks is specified, expiry_date cannot be set | No | Value must be between 1 - 10, inclusive. |
add_file_name | If true then the filename will be appended to the end of the link. Only applies to file links, not folder links. | No | true, false |
password | An optional parameter to specify a password for password-protected links (when "accessibility" parameter is set to "password"). When not specified, the system will generate a password automatically. | No | A password string |
protection | If set to "PREVIEW" for a file (or folder) link, it will create a preview-only link to the file (or folder). | No | PREVIEW or NONE |
folder_per_recipient | If true then each recipient's uploaded data will be put into a separate folder. Only applies to upload links. | No | true, false |
Sample Response Body
{ "links": [ { "id": "47b774f66f344a67", "url": "https://domain.egnyte.com/h-s/20130717/47b774f66f344a67", "recipients": [ "jsmith@acme.com" ] }, { "id": "47b774f66f344a68", "url": "https://domain.egnyte.com/h-s/20130717/47b774f66f344a68", "recipients": [ "mjones@acme.com" ] } ], "path": "/Shared/Documents/example.txt", "type": "file", "accessibility": "recipients", "notify": true, "link_to_current": false, "expiry_date": "2021-05-27", "creation_date": "2021-05-02", "created_by": "gbrown" }
Delete a Link
DELETE /pubapi/v1/links/owTMm8H8Sg HTTP/1.1 Host: apidemo.egnyte.com Authorization: Bearer 68zc95e3xv954u6k3hbnma3q
curl -v --request DELETE -H "Authorization: Bearer 68zc95e3xv954u6k3hbnma3q" \ -H "Content-Type: application/json" \ https://apidemo.egnyte.com/pubapi/v1/links/owTMm8H8Sg
require 'egnyte' # Establish a session and a client session = Egnyte::Session.new({domain:'apidemo', access_token:'68zc95e3xv954u6k3hbnma3q'}) client = Egnyte::Client.new(session) # Call the endpoint to find a link and delete it. client.link("owTMm8H8Sg").delete
- Previous: Search API
- Up: Overview
- Next: Workflow API
Docs Navigation
- Overview
- Getting Started
- Authentication
- File System API
- Permissions API
- Events API
- Search API
- Links API
- Workflow API
- User Management API
- Group Management API
- Audit Reporting API v2
- Trash API
- Comments API
- Metadata API
- Embedded UI API
- Bookmarks API
- User Insights API
- Folder Options API
- Project Folder API
- UI Integration Framework
- Controlled Document Management API
- Best Practices
- Mobile Development
- Other Applications
- Webhooks
- Secure and Govern API
- Audit Reporting API V1
- MSP API