# DocumentLinks

> Attaches a stored document (DocumentRegistrations) to a row: linked_table names the kind of row by its old table code, and the key columns hold that row's key.

Subject: Documents.

Attaches a stored document (DocumentRegistrations) to a row: linked_table names the kind of row by its old table code, and the key columns hold that row's key. There is no real link to the row. Expanding DocumentLinks on an entity also returns links of other kinds with the same key: filter on linked_table here instead.

Label in Fledge: Koppelingstabel documenten.

| | |
| --- | --- |
| URL | `https://odata-api.fledge.nl/v2-8/DocumentLinks` |
| Key | `administration_id`, `character_id_1`, `character_id_2`, `document_registration_id`, `integer_id_1`, `integer_id_2`, `integer_id_3`, `linked_table` |
| Administration-specific | yes: always filter on `administration_id` |
| Operations | GET list, GET one, POST, PATCH, DELETE |
| Read licenses | BASIS, URENPC |
| Write licenses | BASIS |
| Scopes | FLEDGE_PORTAL, FLEDGE_TERMINAL |

## Example requests

```http
GET https://odata-api.fledge.nl/v2-8/DocumentLinks?$filter=administration_id eq 1&$select=character_id_1,character_id_2,document_registration_id,integer_id_1,integer_id_2,integer_id_3,linked_table,type,date_changed,date_created&$top=50
GET https://odata-api.fledge.nl/v2-8/DocumentLinks(administration_id=1,character_id_1='{character_id_1}',character_id_2='{character_id_2}',document_registration_id={document_registration_id},integer_id_1={integer_id_1},integer_id_2={integer_id_2},integer_id_3={integer_id_3},linked_table='{linked_table}')
```

## Fields

| Field | Type | Description |
| --- | --- | --- |
| `administration_id` (key) | Int32, not null | Administratienummer |
| `document_registration_id` (key) | Int32, not null | Nummer |
| `character_id_1` (key) | String, not null | Character nummer 1. The row's text key, such as the order or article number; depends on linked_table. |
| `character_id_2` (key) | String, not null | Nummer2: Character nummer 2. A second text key; usually empty. |
| `linked_table` (key) | String, not null | Gerelateerde tabel. The kind of row, as a four-letter table code: part article, prel relation, pdeb customer, pcrd supplier, vorh sales order, vobr sales order line, vohs historic sales order, vofh quotation, vofr quotation line, torh production order, tors assembly, torb operation, phhs historic production order, ikwh purchase order, ikwr purchase order line, iohs historic purchase order, iofh purchase quotation, ifch purchase invoice, ifbh invoice booking proposal, popc supplier open item, popd customer open item, mdwa employee, sobj service object, mcfg e-mail template (its standard attachments), clch parts list, tofh quote calculation. |
| `integer_id_1` (key) | Int32, not null | Nummer3: Integer nummer 1. The row's number key, such as the line, relation or customer number; depends on linked_table. |
| `integer_id_2` (key) | Int32, not null | Nummer4: Integer nummer 2. A second number key; usually 0. |
| `integer_id_3` (key) | Int32, not null | Nummer5: Integer nummer 3. A third number key; usually 0. |
| `changed_by_user_code` | String | Gebr.wijzig: Gebruikerscode van gebruiker wijziging |
| `changed_by_user_id` | Int32 | Gebruiker wijziging: Gebruiker laatste wijziging |
| `created_by_user_code` | String | Gebr.aanm.: Gebruikerscode van gebruiker aanmaak |
| `created_by_user_id` | Int32 | Gebruiker aanmaak |
| `date_changed` | Date | Datum wijziging |
| `date_created` | Date | Datum aanmaak |
| `description_1` | String | Omschrijving 1 |
| `description_2` | String | Omschrijving 2 |
| `description_3` | String | Omschrijving 3 |
| `is_printed_automatically` | Boolean | Automatisch printen (j/n) |
| `memo` | String | Memo |
| `type` | Int32 | Type. A number whose values aren't documented. |

## Relations

- `DocumentRegistration` → [DocumentRegistrations](https://docs.fledge.nl/en/api/reference/DocumentRegistrations.md) (one)

---

Source: https://docs.fledge.nl/en/api/reference/DocumentLinks
