> 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/it/api-pubblica-di-exoclick/api-manual-postman-examples.md).

# Esempi Postman

## Panoramica

Questa guida fornisce istruzioni passo passo per autenticarsi e creare campagne tramite l'API ExoClick usando Postman. Tutti gli esempi specificano il tipo di richiesta, le intestazioni e il formato del corpo richiesti per ciascun endpoint.

## Autenticazione (Login)

Puoi autenticarti usando le credenziali del tuo account o un token API permanente. Entrambi restituiscono un token Bearer temporaneo utilizzato per tutte le richieste successive.

{% tabs %}
{% tab title="Accesso con nome utente e password" %}
**Tipo di richiesta:** `POST`\
**URL:** `https://api.exoclick.com/v2/login`

**Intestazioni:**

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

**Corpo (JSON grezzo):**

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

{% endtab %}

{% tab title="Accesso con token API" %}
Usa questa opzione se hai generato un token nella tua Dashboard ExoClick (Profilo > Token API).

**Tipo di richiesta:** `POST`\
**URL:** `https://api.exoclick.com/v2/login`

**Intestazioni:**

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

**Corpo (JSON grezzo):**

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

{% endtab %}
{% endtabs %}

## Flusso di creazione della campagna banner 300x250

Segui questi passaggi nell'ordine esatto. Nota la transizione da JSON a Form-Data negli ultimi passaggi.

{% stepper %}
{% step %}

### Crea URL della landing page (Libreria)

Registra il tuo URL di destinazione. I banner standard richiedono un `id_library_url`.

**Tipo di richiesta:** `POST`\
**URL:** `https://api.exoclick.com/v2/library/url`

**Intestazioni:**

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

**Corpo (JSON grezzo):**

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

**Risultato:** Salva il valore restituito `"id"` (ad es., `6512406`).
{% endstep %}

{% step %}

### Carica immagine (Libreria)

Registra il tuo asset creativo. L'immagine deve essere esattamente 300x250.

**Tipo di richiesta:** `POST`\
**URL:** `https://api.exoclick.com/v2/library/file`

**Intestazioni:**

```
Autorizzazione: Bearer YOUR_TOKEN
```

**Corpo (form-data):**

| Chiave | Tipo  | Valore                                   |
| ------ | ----- | ---------------------------------------- |
| `file` | File  | Seleziona il tuo file immagine (300x250) |
| `type` | Testo | `image`                                  |

**Risultato:** Salva il valore restituito `"id"` (ad es., `6884966`).
{% endstep %}

{% step %}

### Crea struttura della campagna

Imposta targeting, budget e `img_banner` modello.

**Tipo di richiesta:** `POST`\
**URL:** `https://api.exoclick.com/v2/campaigns`

**Intestazioni:**

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

**Corpo (JSON grezzo):**

```json
{
  "name": "Banner 300x250 Produzione",
  "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
}
```

**Risultato:** Salva il valore restituito `"id"` (ad es., `8140060`).
{% endstep %}

{% step %}

### Aggiungi la variazione

Collega l'URL (Passaggio 1) e l'immagine (Passaggio 2) alla campagna (Passaggio 3).

**Tipo di richiesta:** `POST`\
**URL:** `https://api.exoclick.com/v2/campaigns/8140060/variation`\
\&#xNAN;*(Sostituisci `8140060` con il tuo ID campagna effettivo del Passaggio 3)*

**Intestazioni:**

```
Autorizzazione: Bearer YOUR_TOKEN
```

**Corpo (form-data):**

| Chiave            | Tipo  | Valore                        |
| ----------------- | ----- | ----------------------------- |
| `id_library_url`  | Testo | `6512406` *(dal Passaggio 1)* |
| `id_library_file` | Testo | `6884966` *(dal Passaggio 2)* |
| `attivo`          | Testo | `1`                           |

Tutti gli ID restituiti in ciascun passaggio devono essere salvati e usati nelle richieste successive. Ricorda di sostituire `YOUR_TOKEN`, i percorsi dei file e gli ID con i tuoi valori effettivi.
{% 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/it/api-pubblica-di-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.
