# Champs personnalisés

## Récupération de la liste des champs personnalisé

<mark style="color:blue;">`GET`</mark> `/customFields/list`

#### Path Parameters

| Name                                     | Type   | Description          |
| ---------------------------------------- | ------ | -------------------- |
| module<mark style="color:red;">\*</mark> | string | verifier ou splitter |

#### Headers

| Name                                            | Type            | Description |
| ----------------------------------------------- | --------------- | ----------- |
| Authorization<mark style="color:red;">\*</mark> | Bearer \<token> |             |

{% tabs %}
{% tab title="200: OK " %}

{% endtab %}
{% endtabs %}

<details>

<summary>Retour du webservice</summary>

```json
{
    "customFields": [
        {
            "enabled": true,
            "id": 3,
            "label": "Contrat",
            "label_short": "contrat",
            "metadata_key": "contrat",
            "module": "splitter",
            "settings": {},
            "status": "OK",
            "type": "text"
        },
        {
            "enabled": true,
            "id": 4,
            "label": "Date de naissance",
            "label_short": "date_naissance",
            "metadata_key": "date_naissance",
            "module": "splitter",
            "settings": {},
            "status": "OK",
            "type": "text"
        },
        {
            "enabled": true,
            "id": 5,
            "label": "Matricule",
            "label_short": "matricule",
            "metadata_key": "matricule",
            "module": "splitter",
            "settings": {},
            "status": "OK",
            "type": "text"
        },
        {
            "enabled": true,
            "id": 6,
            "label": "Commentaire",
            "label_short": "comment",
            "metadata_key": "",
            "module": "splitter",
            "settings": {},
            "status": "OK",
            "type": "textarea"
        },
        {
            "enabled": true,
            "id": 2,
            "label": "Prénom",
            "label_short": "prenom",
            "metadata_key": "",
            "module": "splitter",
            "settings": {},
            "status": "OK",
            "type": "text"
        },
        {
            "enabled": true,
            "id": 1,
            "label": "Nom d'usage",
            "label_short": "nomusage",
            "metadata_key": "",
            "module": "splitter",
            "settings": {},
            "status": "OK",
            "type": "text"
        },
        {
            "enabled": true,
            "id": 7,
            "label": "",
            "label_short": "",
            "metadata_key": "",
            "module": "",
            "settings": {},
            "status": "OK",
            "type": ""
        }
    ]
}
```

</details>

## Création d'un champ personnalisé

<mark style="color:green;">`POST`</mark> `/customFields/add`

#### Request Body

| Name                               | Type | Description                                                                              |
| ---------------------------------- | ---- | ---------------------------------------------------------------------------------------- |
| <mark style="color:red;">\*</mark> | json | {'type': '', 'label': '', 'module': 'verifier', 'label\_short': '', 'metadata\_key': ''} |

{% tabs %}
{% tab title="200: OK " %}

{% endtab %}
{% endtabs %}

## Mise à jour d'un champ personnalisé

<mark style="color:blue;">`GET`</mark> `/customFields/update`

#### Request Body

| Name                               | Type | Description                                                                                               |
| ---------------------------------- | ---- | --------------------------------------------------------------------------------------------------------- |
| <mark style="color:red;">\*</mark> | json | {'id': '', 'label': '', 'label\_short': '', 'type': '', 'module': '', 'enabled': '', 'metadata\_key': ''} |

{% tabs %}
{% tab title="200: OK " %}

{% endtab %}
{% endtabs %}

## Suppression d'un champ personnalisé

<mark style="color:red;">`DELETE`</mark> `/customFields/delete/<int:custom_field_id>`

#### Path Parameters

| Name                                                | Type    | Description                       |
| --------------------------------------------------- | ------- | --------------------------------- |
| custom\_field\_id<mark style="color:red;">\*</mark> | integer | Identifiant du champ personnalisé |

{% tabs %}
{% tab title="200: OK " %}

{% endtab %}
{% endtabs %}
