# net.nusno.gyoka.document.getDocument

> Fetch the stored document body and URL for a Gyoka document type.

- Kind: query
- Authority: document.gyoka.nusno.net
- Lexicon: 1
- Published by [nusno.net](https://lexicon.garden/identity/did:plc:gjkxkrudpqumaiiytxodmpaj), the NSID's authority

## Links

- [Documentation](https://lexicon.garden/lexicon/did:plc:gjkxkrudpqumaiiytxodmpaj/net.nusno.gyoka.document.getDocument)
- [Schema JSON](https://lexicon.garden/lexicon/did:plc:gjkxkrudpqumaiiytxodmpaj/net.nusno.gyoka.document.getDocument/schema.json)
- [Analytics](https://lexicon.garden/lexicon/did:plc:gjkxkrudpqumaiiytxodmpaj/net.nusno.gyoka.document.getDocument/analytics)

## Query (`net.nusno.gyoka.document.getDocument`)

Type: query · GET

### Parameters (query string)

- `docType` (string, required): Document type to fetch.
  - Constraints: knownValues: tos | privacy_policy

### Output (application/json)

- `content` (string, required)
  - Constraints: maxLength: 32768, nullable
- `docType` (string, required)
  - Constraints: knownValues: tos | privacy_policy
- `url` (string · uri, required)
  - Constraints: maxLength: 2048, nullable

### Errors

- `AuthenticationRequired`: Returned when service authentication is required and the caller is not authenticated.
- `Forbidden`: Returned when the authenticated caller is not in the admin allowlist.
- `BadRequest`: Returned when the query parameters are invalid.
- `NotFound`: Returned when the requested document has not been stored.
- `InternalServerError`: Returned when the document cannot be loaded.

## Schema

```json
{
  "$type": "com.atproto.lexicon.schema",
  "defs": {
    "main": {
      "description": "Fetch the stored document body and URL for a Gyoka document type.",
      "errors": [
        {
          "description": "Returned when service authentication is required and the caller is not authenticated.",
          "name": "AuthenticationRequired"
        },
        {
          "description": "Returned when the authenticated caller is not in the admin allowlist.",
          "name": "Forbidden"
        },
        {
          "description": "Returned when the query parameters are invalid.",
          "name": "BadRequest"
        },
        {
          "description": "Returned when the requested document has not been stored.",
          "name": "NotFound"
        },
        {
          "description": "Returned when the document cannot be loaded.",
          "name": "InternalServerError"
        }
      ],
      "output": {
        "encoding": "application/json",
        "schema": {
          "nullable": [
            "url",
            "content"
          ],
          "properties": {
            "content": {
              "maxLength": 32768,
              "type": "string"
            },
            "docType": {
              "knownValues": [
                "tos",
                "privacy_policy"
              ],
              "type": "string"
            },
            "url": {
              "format": "uri",
              "maxLength": 2048,
              "type": "string"
            }
          },
          "required": [
            "docType",
            "url",
            "content"
          ],
          "type": "object"
        }
      },
      "parameters": {
        "properties": {
          "docType": {
            "description": "Document type to fetch.",
            "knownValues": [
              "tos",
              "privacy_policy"
            ],
            "type": "string"
          }
        },
        "required": [
          "docType"
        ],
        "type": "params"
      },
      "type": "query"
    }
  },
  "id": "net.nusno.gyoka.document.getDocument",
  "lexicon": 1
}
```
