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

ParameterTypeRequiredDefaultDescription
folder_pathstringNo/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.

FieldTypeDescription
recentFilesarrayArray of file objects
recentFiles[].namestringFile name
recentFiles[].pathstringFull path to the file
recentFiles[].sizeintegerFile size in bytes
recentFiles[].entry_idstringUnique identifier for the file
recentFiles[].group_idstringUnique identifier for the file version group
recentFiles[].uploaded_bystringName of the user who uploaded the file. Omitted when the owner is unavailable.
recentFiles[].num_versionsintegerNumber of versions for this file
recentFiles[].last_modifiedintegerLast modification timestamp in Unix time (milliseconds)
recentFiles[].last_accessedintegerLast access timestamp in Unix time (milliseconds)
recentFiles[].recommendation_typestringAlways "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

StatusErrorDescriptionResolution
200OKRequest fulfilled successfullyNo action needed
401UnauthorizedInvalid or expired access tokenVerify 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"
Reference →Browse all endpoints