> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.laposta.org/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.laposta.org/_mcp/server.

# Campagne content vullen

POST https://api.laposta.nl/v2/campaign/{campaign_id}/content
Content-Type: application/x-www-form-urlencoded

Vult de campagne met html, of laat Laposta de html ophalen van een URL. Geef er een van beide mee; stuur je allebei, dan wint de html.Gevonden problemen komen terug in `report`, bijvoorbeeld een ontbrekende afmeldlink of een afbeelding die niet geladen kan worden. Verzenden kan ook zonder die problemen op te lossen, maar het is verstandig ze eerst na te lopen.Filling in the content of a campaign The campaign can either be filled directly with html, or through a URL, in which case Laposta imports the html found at the specified URL. One of the two must be chosen. If both parameters are given the html is taken. If the import fails, a 400 error message from the API will occur. If it does succeed in importing the html, but problems were found during the import, they are shown in the variable report in the response. These may include: Solving these problems is not necessary in order to properly send the newsletter, but it is highly recommended. In the case of a free account, our advertising is added to the bottom of the newsletter. If the offered html does not contain an unsubscribe link, it will simply be added by our program.Füllt die Kampagne mit HTML, oder lässt Laposta das HTML von einer URL abholen. Gib eines von beiden mit; schickst du beides, gewinnt das HTML.Gefundene Probleme kommen in `report` zurück, zum Beispiel ein fehlender Abmeldelink oder ein Bild, das nicht geladen werden kann. Versenden ist auch möglich, ohne diese Probleme zu lösen, aber es ist sinnvoll, sie vorher durchzugehen.Rellena la campaña con html, o deja que Laposta obtenga el html de una URL. Envía una de las dos cosas; si envías ambas, gana el html.Los problemas encontrados se devuelven en `report`, por ejemplo un enlace de baja que falta o una imagen que no se puede cargar. También puedes enviar la campaña sin resolver esos problemas, pero conviene revisarlos primero.

Reference: https://docs.laposta.org/campagnes/campagne-content-vullen

## Authentication

- `Authorization` header (basic auth, required) — Vul je API-sleutel in bij `api_key` en laat `leave_empty` leeg. De API gebruikt basic auth, waarbij je sleutel de plaats van de gebruikersnaam inneemt. In curl schrijf je dat als `-u JOUW_SLEUTEL:`, met een dubbele punt en niets erachter.Enter your API key at `api_key` and leave `leave_empty` empty. The API uses basic auth, with your key in place of the username. In curl that reads `-u YOUR_KEY:`, with a colon and nothing after it.Trage deinen API-Schlüssel bei `api_key` ein und lass `leave_empty` leer. Die API nutzt Basic Auth, wobei dein Schlüssel an die Stelle des Benutzernamens tritt. In curl schreibst du das als `-u DEIN_SCHLUESSEL:`, mit einem Doppelpunkt und nichts dahinter.Introduce tu clave API en `api_key` y deja `leave_empty` vacío. La API usa basic auth, con tu clave en lugar del nombre de usuario. En curl se escribe como `-u TU_CLAVE:`, con dos puntos y nada después.

## Request

### Path parameters

- `campaign_id` (string, required) — Het id van de campagne. Dat vind je in het antwoord van [Alle campagnes opvragen](/campagnes/alle-campagnes-opvragen).The id of the campaign. You find it in the response of [Get all campaigns](/campagnes/alle-campagnes-opvragen).Die ID der Kampagne. Du findest sie in der Antwort von [Alle Kampagnen abrufen](/campagnes/alle-campagnes-opvragen).El id de la campaña. Lo encuentras en la respuesta de [Obtener todas las campañas](/campagnes/alle-campagnes-opvragen).

### Body (application/x-www-form-urlencoded)

This endpoint expects an object.

- `html` (string, optional) — De html voor de campagne.The html for the campaignDas HTML für die Kampagne.El html de la campaña.
- `import_url` (string, optional) — De url vanwaar de html geïmporteerd moet worden.The URL from which the html must be importedDie URL, von der das HTML importiert werden soll.La url desde la que se debe importar el html.
- `inline_css` (boolean, optional) — Eventueel inlinen van css (true of false)Potential inlining of css (true or false)CSS eventuell inline setzen (true oder false)Aplicar el css en línea si se desea (true o false)
- `javascript` (string, optional) — Er is javascript aangetroffen.JavaScript was encounteredEs wurde JavaScript gefunden.Se ha detectado javascript.
- `flash` (string, optional) — Er is flash aangetroffen.Flash was encounteredEs wurde Flash gefunden.Se ha detectado flash.
- `no_unsubscribe` (string, optional) — Er is geen afmeldlink gevonden.No unsubscribe could be locatedEs wurde kein Abmeldelink gefunden.No se ha encontrado ningún enlace de baja.
- `empty_unsubscribe` (string, optional) — Er is een lege afmeldlink gevonden.Empty unsubscribe encounteredEs wurde ein leerer Abmeldelink gefunden.Se ha encontrado un enlace de baja vacío.
- `css` (string, optional) — Er zijn ontbrekende externe css bestanden (worden opgesomd)Missing external css files (listed)Es fehlen externe CSS-Dateien (werden aufgelistet)Faltan archivos css externos (se enumeran)
- `images` (string, optional) — Er zijn ontbrekende externe afbeeldingen (worden opgesomd)Missing external images (listed)Es fehlen externe Bilder (werden aufgelistet)Faltan imágenes externas (se enumeran)

## Response

### 200

De aanvraag is gelukt.The request succeeded.Die Anfrage war erfolgreich.La solicitud se ha realizado correctamente.

- `campaign` (CampaignContentCampaign, optional)

## Errors

### 400 Bad Request Error

De aanvraag klopt niet. Het antwoord bevat een `type`, een `message` en meestal een `code` en de `parameter` die de fout veroorzaakte. Een object dat niet bestaat valt ook hieronder, met code 203.The request is not valid. The response contains a `type`, a `message` and usually a `code` plus the `parameter` that caused it. An object that does not exist also falls under this, with code 203.Die Anfrage stimmt nicht. Die Antwort enthält einen `type`, eine `message` und meistens einen `code` und den `parameter`, der den Fehler verursacht hat. Ein Objekt, das nicht existiert, fällt ebenfalls hierunter, mit Code 203.La solicitud no es correcta. La respuesta contiene un `type`, un `message` y normalmente un `code` y el `parameter` que ha causado el error. Un objeto que no existe también entra aquí, con el código 203.

- `error` (ErrorError, optional)

### 401 Unauthorized Error

Er is geen geldige API-sleutel meegestuurd, of dit endpoint staat niet aan voor dit account.No valid API key was provided, or this endpoint is not enabled for this account.Es wurde kein gültiger API-Schlüssel mitgeschickt, oder dieser Endpunkt ist für dieses Konto nicht aktiv.No se ha enviado una clave API válida, o este endpoint no está activado para esta cuenta.

- `error` (ErrorError, optional)

### 429 Too Many Requests Error

Je hebt te veel aanvragen in een minuut gedaan. De header `Retry-After` vertelt na hoeveel seconden het weer mag.Too many requests in one minute. The `Retry-After` header tells you how many seconds to wait.Du hast zu viele Anfragen in einer Minute gestellt. Der Header `Retry-After` sagt, nach wie vielen Sekunden es wieder erlaubt ist.Has hecho demasiadas solicitudes en un minuto. La cabecera `Retry-After` indica después de cuántos segundos puedes volver a intentarlo.

- `error` (ErrorError, optional)

## Types

### CampaignContentCampaign

- `account_id` (string, optional)
- `campaign_id` (string, optional)
- `html` (string, optional)
- `plaintext` (string, optional)
- `report` (CampaignContentCampaignReport, optional) — Alleen bij het vullen van content, en alleen als er iets op te merken viel.

### ErrorError

- `type` (enum, required)
  - Allowed values: `invalid_request`, `invalid_input`, `internal`
- `message` (string, required)
- `code` (integer, optional)
- `parameter` (string, optional)

### CampaignContentCampaignReport

Alleen bij het vullen van content, en alleen als er iets op te merken viel.

- `javascript` (boolean, optional)
- `flash` (boolean, optional)
- `no_unsubscribe` (boolean, optional)
- `empty_unsubscribe` (boolean, optional)
- `css` (list of string, optional)
- `images` (list of string, optional)

## Examples

**Request**

```json
{}
```

**Response**

```json
{
  "campaign": {
    "account_id": "string",
    "campaign_id": "string",
    "html": "string",
    "plaintext": "string",
    "report": {
      "javascript": true,
      "flash": true,
      "no_unsubscribe": true,
      "empty_unsubscribe": true,
      "css": [
        "string"
      ],
      "images": [
        "string"
      ]
    }
  }
}
```

**SDK Code**

```python
import requests

url = "https://api.laposta.nl/v2/campaign/njhgaf61ye/content"

payload = ""
headers = {
    "Content-Type": "application/x-www-form-urlencoded"
}

response = requests.post(url, data=payload, headers=headers, auth=("<api_key>", "<leave_empty>"))

print(response.json())
```

```javascript
const url = 'https://api.laposta.nl/v2/campaign/njhgaf61ye/content';
const credentials = btoa("<api_key>:<leave_empty>");

const options = {
  method: 'POST',
  headers: {
    Authorization: `Basic ${credentials}`,
    'Content-Type': 'application/x-www-form-urlencoded'
  },
  body: new URLSearchParams('')
};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go
package main

import (
	"fmt"
	"net/http"
	"io"
)

func main() {

	url := "https://api.laposta.nl/v2/campaign/njhgaf61ye/content"

	req, _ := http.NewRequest("POST", url, nil)

	req.SetBasicAuth("<api_key>", "<leave_empty>")
	req.Header.Add("Content-Type", "application/x-www-form-urlencoded")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby
require 'uri'
require 'net/http'

url = URI("https://api.laposta.nl/v2/campaign/njhgaf61ye/content")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request.basic_auth("<api_key>", "<leave_empty>")
request["Content-Type"] = 'application/x-www-form-urlencoded'

response = http.request(request)
puts response.read_body
```

```java
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://api.laposta.nl/v2/campaign/njhgaf61ye/content")
  .basicAuth("<api_key>", "<leave_empty>")
  .header("Content-Type", "application/x-www-form-urlencoded")
  .asString();
```

```php
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://api.laposta.nl/v2/campaign/njhgaf61ye/content', [
  'form_params' => null,
  'headers' => [
    'Content-Type' => 'application/x-www-form-urlencoded',
  ],
    'auth' => ['<api_key>', '<leave_empty>'],
]);

echo $response->getBody();
```

```csharp
using RestSharp;
using RestSharp.Authenticators;

var client = new RestClient("https://api.laposta.nl/v2/campaign/njhgaf61ye/content");
client.Authenticator = new HttpBasicAuthenticator("<api_key>", "<leave_empty>");
var request = new RestRequest(Method.POST);

request.AddHeader("Content-Type", "application/x-www-form-urlencoded");
IRestResponse response = client.Execute(request);
```

```swift
import Foundation

let credentials = Data("<api_key>:<leave_empty>".utf8).base64EncodedString()

let headers = [
  "Authorization": "Basic \(credentials)",
  "Content-Type": "application/x-www-form-urlencoded"
]

let request = NSMutableURLRequest(url: NSURL(string: "https://api.laposta.nl/v2/campaign/njhgaf61ye/content")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```