Drive > Files > File/Directory

Count element in directory

Get number of element in a directory by ID

get/3/drive/{drive_id}/files/{file_id}/count

Request

  • Base URL
    https://api.infomaniak.com
  • URL
    https://api.infomaniak.com/3/drive/{drive_id}/files/{file_id}/count
  • Auth
    HTTP bearer

Path parameters

drive_idinteger required

Drive identifier

file_idinteger required

File identifier

Query parameters

depth'folder' | 'unlimited'

Specifies how elements are counted within given folder. Choose either to count only within the specified folder (folder) or to include subfolders in the count (unlimited). The default mode is folder.<ul><small><li><strong>folder:</strong> Count elements only in the specified folder, excluding subfolders.</li><li><strong>unlimited:</strong> Count elements in the specified folder and all subfolders.</li></small></ul>

Response

OK

result'success' | 'error' | 'asynchronous' required

Result of the HTTP request

Example response

{
  "result": "success",
  "data": {
    "count": 10,
    "files": 6,
    "directories": 4
  }
}

Changes

No recorded changes to this operation across all 40 revisions of this API.