> For the complete documentation index, see [llms.txt](https://docs.exoclick.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.exoclick.com/api/fr/api-publique-exoclick/api-manual-postman-examples.md).

# Exemples Postman

## Vue d'ensemble

Ce guide fournit des instructions étape par étape pour s'authentifier et créer des campagnes via l'API ExoClick à l'aide de Postman. Tous les exemples précisent le type de requête requis, les en-têtes et le format du corps pour chaque point de terminaison.

## Authentification (Connexion)

Vous pouvez vous authentifier à l'aide des identifiants de votre compte ou d'un jeton API permanent. Les deux renvoient un jeton Bearer temporaire utilisé pour toutes les requêtes ultérieures.

{% tabs %}
{% tab title="Connexion avec nom d'utilisateur et mot de passe" %}
**Type de requête :** `POST`\
**URL :** `https://api.exoclick.com/v2/login`

**En-têtes :**

```
Content-Type: application/json
```

**Corps (JSON brut) :**

```json
{
  "username": "YOUR_USERNAME",
  "password": "YOUR_PASSWORD"
}
```

{% endtab %}

{% tab title="Connexion avec jeton API" %}
Utilisez cette option si vous avez généré un jeton dans votre tableau de bord ExoClick (Profil > Jetons API).

**Type de requête :** `POST`\
**URL :** `https://api.exoclick.com/v2/login`

**En-têtes :**

```
Content-Type: application/json
```

**Corps (JSON brut) :**

```json
{
  "api_token": "YOUR_API_TOKEN"
}
```

{% endtab %}
{% endtabs %}

## Processus de création d'une campagne bannière 300x250

Suivez ces étapes dans l'ordre exact. Notez la transition de JSON vers Form-Data aux dernières étapes.

{% stepper %}
{% step %}

### Créer l'URL de la page de destination (Bibliothèque)

Enregistre votre URL de destination. Les bannières standard nécessitent un `id_library_url`.

**Type de requête :** `POST`\
**URL :** `https://api.exoclick.com/v2/library/url`

**En-têtes :**

```
Authorization: Bearer YOUR_TOKEN
Content-Type: application/json
```

**Corps (JSON brut) :**

```json
{
  "url": "https://your-landing-page.com"
}
```

**Résultat :** Enregistrez la `"id"` (par ex., `6512406`).
{% endstep %}

{% step %}

### Télécharger l'image (Bibliothèque)

Enregistre votre création. L'image doit être exactement au format 300x250.

**Type de requête :** `POST`\
**URL :** `https://api.exoclick.com/v2/library/file`

**En-têtes :**

```
Authorization: Bearer YOUR_TOKEN
```

**Corps (form-data) :**

| Clé    | Type    | Valeur                                     |
| ------ | ------- | ------------------------------------------ |
| `file` | Fichier | Sélectionnez votre fichier image (300x250) |
| `type` | Texte   | `image`                                    |

**Résultat :** Enregistrez la `"id"` (par ex., `6884966`).
{% endstep %}

{% step %}

### Créer la structure de la campagne

Définit le ciblage, le budget et le `img_banner` modèle.

**Type de requête :** `POST`\
**URL :** `https://api.exoclick.com/v2/campaigns`

**En-têtes :**

```
Authorization: Bearer YOUR_TOKEN
Content-Type: application/json
```

**Corps (JSON brut) :**

```json
{
  "name": "Bannière 300x250 Production",
  "status": 0,
  "advertiser_ad_type": 0,
  "media_storage_template": "img_banner",
  "size": "300x250",
  "categories": {
    "type": "targeted",
    "elements": [97, 98, 99]
  },
  "countries": {
    "type": "targeted",
    "elements": [
      {
        "country": "USA",
        "regions": [0]
      }
    ]
  },
  "pricing": {
    "model": 4,
    "price": 300
  },
  "start_date": "2026-03-02",
  "daily_limit_type": 1,
  "max_daily_budget": 2000,
  "budget_delivery_mode": 1,
  "run_on_responsive_zones": 1
}
```

**Résultat :** Enregistrez la `"id"` (par ex., `8140060`).
{% endstep %}

{% step %}

### Ajouter la variation

Associe l'URL (étape 1) et l'image (étape 2) à la campagne (étape 3).

**Type de requête :** `POST`\
**URL :** `https://api.exoclick.com/v2/campaigns/8140060/variation`\
\&#xNAN;*(Remplacez `8140060` par votre ID réel de campagne à partir de l'étape 3)*

**En-têtes :**

```
Authorization: Bearer YOUR_TOKEN
```

**Corps (form-data) :**

| Clé               | Type  | Valeur                         |
| ----------------- | ----- | ------------------------------ |
| `id_library_url`  | Texte | `6512406` *(depuis l'étape 1)* |
| `id_library_file` | Texte | `6884966` *(depuis l'étape 2)* |
| `actif`           | Texte | `1`                            |

Tous les ID renvoyés à chaque étape doivent être enregistrés et utilisés dans les requêtes suivantes. N'oubliez pas de remplacer `YOUR_TOKEN`les chemins de fichiers et les ID par vos valeurs réelles.
{% endstep %}
{% endstepper %}


---

# 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 dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.exoclick.com/api/fr/api-publique-exoclick/api-manual-postman-examples.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
