Get File Accesses

get

/documents/api/1.2/files/{fileId}/accesses

Get information on which users have accessed the specified file.

Request

Supported Media Types
Path Parameters
Query Parameters
  • Specify the maximum number of accesses to return. Use this parameter to specify how many items to include on a single page of results. The default is 200.

  • Specify the point at which to begin the list of items from the complete set of items returned for the action. If you do not specify an offset, the returned items begin with the first item in the item list (offset=0).

  • The results can be sorted by the fields below. The sort order can be defined as ascending (asc) or descending (desc). The default sort order is ascending.

    • accessedBy sorts by the user who initiated the activity.
    • version sorts by version of the item on which activity occurred.
    • accessType sorts by the type of the access (for example: preview, download).
    • size sorts by the size of the item accesses.
    • accessedTime sorts by the time of the access.
    • clientIP sorts by IP address of the client on which this activity was initiated.
    • errorCode sorts by the status code of the activity.

Header Parameters
  • Applink access token authorizing the current user to access the parent folder or this file. This parameter is mandatory if appLinkID is used. It can be used as accessToken or AccessToken.

  • Applink ID authorizing the current user to access the parent folder or this file. Any time the parameter appLinkID is used, a parameter accessToken must be provided as well. To work, this applink must have at least the contributor role granted. It can be used as appLinkID or AppLinkID.

  • Access code needed to use protected public links. It needs to be sent as part of a Cookie header in the following format: dAccessCode-<linkID>=<passcodeValue>

  • Public link ID of a public link authorizing the current user to access this file. It can be used as linkID or LinkID.

Back to Top

Response

Supported Media Types

200 Response

The request was fulfilled.

Body ()
Root Schema : FileAccessesResponse
Type: object
Show Source
Nested Schema : items
Type: array
List of File Accesses.
Show Source
Nested Schema : FileAccessItemsDefinition
Type: object
Show Source
Nested Schema : User
Type: object
User information
Show Source
Example Response (application/json)
{
    "count":"1",
    "errorCode":"0",
    "hasMore":"0",
    "totalCount":"1",
    "type":"access",
    "items":[
        {
            "type":"file",
            "accessType":"download",
            "accessedTime":"2017-05-02T21:23:18.000Z",
            "id":"D574378400573ED9D62B3195T0000000000100000001",
            "version":"1",
            "accessedBy":{
                "displayName":"User AA",
                "id":"U0EAA20910FAF3052ACB79E4T00000000001",
                "loginName":"userAALoginName",
                "type":"user"
            },
            "errorCode":"0",
            "clientIP":"10.10.82.114",
            "refererURL":"https://service1-tenant1:19200/documents/fileview/D1EEF28A920A342E8EC0E39645B3E9DD6490EF9D4696/_Mugs.jpg",
            "size":"53834"
        }
    ]
}

400 Response

Request parameters are not formatted correctly.

403 Response

Forbidden if the user does not have read permission.

404 Response

File ID is not found.

Back to Top

Examples

The following example gets information about the accesses (downloads and previews) for a file.

GET .../files/D28824DCD6CB04122318CE9845B3E9DD64902A090B2E/accesses

Request Header

None.

Request Body

None.

HTTP Status Code

HTTP_STATUS = 200

JSON Response

{
    "count": "4",
    "errorCode": "0",
    "hasMore": "0",
    "totalCount": "4",
    "type": "access",
    "items": [
        {
            "type": "file",
            "accessType": "preview",
            "accessedTime": "2017-05-03T21:47:24Z",
            "id": "D28824DCD6CB04122318CE9845B3E9DD64902A090B2E",
            "version": "1",
            "accessedBy": {
            	"displayName": "User AA",
		"id": "U0EAA20910FAF3052ACB79E4T00000000001",
		"loginName": "userAALoginName",
		"type": "user"
            },
            "errorCode": "0",
            "clientIP": "10.154.148.63",
            "refererURL": "https://service1-tenant1.hourly.gemini.shared.osn.oraclecorp.com:19201/documents/fileview/D28824DCD6CB04122318CE9845B3E9DD64902A090B2E/_Mugs.jpg",
            "size": "53834"
        },
        {
            "type": "file",
            "accessType": "download",
            "accessedTime": "2017-05-03T21:47:06Z",
            "id": "D28824DCD6CB04122318CE9845B3E9DD64902A090B2E",
            "version": "1",
            "accessedBy": {
            	"displayName": "User AA",
		"id": "U0EAA20910FAF3052ACB79E4T00000000001",
		"loginName": "userAALoginName",
		"type": "user"
            },
            "errorCode": "0",
            "clientIP": "10.154.148.63",
            "refererURL": "https://service1-tenant1.hourly.gemini.shared.osn.oraclecorp.com:19201/documents/folder/F9D24A8073BF47E5B9B1CAE345B3E9DD64902A090B2E/_accessed",
            "size": "53834"
        },
        {
            "type": "file",
            "accessType": "preview",
            "accessedTime": "2017-05-03T21:46:45Z",
            "id": "D28824DCD6CB04122318CE9845B3E9DD64902A090B2E",
            "version": "1",
            "accessedBy": {
            	"displayName": "User AA",
		"id": "U0EAA20910FAF3052ACB79E4T00000000001",
		"loginName": "userAALoginName",
		"type": "user"
            },
            "errorCode": "0",
            "clientIP": "10.154.148.63",
            "refererURL": "https://service1-tenant1.hourly.gemini.shared.osn.oraclecorp.com:19201/documents/fileview/D28824DCD6CB04122318CE9845B3E9DD64902A090B2E/_Mugs.jpg",
            "size": "53834"
        },
        {
            "type": "file",
            "accessType": "preview",
            "accessedTime": "2017-05-03T21:44:21Z",
            "id": "D28824DCD6CB04122318CE9845B3E9DD64902A090B2E",
            "version": "1",
            "accessedBy": {
            	"displayName": "User AA",
		"id": "U0EAA20910FAF3052ACB79E4T00000000001",
		"loginName": "userAALoginName",
		"type": "user"
            },
            "errorCode": "0",
            "clientIP": "10.154.148.63",
            "refererURL": "https://service1-tenant1.hourly.gemini.shared.osn.oraclecorp.com:19201/documents/fileview/D28824DCD6CB04122318CE9845B3E9DD64902A090B2E/_Mugs.jpg",
            "size": "53834"
        }
    ]
}

Example 2

The following example gets information about the accesses (downloads and previews) for a file, sorted by accessType. Note that the "preview" types are listed first.

GET .../files/D28824DCD6CB04122318CE9845B3E9DD64902A090B2E/accesses?orderBy=accessType

Request Header

None.

Request Body

None.

HTTP Status Code

HTTP_STATUS = 200

JSON Response

{
    "count": "4",
    "errorCode": "0",
    "hasMore": "0",
    "totalCount": "4",
    "type": "access",
    "items": [
        {
            "type": "file",
            "accessType": "preview",
            "accessedTime": "2017-05-03T21:44:21Z",
            "id": "D28824DCD6CB04122318CE9845B3E9DD64902A090B2E",
            "version": "1",
            "accessedBy": {
            	"displayName": "User AA",
		"id": "U0EAA20910FAF3052ACB79E4T00000000001",
		"loginName": "userAALoginName",
		"type": "user"
            },
            "errorCode": "0",
            "clientIP": "10.154.148.63",
            "refererURL": "https://service1-tenant1.hourly.gemini.shared.osn.oraclecorp.com:19201/documents/fileview/D28824DCD6CB04122318CE9845B3E9DD64902A090B2E/_Mugs.jpg",
            "size": "53834"
        },
        {
            "type": "file",
            "accessType": "preview",
            "accessedTime": "2017-05-03T21:47:24Z",
            "id": "D28824DCD6CB04122318CE9845B3E9DD64902A090B2E",
            "version": "1",
            "accessedBy": {
            	"displayName": "User AA",
		"id": "U0EAA20910FAF3052ACB79E4T00000000001",
		"loginName": "userAALoginName",
		"type": "user"
            },
            "errorCode": "0",
            "clientIP": "10.154.148.63",
            "refererURL": "https://service1-tenant1.hourly.gemini.shared.osn.oraclecorp.com:19201/documents/fileview/D28824DCD6CB04122318CE9845B3E9DD64902A090B2E/_Mugs.jpg",
            "size": "53834"
        },
        {
            "type": "file",
            "accessType": "preview",
            "accessedTime": "2017-05-03T21:46:45Z",
            "id": "D28824DCD6CB04122318CE9845B3E9DD64902A090B2E",
            "version": "1",
            "accessedBy": {
            	"displayName": "User AA",
		"id": "U0EAA20910FAF3052ACB79E4T00000000001",
		"loginName": "userAALoginName",
		"type": "user"
            },
            "errorCode": "0",
            "clientIP": "10.154.148.63",
            "refererURL": "https://service1-tenant1.hourly.gemini.shared.osn.oraclecorp.com:19201/documents/fileview/D28824DCD6CB04122318CE9845B3E9DD64902A090B2E/_Mugs.jpg",
            "size": "53834"
        },
        {
            "type": "file",
            "accessType": "download",
            "accessedTime": "2017-05-03T21:47:06Z",
            "id": "D28824DCD6CB04122318CE9845B3E9DD64902A090B2E",
            "version": "1",
            "accessedBy": {
            	"displayName": "User AA",
		"id": "U0EAA20910FAF3052ACB79E4T00000000001",
		"loginName": "userAALoginName",
		"type": "user"
            },
            "errorCode": "0",
            "clientIP": "10.154.148.63",
            "refererURL": "https://service1-tenant1.hourly.gemini.shared.osn.oraclecorp.com:19201/documents/folder/F9D24A8073BF47E5B9B1CAE345B3E9DD64902A090B2E/_accessed",
            "size": "53834"
        }
    ]
}

Example 3

The following example gets information about the accesses (downloads and previews) for a file, sorted by accessType in ascending order, and limited to 2. Note that only 2 items are returned with count, hasMore, and totalCount set appropriately. The download types are listed first.

GET .../files/D28824DCD6CB04122318CE9845B3E9DD64902A090B2E/accesses?orderBy=accessType?orderBy=accessType:asc&limit=2

Request Header

None.

Request Body

None.

HTTP Status Code

HTTP_STATUS = 200

JSON Response

{
    "count": "2",
    "errorCode": "0",
    "hasMore": "1",
    "totalCount": "4",
    "type": "access",
    "items": [
        {
            "type": "file",
            "accessType": "download",
            "accessedTime": "2017-05-03T21:47:06Z",
            "id": "D28824DCD6CB04122318CE9845B3E9DD64902A090B2E",
            "version": "1",
            "accessedBy": {
            	"displayName": "User AA",
		"id": "U0EAA20910FAF3052ACB79E4T00000000001",
		"loginName": "userAALoginName",
		"type": "user"
            },
            "errorCode": "0",
            "clientIP": "10.154.148.63",
            "refererURL": "https://service1-tenant1.hourly.gemini.shared.osn.oraclecorp.com:19201/documents/folder/F9D24A8073BF47E5B9B1CAE345B3E9DD64902A090B2E/_accessed",
            "size": "53834"
        },
        {
            "type": "file",
            "accessType": "preview",
            "accessedTime": "2017-05-03T21:47:24Z",
            "id": "D28824DCD6CB04122318CE9845B3E9DD64902A090B2E",
            "version": "1",
            "accessedBy": {
            	"displayName": "User AA",
		"id": "U0EAA20910FAF3052ACB79E4T00000000001",
		"loginName": "userAALoginName",
		"type": "user"
            },
            "errorCode": "0",
            "clientIP": "10.154.148.63",
            "refererURL": "https://service1-tenant1.hourly.gemini.shared.osn.oraclecorp.com:19201/documents/fileview/D28824DCD6CB04122318CE9845B3E9DD64902A090B2E/_Mugs.jpg",
            "size": "53834"
        }
    ]
}

Example 4

The following example gets information about the accesses (downloads and previews) for a file. The example uses an applink ID because this file is under a folder structure not owned by or shared with the current user. The applink ID and access token are submitted in the request header.

GET .../files/DED694950C14AFF280419F9AB5D17B95F47087F4E518/accesses

Request Header

appLinkID: LF5Bxj4TPo_p4n4qWn0tbKTicR2cTUJKv7X_ng9E7ry93rRuDokPqS1d6-wKwhb_wtcGYFDsI_cNMxeKQ-HR-FXQhiVoGRTYM_MPZY8qpICfYU94mmnMjM_cvsRhKMzc0NJgvwEJfqqDwPsAVrhc8cmg== 
accessToken: 352FpiMmW66PeYI1Gh5b83I9CXRwZhLfYAu4TXdqpzD8uNKUBMZVVJ3ZvivUW8kQ

Request Body

None.

HTTP Status Code

HTTP_STATUS = 200

JSON Response

{
    "count": "1",
    "errorCode": "0",
    "hasMore": "0",
    "totalCount": "1",
    "type": "access",
    "items": [
        {
            "type": "file",
            "accessType": "download",
            "accessedTime": "2017-06-26T17:38:44Z",
            "id": "DED694950C14AFF280419F9AB5D17B95F47087F4E518",
            "version": "2",
            "accessedBy": {
                "displayName": "User BB",
                "id": "U5083EA1954687218BA6C3D9B5D17B95F470",
                "loginName": "U5083EA1954687218BA6C3D9B5D17B95F470",
                "type": "user"
            },
            "errorCode": "-25",
            "errorMessage": "Unable to download file. Access token for app link has expired.",
            "clientIP": "10.154.128.31",
            "size": "29"
        }
    ]
}

Example 5

The following example does not return information about the accesses because the file ID is not valid.

GET ...files/F8BDBD5812C1C10E3E5C1A1C45B3E9DD649028853801/accesses

Request Header

None.

Request Body

None.

HTTP Status Code

HTTP_STATUS = 404

JSON Response

{
    "errorCode": "-16",
    "errorKey": "!csActivitesGetHistoryError!csSecurityValidationFailed!csFldDoesNotExist,DF1D474F24FCE3A517F69D7F45B3E9DD64909ED47144!csUnprivilegedSystemError",
    "errorMessage": "Unable to get history of activities. Security validation failed. 'DF1D474F24FCE3A517F69D7F45B3E9DD64909ED47144' does not exist. The error was caused by an internally generated issue. The error has been logged.",
    "errorType": "file",
    "id": "DF1D474F24FCE3A517F69D7F45B3E9DD64909ED47144",
    "title": "Unable to get history of activities. Security validation failed. 'DF1D474F24FCE3A517F69D7F45B3E9DD64909ED47144' does not exist. The error was caused by an internally generated issue. The error has been logged.",
    "type": "https://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html"
}

Example 6

The following example does not return information about the accesses because the user does not have access to the specified file ID.

GET ...files/D1C9B4DB1F9D7632AA68A7B845B3E9DD64909ED4714F/accesses

Request Header

None.

Request Body

None.

HTTP Status Code

HTTP_STATUS = 403

JSON Response

JSON Response
{
    "errorCode": "-20",
    "errorKey": "!csActivitesGetHistoryError!csCloudItemInsufficientPrivileges,tenant1.cecsuser4,fFileGUID:D1C9B4DB1F9D7632AA68A7B845B3E9DD64909ED4714F,GET_ACTIVITY_HISTORY",
    "errorMessage": "Unable to get history of activities. User 'User AA' has insufficient privilege to access fFileGUID:D1C9B4DB1F9D7632AA68A7B845B3E9DD64909ED4714F with service GET_ACTIVITY_HISTORY.",
    "errorType": "file",
    "id": "D1C9B4DB1F9D7632AA68A7B845B3E9DD64909ED4714F",
    "title": "Unable to get history of activities. User 'User AA' has insufficient privilege to access fFileGUID:D1C9B4DB1F9D7632AA68A7B845B3E9DD64909ED4714F with service GET_ACTIVITY_HISTORY.",
    "type": "https://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html"
}
Back to Top