> 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/de/exoclick-public-api/api-manual-curl-examples.md).

# cURL-Beispiele

## Überblick

Dieser Leitfaden bietet sofort einsatzbereite cURL-Befehle für die Authentifizierung und das Erstellen von Kampagnen über die ExoClick API. Alle Beispiele verwenden je nach Endpunktanforderungen die Standardformate JSON oder Form-Data.

## Authentifizierung (Login)

Sie können sich mit Ihren Kontodaten oder einem permanenten API-Token authentifizieren. Beide geben ein temporäres Bearer-Token zurück, das für alle nachfolgenden Anfragen verwendet wird.

{% tabs %}
{% tab title="Anmeldung mit Benutzername & Passwort" %}

```bash
curl -X POST "https://api.exoclick.com/v2/login" \
     -H "Content-Type: application/json" \
     -d '{
       "username": "YOUR_USERNAME",
       "password": "YOUR_PASSWORD"
     }'
```

{% endtab %}

{% tab title="Anmeldung mit API-Token" %}
Verwenden Sie dies, wenn Sie in Ihrem ExoClick-Dashboard ein Token generiert haben ([Profil](https://docs.exoclick.com/docs/general/my-profile/) > API-Token).

```bash
curl -X POST "https://api.exoclick.com/v2/login" \
     -H "Content-Type: application/json" \
     -d '{
       "api_token": "YOUR_API_TOKEN"
     }'
```

{% endtab %}
{% endtabs %}

## Erstellungsablauf für 300x250 Banner-Kampagnen

Befolgen Sie diese Schritte genau in dieser Reihenfolge. Beachten Sie den Übergang von JSON zu Form-Data in den letzten Schritten.

{% stepper %}
{% step %}

### Landingpage-URL erstellen (Bibliothek)

Registriert Ihre Ziel-URL.

**Format:** JSON

```bash
curl -X POST "https://api.exoclick.com/v2/library/url" \
     -H "Authorization: Bearer YOUR_TOKEN" \
     -H "Content-Type: application/json" \
     -d '{
       "url": "https://your-landing-page.com"
     }'
```

**Ergebnis:** Speichern Sie die zurückgegebene `"id"` (z. B., `6512406`).
{% endstep %}

{% step %}

### Bild hochladen (Bibliothek)

Registriert Ihr Creative-Asset. Das Bild muss genau 300x250 sein.

**Format:** Form-Data

```bash
curl -X POST "https://api.exoclick.com/v2/library/file" \
     -H "Authorization: Bearer YOUR_TOKEN" \
     -F "file=@/path/to/your/image_300x250.jpg" \
     -F "type=image"
```

**Ergebnis:** Speichern Sie die zurückgegebene `"id"` (z. B., `6884966`).
{% endstep %}

{% step %}

### Kampagnen-Rahmen erstellen

Legt Targeting, Budget und die `img_banner` Vorlage fest.

**Format:** JSON

```bash
curl -X POST "https://api.exoclick.com/v2/campaigns" \
     -H "Authorization: Bearer YOUR_TOKEN" \
     -H "Content-Type: application/json" \
     -d '{
  "name": "Banner 300x250",
  "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
}'
```

**Ergebnis:** Speichern Sie die zurückgegebene `"id"` (z. B., `8140060`).
{% endstep %}

{% step %}

### Die Variation hinzufügen

Verknüpft die URL (Schritt 1) und das Bild (Schritt 2) mit der Kampagne (Schritt 3).

**Format:** Form-Data

```bash
curl -X POST "https://api.exoclick.com/v2/campaigns/8140060/variation" \
     -H "Authorization: Bearer YOUR_TOKEN" \
     -F "id_library_url=6512406" \
     -F "id_library_file=6884966" \
     -F "active=1"
```

{% endstep %}
{% endstepper %}

Alle IDs, die in jedem Schritt zurückgegeben werden, müssen gespeichert und in nachfolgenden Anfragen verwendet werden. Denken Sie daran, `YOUR_TOKEN`, Dateipfade und IDs durch Ihre tatsächlichen Werte zu ersetzen.


---

# 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/de/exoclick-public-api/api-manual-curl-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.
