> For the complete documentation index, see [llms.txt](https://coefficy.gitbook.io/coefficy-api/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://coefficy.gitbook.io/coefficy-api/reference/api-reference/routines-scoring.md).

# Routines/Scoring

Une version plus récente de cette documentation est présente ici : https\://docs.coefficy.com/reference/

## Récupère les données lié au scoring et aux identifications sur les routines

<mark style="color:blue;">`GET`</mark> `https://api.campaign.coefficy.com/v1/supply/identification`

Paramètre idSupply, idCompany, siren, pollingScoring ou pollingTag nécessaire

#### Query Parameters

| Name            | Type        | Description                                                            |
| --------------- | ----------- | ---------------------------------------------------------------------- |
| idSupply        | int         |                                                                        |
| minScoringMatch | int         |                                                                        |
| idCompany       | int\|int\[] |                                                                        |
| siren           | String      |                                                                        |
| pollingScoring  | int         | Scoring modifié durant les x dernières minutes (minimum 15)            |
| pollingTag      | int         | Tag sur la routine modifié durant les x dernières minutes (minimum 15) |

#### Headers

| Name                                             | Type   | Description |
| ------------------------------------------------ | ------ | ----------- |
| x-access-token<mark style="color:red;">\*</mark> | String |             |

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

```json
{
    "success": true,
    "parameters": {
        ...
    },
    "supplyIdentificationList": [
        {
            "idSupply": int,
            "idCompany": int,
            "idIdentificationType": int,
            "date": datetime,
            "isManual": bool,
            "isFormerCustomer": bool,
            "identificationType": {
                "idIdentificationType": int,
                "title": string
            },
            "scoring": {
                "idScoring": int,
                "date": datetime,
                "match": int,
                "idCompany": int,
                "idSupply": int
            }|null
        }
    ]
```

{% endtab %}

{% tab title="400: Bad Request " %}

{% endtab %}
{% endtabs %}

## Créer/Modifier un tag pour une société sur une routine

<mark style="color:green;">`POST`</mark> `https://api.campaign.coefficy.com/v1/supply/identification`

Pour identifier la société: idCompany ou siren

Pour les paramètres idIdentificationType et isFormerCustomer, si le paramètre est vide ou non renseigné le champ ne sera pas écrasé en cas de modification.

#### Headers

| Name           | Type   | Description |
| -------------- | ------ | ----------- |
| x-access-token | String |             |

#### Request Body

| Name                                       | Type       | Description |
| ------------------------------------------ | ---------- | ----------- |
| idSupply<mark style="color:red;">\*</mark> | int        |             |
| idCompany                                  | int        |             |
| siren                                      | String     |             |
| idIdentificationType                       | int\|null  |             |
| isFormerCustomer                           | bool\|null |             |

{% tabs %}
{% tab title="400: Bad Request " %}

{% endtab %}

{% tab title="404: Not Found " %}

{% endtab %}

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

```json
{
    "success": true,
    "parameters": {
        ...
    },
    "supplyIdentification": <SupplyIdentification>
}
```

{% endtab %}
{% endtabs %}

## Récupère la liste des type d'identifications disponibles

<mark style="color:blue;">`GET`</mark> `https://api.campaign.coefficy.com/v1/supply/identificationType`

#### Headers

| Name                                             | Type   | Description |
| ------------------------------------------------ | ------ | ----------- |
| x-access-token<mark style="color:red;">\*</mark> | String |             |

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

```json
{
    "success": true,
    "parameters":{
        ...
    },
    "identificationTypeList":[
        {
            "idIdentificationType": int,
            "title":string
        }
    ]
}
```

{% endtab %}
{% endtabs %}
