UI Integration Framework
The UI Integration Framework allows developers to extend the Egnyte Web UI by adding custom actions to the "More" menu and context menu for files and folders. This enables users to trigger your app's functionality directly from the Egnyte interface.
Note: Access to the UI Integration Framework requires approval. Contact partners@egnyte.com to get started.
Overview
The UI Integration Framework enables you to:
- Add custom menu items to the Egnyte Web UI
- Trigger actions on selected files or folders
- Receive file metadata and OAuth tokens to interact with the Egnyte API
- Configure user-specific settings for your integration
Your integration is defined in a definition.json file that specifies where and how your app appears in the Egnyte UI.
How It Works
Integration Flow
- User selects files/folders in the Egnyte Web UI
- User clicks your custom menu item (in "More" or context menu)
- Egnyte POSTs to your service URL with file metadata and OAuth token
- Your service responds with a redirect URL
- Egnyte opens the redirect URL in the user's browser
- Your app performs actions using the Egnyte API
- (Optional) Your app notifies Egnyte to refresh the UI
App Definition
The definition.json file defines your app's listing in the Egnyte App Store and configures how custom actions appear in the UI.
Definition Schema
| Field | Type | Required | Description |
|---|---|---|---|
appId | string (GUID) | Yes | Unique identifier for your app |
name | string | Yes | Display name of your app |
apiKey | string | Yes | Your public API key |
company.name | string | Yes | Your company name |
company.website | string | No | Your company website URL |
support.web | string | No* | Support website URL |
support.email | string | No* | Support email address |
support.phone | string | No* | Support phone number |
userManual | string | No | URL to user documentation |
categories | array | Yes | Categories from: productivity, collaboration, businessAutomation, securityAdministration, projectManagement, migrationSynchronization |
industries | array | No | Target industries (options TBD) |
type | string | Yes | One of: egnyte_ui, web, mobile, desktop |
userSettings | string | No | URL to user settings configuration page |
globalSettings | string | No | URL to global settings configuration page |
description | string | Yes | Short description for App Store |
longDescription | string | No | Detailed description for App Store |
appLogo | string | Yes | URL to app logo (236×126px, white/transparent background) |
invocationAppLogo | string | No | URL to logo shown during invocation (defaults to appLogo) |
version | string | No | App version number |
screenshots.video | array | No | YouTube video URL (16:9 ratio, max 1) |
screenshots.images | array | Yes | Array of screenshot URLs (16:9 ratio, 425×239px minimum, 3+ required) |
url | string | No** | URL to your app (required if type is not egnyte_ui) |
supportedPlatforms | array | No** | Platforms: windows, mac, linux, ios, android, wp (required if type is not web or egnyte_ui) |
domains | array | No | Restrict integration to specific Egnyte domains |
integrations | object | Yes*** | Integration definitions (required if type is egnyte_ui) |
* At least one support contact method (web, email, or phone) is required
** Required depending on type value
*** Required if type is egnyte_ui
Integration Object Schema
Each key in the integrations object defines a separate menu item. The key becomes the default menu text if text is not specified.
| Field | Type | Required | Description |
|---|---|---|---|
entryPoint | string | Yes | Where the action appears: context_menu or more_menu |
serviceUrl | string | Yes | URL Egnyte POSTs to when the action is triggered |
invocationMethod | string | Yes | How to invoke: post_to_tab, post_headless, or get_to_modal |
types | array | Yes | Item types: file, folder, or both |
text | string | No | Menu item label (defaults to integration key) |
icon | string | No | FontAwesome 3.2 icon name or image URL (14×14px, solid #626364, transparent background) |
tooltip | string | No | Tooltip text on hover |
extensions | array | No | Restrict to specific file extensions (e.g., ["pdf", "docx"]) |
permissionLevels | array | No | Restrict to permission levels: owner, full, editor, viewer |
allowedPaths | array | No | Restrict to specific paths using glob patterns (e.g., ["/Shared/Projects/*"]) |
accessLevel | string | No | Scope of access: selection, folder, or fileSystem |
selectionQuantity | string or array | No | Limit selection: single, multiple, or range like [2, 5] |
Note: Path globs use simplified syntax where * is the only special character. Patterns must start from root (e.g., /Shared/*).
Example Definition
{
"appId": "abccompany",
"name": "Egnyte for ABC Company",
"company": {
"name": "ABC Company, Inc.",
"website": "https://www.abccompany.com"
},
"apiKey": "your_api_key_here",
"support": {
"web": "https://example.com/abccompany/helpdesk",
"email": "support@abccompany.com"
},
"categories": ["productivity", "collaboration"],
"type": "egnyte_ui",
"appLogo": "https://example.com/abccompany/static/abc_company_logo.png",
"description": "Send documents for electronic signature using ABC Company.",
"longDescription": "Send documents from your Egnyte account to ABC Company for signing. Once the e-signature workflow is complete, the signed document is automatically saved back to your Egnyte account.",
"screenshots": {
"images": [
"https://example.com/screenshots/screenshot1.png",
"https://example.com/screenshots/screenshot2.png",
"https://example.com/screenshots/screenshot3.png"
]
},
"userSettings": "https://example.com/abccompany/user/setup",
"integrations": {
"sendFiles": {
"entryPoint": "context_menu",
"types": ["file"],
"serviceUrl": "https://example.com/abccompany/files/invoke",
"extensions": ["pdf", "doc", "docx"],
"permissionLevels": ["owner", "full", "editor"],
"invocationMethod": "post_to_tab",
"icon": "https://example.com/abccompany/static/abccompany_icon.png",
"text": "Send with ABC Company"
},
"sendTemplates": {
"entryPoint": "more_menu",
"types": ["folder"],
"serviceUrl": "https://example.com/abccompany/templates/invoke",
"permissionLevels": ["owner", "full", "editor"],
"invocationMethod": "post_to_tab",
"icon": "https://example.com/abccompany/static/abccompany_icon.png",
"text": "Send template with ABC Company"
},
"viewEnvelopes": {
"entryPoint": "more_menu",
"types": ["folder"],
"serviceUrl": "https://example.com/abccompany/envelopes/invoke",
"permissionLevels": ["owner", "full", "editor", "viewer"],
"invocationMethod": "post_to_tab",
"icon": "list-alt",
"text": "Check Status of ABC Company Requests"
}
}
}
User Settings Flow
The User Settings flow allows you to collect and store user-specific configuration (such as authentication tokens) when a user installs your app. This flow is optional and only triggered if userSettings is defined in definition.json.
Flow Overview
- User installs your app in Egnyte
- Egnyte generates a one-time token and opens your
userSettingsURL - Your app collects user settings
- Your app POSTs settings back to Egnyte's
save_url - Egnyte stores settings and includes them in future invocations
User Installs Your Application
When a user installs your app, Egnyte opens your userSettings URL in a new browser tab with query parameters.
Request
GET {userSettings}?token={one_time_token}&save_url={save_url}&domain={domain}
Query Parameters
| Parameter | Type | Description |
|---|---|---|
token | string | One-time use token for authenticating the save request |
save_url | string | URL to POST user settings back to Egnyte |
domain | string | User's Egnyte domain (e.g., apidemo.egnyte.com) |
Example Request
curl -i -X GET "https://{redirect_uri_base}/abccompany/user/setup?token={access_token}&save_url=https://{domain}.egnyte.com/pubapi/v1/integrations/save&domain=apidemo.egnyte.com" \ -H "Host: example.com" \ -H "Authorization: Bearer YOUR_ACCESS_TOKEN"
Save User Settings to Egnyte
After collecting user settings, POST them to the save_url provided in the initial request.
Request
POST {save_url}
Request Body
| Field | Type | Required | Description |
|---|---|---|---|
token | string | Yes | The one-time token from the initial request |
data | object | Yes | Key-value map of user settings to store |
Example Request
curl -i -X POST "https://{domain}.egnyte.com/pubapi/v1/integrations/save" \ -H "Content-Type: application/json" \ -H "Authorization: Bearer YOUR_ACCESS_TOKEN" \ -d '{ "token": "abc123xyz", "data": { "auth_token": "user_oauth_token_here", "preferences": { "auto_save": true, "notification_email": "user@example.com" } } }'
Response
200 OK
Egnyte stores the user settings and invalidates the one-time token. The settings in data will be included in the config field of future invocation requests.
Invocation Flow
When a user triggers your custom action, Egnyte initiates a server-to-server POST to your serviceUrl, then opens a redirect URL in the user's browser.
Flow Overview
- Egnyte POSTs to your
serviceUrlwith file metadata and OAuth token - Your service stores the request and returns a redirect URL
- Egnyte opens the redirect URL in the user's browser
- Your app performs actions using the Egnyte API
- (Optional) Your app notifies Egnyte to refresh the UI
Receive Invocation from Egnyte
When a user clicks your menu item, Egnyte sends a POST request to your serviceUrl.
Request
POST {serviceUrl}
Request Headers
| Header | Value |
|---|---|
Content-Type | application/json |
User-Agent | Java/1.7.0_71 (or similar) |
Request Body
| Field | Type | Description |
|---|---|---|
domain | string | User's Egnyte domain URL (e.g., https://apidemo.egnyte.com) |
token | string | OAuth access token for the user |
userInfo | object | User details (see below) |
items | array | Selected files/folders (see below) |
config | object | User settings saved via User Settings Flow |
userInfo Object
| Field | Type | Description |
|---|---|---|
id | integer | User ID |
first_name | string | User's first name |
last_name | string | User's last name |
username | string | User's username |
items Array Elements
| Field | Type | Description |
|---|---|---|
path | string | Full path to the item |
name | string | Item name |
is_folder | boolean | true if folder, false if file |
entry_id | string | Unique entry ID |
group_id | string | Group ID |
size | integer | File size in bytes (files only) |
checksum | string | SHA-512 checksum (files only) |
locked | boolean | Whether the file is locked |
last_modified | string | Last modified timestamp (RFC 2822 format) |
uploaded_by | string | Username of uploader |
num_versions | integer | Number of versions |
num_notes | integer | Number of notes/comments |
Example Request
curl -i -X POST "{serviceUrl}" \ -H "Content-Type: application/json" \ -H "Authorization: Bearer YOUR_ACCESS_TOKEN" \ -d '{ "domain": "https://{domain}.egnyte.com", "token": "68zc95e3xv954u6k3hbnma3q", "userInfo": { "id": 12345, "first_name": "Jane", "last_name": "Doe", "username": "jdoe" }, "items": [ { "checksum": "4f8e628cb324c3176f42a26478fdce624cab17d124b5e80395a05c7b1dba6eb9...", "size": 3745, "path": "/Shared/Documents/Demo/test.docx", "name": "test.docx", "locked": false, "is_folder": false, "entry_id": "{entryId}", "group_id": "{groupId}", "last_modified": "Fri, 30 Oct 2015 10:28:41 GMT", "uploaded_by": "jdoe", "num_versions": 1, "num_notes": 0 } ], "config": { "auth_token": "user_oauth_token_here", "preferences": { "auto_save": true } } }'
Return Redirect URL
Your service must respond with a JSON object containing a redirect URL.
Response
200 OK
| Field | Type | Description |
|---|---|---|
redirect | string | URL to open in the user's browser |
Example Response
{
"redirect": "https://example.com/abccompany/session/a1b2c3d4"
}
Note: The redirect URL typically includes a unique session identifier so you can retrieve the stored request data when the user's browser loads the page.
Example Implementation
from flask import Flask, request, jsonify
import uuid
import redis
app = Flask(__name__)
cache = redis.Redis()
@app.route('/abccompany/files/invoke', methods=['POST'])
def invoke():
data = request.json
# Generate unique session ID
session_id = str(uuid.uuid4())
# Store invocation data
cache.setex(
f"session:{session_id}",
3600, # 1 hour expiry
json.dumps(data)
)
# Return redirect URL
return jsonify({
"redirect": f"https://example.com/abccompany/session/{session_id}"
})
Handle User Browser Session
Egnyte opens the redirect URL in a new browser tab. Your app retrieves the stored invocation data and presents your UI to the user.
Tip: Use an HTTP 302 redirect to show a "pretty" URL to the user instead of exposing the session ID directly.
Example Session Handler
@app.route('/abccompany/session/<session_id>')
def session(session_id):
# Retrieve stored data
data = json.loads(cache.get(f"session:{session_id}"))
# Use the OAuth token to interact with Egnyte API
token = data['token']
domain = data['domain']
items = data['items']
# Redirect to main app interface
return redirect(f"/abccompany/app?session={session_id}")
Notify Egnyte of Changes (Optional)
While your app is open, you can communicate with the Egnyte Web UI using JavaScript events to refresh the file list or notify users of completion or errors.
Use the Egnyte JavaScript SDK to send events:
- Completion: Notify that your action completed successfully
- Error: Display an error message to the user
- Refresh: Reload the file/folder list in Egnyte
Example: Notify Completion
// Include Egnyte JS SDK
import Egnyte from 'egnyte-js-sdk';
// Notify Egnyte that the action completed
Egnyte.uintegrate.notifyCompletion({
message: "Document sent successfully"
});
Example: Refresh File List
// Trigger a refresh of the current folder
Egnyte.uintegrate.refresh();
Example: Show Error
// Display an error to the user
Egnyte.uintegrate.notifyError({
message: "Failed to send document. Please try again."
});
Best Practices
Security
- Validate tokens: Always verify that the one-time token in User Settings Flow is valid before saving settings
- Store tokens securely: Encrypt OAuth tokens and user settings in your database
- Use HTTPS: All URLs in
definition.jsonmust use HTTPS - Expire sessions: Set reasonable expiration times for session data (recommended: 1 hour)
User Experience
- Fast redirects: Respond to invocation POSTs quickly (< 2 seconds) to avoid user-facing delays
- Clear menu text: Use concise, action-oriented labels for menu items (e.g., "Send with ABC Company" not "ABC Company Integration")
- Appropriate icons: Use recognizable icons that match your action's purpose
- Handle errors gracefully: Use
notifyErrorto inform users of failures instead of showing generic error pages
API Usage
- Reuse tokens: The OAuth token in invocation requests is valid for the user's session — cache it for the duration of your workflow
- Respect rate limits: Follow Egnyte's rate limits (2 QPS, 1,000 calls/day by default)
- Use entry IDs: Prefer
entry_idoverpathwhen making API calls, as paths can change
Related Resources
- Egnyte JavaScript SDK — Client-side SDK for interacting with Egnyte
- Public API Authentication — OAuth 2.0 implementation guide
- File System API — API for working with files and folders
- Partner Program — Contact to request UI Integration Framework access
