# pub.chive.claiming.fetchExternalPdf

> Published by [chive.pub](https://lexicon.garden/identity/did:plc:7natp5xae72bddaqlkef2t4e)

✓ This is the authoritative definition for this NSID.

## Links

- [View on Lexicon Garden](https://lexicon.garden/lexicon/did:plc:7natp5xae72bddaqlkef2t4e/pub.chive.claiming.fetchExternalPdf)
- [Documentation](https://lexicon.garden/lexicon/did:plc:7natp5xae72bddaqlkef2t4e/pub.chive.claiming.fetchExternalPdf/docs)
- [Examples](https://lexicon.garden/lexicon/did:plc:7natp5xae72bddaqlkef2t4e/pub.chive.claiming.fetchExternalPdf/examples)

## Definitions

### `pub.chive.claiming.fetchExternalPdf`

**Type**: `query`

Fetch external PDF through proxy to avoid CORS issues. Returns PDF binary data. Only allows fetching from trusted academic sources.

#### Parameters

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| `source` | `string` | Yes | External source identifier (e.g., arxiv, biorxiv, medrxiv) |
| `externalId` | `string` | Yes | Source-specific identifier for the eprint |

#### Output

**Encoding**: `application/pdf`

#### Errors

- **AuthenticationRequired**: Authentication is required to fetch PDFs
- **InvalidParameters**: Missing source or externalId parameter
- **EprintNotFound**: The specified eprint does not exist in the external source
- **PdfNotAvailable**: No PDF is available for this eprint
- **DomainNotAllowed**: PDF URL is not from an allowed academic domain
- **FetchFailed**: Failed to fetch PDF from external source

## Raw Schema

```json
{
  "id": "pub.chive.claiming.fetchExternalPdf",
  "defs": {
    "main": {
      "type": "query",
      "errors": [
        {
          "name": "AuthenticationRequired",
          "description": "Authentication is required to fetch PDFs"
        },
        {
          "name": "InvalidParameters",
          "description": "Missing source or externalId parameter"
        },
        {
          "name": "EprintNotFound",
          "description": "The specified eprint does not exist in the external source"
        },
        {
          "name": "PdfNotAvailable",
          "description": "No PDF is available for this eprint"
        },
        {
          "name": "DomainNotAllowed",
          "description": "PDF URL is not from an allowed academic domain"
        },
        {
          "name": "FetchFailed",
          "description": "Failed to fetch PDF from external source"
        }
      ],
      "output": {
        "encoding": "application/pdf",
        "description": "PDF binary data with Content-Disposition header for download"
      },
      "parameters": {
        "type": "params",
        "required": [
          "source",
          "externalId"
        ],
        "properties": {
          "source": {
            "type": "string",
            "description": "External source identifier (e.g., arxiv, biorxiv, medrxiv)"
          },
          "externalId": {
            "type": "string",
            "description": "Source-specific identifier for the eprint"
          }
        }
      },
      "description": "Fetch external PDF through proxy to avoid CORS issues. Returns PDF binary data. Only allows fetching from trusted academic sources."
    }
  },
  "$type": "com.atproto.lexicon.schema",
  "lexicon": 1,
  "revision": 1
}
```
