Skip to content
campaiDeveloper
campai.com

Misc · Drive

GET/{organizationId}/misc/drive/files/{fileId}Reads only

Get file

Gets a drive file by organization ID and file ID. Returns the file with links to open it and its preview image. Actor details may be masked depending on the caller’s permissions.

Permissions

Send an API key of the organization in the path, using the X-API-Key header.

Who may call it

  • The caller must have access to the organization.
  • A caller with drive.read and more than assigned-only drive access can get the file without a shared-folder check.
  • Otherwise, the file must be in a folder shared with the caller.
  • Without user.read, details of a non-current, non-contact actor are masked. The current actor is exempt from this check.
  • Without apiKey.read, API actor details are masked, even for the current actor.

Request

Path parameters

  • organizationIdidrequired
  • fileIdidrequired
Request
curl --fail-with-body --silent --show-error --max-time 30 --globoff \
  --request GET 'https://cloud.campai.com/api/YOUR_ORGANIZATION_ID/misc/drive/files/YOUR_FILE_ID' \
  --header 'X-API-Key: YOUR_API_KEY'

Response

200 Successful response

Content-Type: application/json

  • _idid
  • folderidnullable
  • namestring

    1–128 characters

  • kindstring
    image video audio pdf word excel powerpoint text archive other
  • fileobject
    4 properties
    • resourcestring

      at least 1 characters

    • fileNamestring

      at most 128 characters

    • contentTypestring

      at most 75 characters

    • fileSizeBytesinteger

      at least 0

  • thumbnailobjectnullable
    4 properties
    • resourcestring

      at least 1 characters

    • fileNamestring

      at most 128 characters

    • contentTypestring

      at most 75 characters

    • fileSizeBytesinteger

      at least 0

  • widthintegernullable
  • heightintegernullable
  • durationSecondsnumbernullable

    at least 0

  • waveformnumber[]nullable

    at most 96 items · each 0–1

  • createdAtstring · date-timenullable
  • createdByobjectnullable
  • updatedAtstring · date-timenullable
  • updatedByobjectnullable

More about the fields

  • createdBy.image: createdBy.image is null when a user actor is masked and the field must retain a user actor.
  • updatedBy.image: updatedBy.image is null when a user actor is masked and the field must retain a user actor.
Response200
{
  "_id": "000000000000000000000001",
  "folder": "000000000000000000000001",
  "name": "string",
  "kind": "image",
  "file": {
    "resource": "string"
  },
  "thumbnail": {
    "resource": "string"
  },
  "width": 1,
  "height": 1,
  "durationSeconds": 0,
  "waveform": [
    0
  ]
}

Errors

Other errors

StatusErrorWhen
404The file was not foundIf the file is not found in the organization, the endpoint returns HTTP 404 with routes.misc.drive.noFile.
404The file was not foundIf the caller cannot bypass the shared-folder check and the file has no folder or its folder is not shared, the endpoint returns HTTP 404 with routes.misc.drive.noFile.

Errors nearly every request can meet are listed under Errors.