# externalFileContent

```graphql
query ExternalFileContent($projectReference: String!, $provider: ExternalFileProvider!, $fileId: String!) {
  externalFileContent(projectReference: $projectReference, provider: $provider, fileId: $fileId) {
    file {
      id
      provider
      name
      path
      mimeType
      sizeBytes
      kind
      parentId
      modifiedAt
      etag
      thumbnailUrl
      webUrl
    }
    content
    contentEncoding
  }
}
```

Read external file content. Requires project.integrations.read.

## Arguments

| Name               | Type                  | Required | Description                                                                                                                                                                                            |
| ------------------ | --------------------- | -------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| `projectReference` | String!               | Yes      | Project ID or slug. Requires project.integrations.read through the caller's own personal provider connection.                                                                                          |
| `provider`         | ExternalFileProvider! | Yes      | Storage provider accessed through the caller's own personal connection. A human caller is required; agent, run, and service-account credentials are refused. One of `onedrive`, `sharepoint`, `drive`. |
| `fileId`           | String!               | Yes      |                                                                                                                                                                                                        |

## Variables

```json
{
  "projectReference": "string",
  "provider": "onedrive",
  "fileId": "string"
}
```

## Responses

| Status | Description                                           |
| ------ | ----------------------------------------------------- |
| 200    | The ExternalFileContent! in data.externalFileContent. |

## Call it

```bash
curl -X POST "https://api.veryfront.com/graphql" \
  -H "Authorization: Bearer $VERYFRONT_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "query": "query ExternalFileContent($projectReference: String!, $provider: ExternalFileProvider!, $fileId: String!) {\n  externalFileContent(projectReference: $projectReference, provider: $provider, fileId: $fileId) {\n    file {\n      id\n      provider\n      name\n      path\n      mimeType\n      sizeBytes\n      kind\n      parentId\n      modifiedAt\n      etag\n      thumbnailUrl\n      webUrl\n    }\n    content\n    contentEncoding\n  }\n}",
  "variables": {
    "projectReference": "string",
    "provider": "onedrive",
    "fileId": "string"
  }
}'
```

## Example response

```json
{
  "data": {
    "externalFileContent": {
      "file": {
        "id": "string",
        "provider": "string",
        "name": "string",
        "path": "string",
        "mimeType": "string",
        "sizeBytes": 0,
        "kind": "string",
        "parentId": "string",
        "modifiedAt": "string",
        "etag": "string",
        "thumbnailUrl": "https://example.com",
        "webUrl": "https://example.com"
      },
      "content": "string",
      "contentEncoding": "utf8"
    }
  }
}
```
