Read external file content

externalFileContent(projectReference: String!, provider: ExternalFileProvider!, fileId: String!): ExternalFileContent!

Requires project.integrations.read.

Arguments

ArgumentTypeRequiredDescription
projectReferenceString!YesProject ID or slug. Requires project.integrations.read through the caller's own personal provider connection.
providerExternalFileProvider!YesStorage provider accessed through the caller's own personal connection. A human caller is required; agent, run, and service-account credentials are refused.
fileIdString!Yes

Response

Returns ExternalFileContent!. Open the type for its fields and nested types.

FieldTypeDescription
fileExternalStorageFile!
contentString!Complete UTF-8 text or base64 content. More than 100000 encoded characters or 50 MiB returns limit_exceeded instead of partial content; use importExternalFile for larger files. Folders return invalid_input.
contentEncodingExternalFileContentEncoding!

Types marked with ! cannot be null. Lists use [Type] notation. The type index lists all published input and response types.

Example

graphql
query ExternalFileContent($projectReference: String!, $provider: ExternalFileProvider!, $fileId: String!) {
  externalFileContent(projectReference: $projectReference, provider: $provider, fileId: $fileId) {
    content
    contentEncoding
  }
}
json
{
  "projectReference": "example-project",
  "provider": "drive",
  "fileId": "example-file-id"
}