> For the complete documentation index, see [llms.txt](https://doc.commandersact.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://doc.commandersact.com/fr/fonctionnalites/sources/sources-catalog/import-crm-users/api-users.md).

# Utilisateurs API

## Visiteur

<mark style="color:bleu;">`GET`</mark> `https://api.commander1.com/v1.0/engage/visitors/`

Ce point de terminaison vous permet de **récupérer les propriétés d’un visiteur spécifique**. Lors de la création du token, vous pouvez définir les propriétés à renvoyer.

Cette API est plutôt conçue pour être appelée depuis un tag dans le navigateur de chaque utilisateur.

#### Paramètres de requête

| Nom      | Type    | Description                                                                                |
| -------- | ------- | ------------------------------------------------------------------------------------------ |
| callback | string  | (facultatif) Callback pour une requête JSONP                                               |
| token    | string  | Jeton de sécurité                                                                          |
| site     | integer | ID du site                                                                                 |
| tcid     | string  | ID du cookie. S’il est vide (recommandé), le tcid sera lu dans le cookie de l’utilisateur. |

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

```
{
    "user_age": 39,
    "user_privacy_categories": [
      "11",
      "12",
      "13"
    ]
}
```

{% endtab %}
{% endtabs %}

### Utilisation First-party

Si votre site utilise un domaine First-party (via un sous-domaine dédié ou le chemin Commanders Act Gateway), les appels API doivent être effectués sur votre propre domaine.

Important : l’URL doit inclure /api/ dans le chemin.\
Sans ce chemin, la requête ne fonctionnera pas.

#### 1. Utilisation d’un sous-domaine dédié (exemple : tracking.mydomain.com)

La structure de l’API First-party doit suivre ce modèle :\
<https://tracking.mydomain.com/**api**/1.0/engage/visitors/>

Exemple :\
<https://tracking.mydomain.com/api/v1.0/engage/visitors/?site=5326\\&tcid=\\&token=XXXX>

#### 2. Utilisation de Commanders Act Gateway (configuration basée sur un chemin)

Si votre point de terminaison de gateway est servi sous un chemin (par exemple : <https://www.mydomain.com/cact-proxy/),\\>
la structure de l’API First-party doit suivre ce modèle :\
<https://www.mydomain.com/cact-proxy/**api**/1.0/engage/visitors/>

Exemple :\
<https://www.mydomain.com/cact-proxy/**api**/v1.0/engage/visitors/?site=5326\\&tcid=\\&token=XXXX>

Remarque : conservez toujours la structure **/api/**/… après le sous-domaine ou le chemin de la gateway.

## Utilisateur

<mark style="color:bleu;">`GET`</mark> `https://api.commander1.com/engage/user/`

Ce point de terminaison vous permet de **récupérer les propriétés d’un utilisateur spécifique** à partir d’un `user_id`. Lors de la création du token, vous pouvez définir les propriétés à renvoyer.

#### Paramètres de requête

| Nom      | Type    | Description         |
| -------- | ------- | ------------------- |
| token    | string  | Jeton de sécurité   |
| user\_id | string  | ID de l’utilisateur |
| site     | integer | ID du site          |

{% tabs %}
{% tab title="200 Consentement récupéré avec succès." %}

```javascript
{
    "user_age": 39,
    "user_privacy_categories": [
      "11",
      "12",
      "13"
    ]
}
```

{% endtab %}

{% tab title="404 Aucun utilisateur correspondant à cette requête n’a été trouvé." %}

```javascript
{
    "message": "Person not found"
}
```

{% endtab %}
{% endtabs %}

### N’utilisez pas ce point de terminaison côté client

Le point de terminaison GET User ne doit **pas** être appelé depuis le navigateur.\
L’exposition du token permettrait à quiconque de le récupérer et de parcourir les ID utilisateur pour extraire toutes les données des utilisateurs.

Utilisez cette API **uniquement côté serveur** dans un environnement backend sécurisé.

## Utilisateur

<mark style="color:orange;">`PUT`</mark> `https://api.commander1.com/engage/user/`

Insérer ou mettre à jour un utilisateur

#### Paramètres de requête

| Nom      | Type   | Description          |
| -------- | ------ | -------------------- |
| site     | string | ID du site (compte)  |
| user\_id | string | ID de l’utilisateur. |
| token    | string | Jeton de sécurité    |

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

```
{"success":true}
```

{% endtab %}
{% endtabs %}

#### Exemple de requête <a href="#example-request" id="example-request"></a>

`PUT`

<https://api.commander1.com/engage/user/?site=1234\\&user\\_id=1234\\&token=WvNIX8955cnZ7WF0f632s0Wb99Ql3rtA>

```
//Format example
{
    "person": {
        "id": "10000000",
        "card": "12345678910",
        "email": "mycustomer@test.com",
        "gender": "female",
        "firstname": "Joan",
        "lastname": "Craig",
        "custom": {
            "area_number": 123
        },
    ...
    }
}
```

## DELETE user

Supprimer un utilisateur

#### URL de la ressource <a href="#resource-url" id="resource-url"></a>

<https://api.commander1.com/engage/user/>

#### Informations sur la ressource <a href="#resource-information" id="resource-information"></a>

| Formats de réponse         | JSON        |
| -------------------------- | ----------- |
| Authentification requise ? | Oui (token) |

#### Paramètres

| NOM                 | OBLIGATOIRE    | VALEURS D’EXEMPLE                | DESCRIPTION         |
| ------------------- | -------------- | -------------------------------- | ------------------- |
| site                | d+             | 1234                             | ID du site          |
| user\_id            | d+             | 1234                             | ID de l’utilisateur |
| tc\_id (facultatif) | d+             | 1234                             | ID du visiteur      |
| token               | \[a-zA-Z0-9]\* | WvNIX8955cnZ7WF0f632s0Wb99Ql3rtA | Jeton de sécurité   |

#### Exemple de requête <a href="#example-request" id="example-request"></a>

`DELETE`

<https://api.commander1.com/engage/user/?site=1234\\&user\\_id=1234\\&tc\\_id=1234\\&token=WvNIX8955cnZ7WF0f632s0Wb99Ql3rtA>

#### Réponse <a href="#example-request" id="example-request"></a>

```
{"success":true}
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://doc.commandersact.com/fr/fonctionnalites/sources/sources-catalog/import-crm-users/api-users.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
