User Insights
The User Insights API provides information about files a user has recently accessed. Use this API to surface recently viewed or modified files in your application.
Base URL
https://{domain}.egnyte.com/pubapi/v1/insights
Authentication
All requests require an OAuth 2.0 Bearer token in the Authorization header:
Authorization: Bearer {access_token}
See Authentication for details on obtaining a token.
List Recent Files
Returns files recently accessed by the authenticated user. By default, returns up to 10 results.
Request
GET /pubapi/v1/insights/files
Path Parameters
None
Query Parameters
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
folder_path | string | No | / | Restricts results to files within the specified folder path |
Example Request
curl -i -X GET "https://{domain}.egnyte.com/pubapi/v1/insights/files" \ -H "Authorization: Bearer YOUR_ACCESS_TOKEN"
Response
200 OK
Returns an array of recently accessed files, sorted by most recent access. By default, returns up to 10 results.
| Field | Type | Description |
|---|---|---|
recentFiles | array | Array of file objects |
recentFiles[].name | string | File name |
recentFiles[].path | string | Full path to the file |
recentFiles[].size | integer | File size in bytes |
recentFiles[].entry_id | string | Unique identifier for the file |
recentFiles[].group_id | string | Unique identifier for the file version group |
recentFiles[].uploaded_by | string | Name of the user who uploaded the file. Omitted when the owner is unavailable. |
recentFiles[].num_versions | integer | Number of versions for this file |
recentFiles[].last_modified | integer | Last modification timestamp in Unix time (milliseconds) |
recentFiles[].last_accessed | integer | Last access timestamp in Unix time (milliseconds) |
recentFiles[].recommendation_type | string | Always "recent" for this endpoint |
Example Response
{
"recentFiles": [
{
"name": "Outline.docx",
"path": "/Private/johndoe/Drafts/Outline.docx",
"size": 307951,
"entry_id": "cba6286d-bad8-43c8-8176-07bb21ef209f",
"group_id": "84792f80-2f1e-416d-a6c0-ba6fd1855dbb",
"uploaded_by": "John Doe",
"num_versions": 2,
"last_modified": 1542833068000,
"last_accessed": 1542945701862,
"recommendation_type": "recent"
},
{
"name": "SlideShow.ppsx",
"path": "/Private/johndoe/Presentations/SlideShow.ppsx",
"size": 5327450,
"entry_id": "4c68ac52-f4a1-494a-86a1-ad2f8c6966e5",
"group_id": "1ec9e82e-b587-4118-a1c3-b0bde264165b",
"uploaded_by": "John Doe",
"num_versions": 0,
"last_modified": 1542823959000,
"last_accessed": 1542945442611,
"recommendation_type": "recent"
},
{
"name": "Presentation1.pptx",
"path": "/Shared/Documents/Presentation1.pptx",
"size": 175352,
"entry_id": "b0b17eaf-2068-49bd-85e7-fc60cad58d58",
"group_id": "31b9bbbf-5132-4d8d-867b-3e8657de70b8",
"uploaded_by": "Chelsea Sutton",
"num_versions": 0,
"last_modified": 1533162184000,
"last_accessed": 1541529105667,
"recommendation_type": "recent"
}
]
}
Error Codes
| Status | Error | Description | Resolution |
|---|---|---|---|
| 200 | OK | Request fulfilled successfully | No action needed |
| 401 | Unauthorized | Invalid or expired access token | Verify the access token is valid and has not expired |
Code Examples
GET /pubapi/v1/insights/files
curl -i -X GET "https://{domain}.egnyte.com/pubapi/v1/insights/files" \ -H "Authorization: Bearer YOUR_ACCESS_TOKEN"
GET /pubapi/v1/insights/files
curl -i -X GET "https://{domain}.egnyte.com/pubapi/v1/insights/files" \ -H "Authorization: Bearer YOUR_ACCESS_TOKEN"
Related Resources
- Authentication — How to obtain and refresh tokens
- File System API — Create, read, update, and delete files and folders
