Aller au contenu
NessFlow
Menu
    Sommaire de la documentation

    Exports

    Le rapport PDF et le classeur Excel d’un crawl, générés en tâche de fond.

    Demander l’export d’un crawl

    POST /v1/crawls/{crawl}/exports

    Met en file le rapport PDF ou le classeur Excel d’un crawl terminé et répond 202 avec l’export à sonder (Location). L’Excel exige une offre qui l’inclut (plan_limit.exports.excel). Un export identique encore en cours est rendu au lieu d’en lancer un second.

    Scopes requis
    exports:write
    Coût en débit
    10 unité(s)
    Idempotency-Key
    Idempotency-Key acceptée

    Paramètres

    • crawl path · string (uuid) · requis

    Corps de la requête

    • format string · requis

      Valeurs (pdf, xlsx)

    Réponses

    • 202 OK.
    • 400 Malformed request, such as an invalid pagination cursor (`pagination.invalid_cursor`).
    • 401 Missing, invalid or expired token, or a member who left the team.
    • 403 The plan does not include the API (`api.not_in_plan`) or this verb (`api.write_not_in_plan`), or the token lacks a scope (`token.missing_scope`).
    • 404 No such resource for the token's team. Resources of another team answer 404 as well, never 403.
    • 409 The request conflicts with the current state (a crawl already running, an idempotency key in use, a project not ready).
    • 422 Invalid query or body values (`validation_failed`), with `errors` by field.
    • 429 The plan rate limit is exhausted for one window.

    cURL

    curl -X POST "https://api.nessflow.com/v1/crawls/0190f5a2-7c4e-7b1a-9d3e-2f6b8c1a4e57/exports" \
      -H "Authorization: Bearer $NESSFLOW_TOKEN" \
      -H "Content-Type: application/json" \
      -H "Idempotency-Key: $(uuidgen)" \
      -d '{"format":"pdf"}'

    PHP

    $client = new GuzzleHttp\Client(['base_uri' => 'https://api.nessflow.com/v1/']);
    
    $response = $client->request('POST', 'crawls/0190f5a2-7c4e-7b1a-9d3e-2f6b8c1a4e57/exports', [
        'headers' => [
            'Authorization' => 'Bearer '.getenv('NESSFLOW_TOKEN'),
            'Idempotency-Key' => bin2hex(random_bytes(16)),
        ],
        'json' => [
            'format' => 'pdf',
        ],
    ]);
    
    $data = json_decode((string) $response->getBody(), true);

    JavaScript

    const response = await fetch('https://api.nessflow.com/v1/crawls/0190f5a2-7c4e-7b1a-9d3e-2f6b8c1a4e57/exports', {
      method: 'POST',
      headers: {
        Authorization: `Bearer ${process.env.NESSFLOW_TOKEN}`,
        'Content-Type': 'application/json',
        'Idempotency-Key': crypto.randomUUID(),
      },
      body: JSON.stringify({
          "format": "pdf"
      }),
    });
    
    const data = await response.json();

    Python

    import os
    import uuid
    
    import requests
    
    response = requests.post(
        "https://api.nessflow.com/v1/crawls/0190f5a2-7c4e-7b1a-9d3e-2f6b8c1a4e57/exports",
        headers={
            "Authorization": f"Bearer {os.environ['NESSFLOW_TOKEN']}",
            "Idempotency-Key": str(uuid.uuid4()),
        },
        json={
            "format": "pdf",
        },
        timeout=30,
    )
    response.raise_for_status()
    data = response.json()

    Exemple de réponse

    {
        "data": {
            "id": "0190f5a2-7c4e-7b1a-9d3e-2f6b8c1a4e57",
            "crawl_id": "0190f5a2-7c4e-7b1a-9d3e-2f6b8c1a4e57",
            "format": "pdf",
            "status": "queued",
            "size_bytes": 42,
            "download_url": "https://exemple.fr/",
            "created_at": "2026-10-01T09:30:00Z",
            "finished_at": "2026-10-01T09:30:00Z",
            "expires_at": "2026-10-01T09:30:00Z"
        }
    }

    Lire un export

    GET /v1/exports/{export}

    L’état d’un export. Quand status vaut ready, download_url est renseigné jusqu’à expires_at.

    Scopes requis
    crawls:read
    Coût en débit
    1 unité(s)

    Paramètres

    • export path · string (uuid) · requis

    Réponses

    • 200 OK.
    • 401 Missing, invalid or expired token, or a member who left the team.
    • 403 The plan does not include the API (`api.not_in_plan`) or this verb (`api.write_not_in_plan`), or the token lacks a scope (`token.missing_scope`).
    • 404 No such resource for the token's team. Resources of another team answer 404 as well, never 403.
    • 429 The plan rate limit is exhausted for one window.

    cURL

    curl "https://api.nessflow.com/v1/exports/0190f5a2-7c4e-7b1a-9d3e-2f6b8c1a4e57" \
      -H "Authorization: Bearer $NESSFLOW_TOKEN"

    PHP

    $client = new GuzzleHttp\Client(['base_uri' => 'https://api.nessflow.com/v1/']);
    
    $response = $client->request('GET', 'exports/0190f5a2-7c4e-7b1a-9d3e-2f6b8c1a4e57', [
        'headers' => [
            'Authorization' => 'Bearer '.getenv('NESSFLOW_TOKEN'),
        ],
    ]);
    
    $data = json_decode((string) $response->getBody(), true);

    JavaScript

    const response = await fetch('https://api.nessflow.com/v1/exports/0190f5a2-7c4e-7b1a-9d3e-2f6b8c1a4e57', {
      headers: {
        Authorization: `Bearer ${process.env.NESSFLOW_TOKEN}`,
      },
    });
    
    const data = await response.json();

    Python

    import os
    
    import requests
    
    response = requests.get(
        "https://api.nessflow.com/v1/exports/0190f5a2-7c4e-7b1a-9d3e-2f6b8c1a4e57",
        headers={
            "Authorization": f"Bearer {os.environ['NESSFLOW_TOKEN']}",
        },
        timeout=30,
    )
    response.raise_for_status()
    data = response.json()

    Exemple de réponse

    {
        "data": {
            "id": "0190f5a2-7c4e-7b1a-9d3e-2f6b8c1a4e57",
            "crawl_id": "0190f5a2-7c4e-7b1a-9d3e-2f6b8c1a4e57",
            "format": "pdf",
            "status": "queued",
            "size_bytes": 42,
            "download_url": "https://exemple.fr/",
            "created_at": "2026-10-01T09:30:00Z",
            "finished_at": "2026-10-01T09:30:00Z",
            "expires_at": "2026-10-01T09:30:00Z"
        }
    }

    Télécharger un export

    GET /v1/exports/{export}/download

    Le fichier, en pièce jointe. 409 export.not_ready pendant la génération, 410 export.expired une fois supprimé.

    Scopes requis
    crawls:read
    Coût en débit
    1 unité(s)

    Paramètres

    • export path · string (uuid) · requis

    Réponses

    • 200 OK.
    • 401 Missing, invalid or expired token, or a member who left the team.
    • 403 The plan does not include the API (`api.not_in_plan`) or this verb (`api.write_not_in_plan`), or the token lacks a scope (`token.missing_scope`).
    • 404 No such resource for the token's team. Resources of another team answer 404 as well, never 403.
    • 409 The request conflicts with the current state (a crawl already running, an idempotency key in use, a project not ready).
    • 410 The resource existed and has been removed (`export.expired`).
    • 429 The plan rate limit is exhausted for one window.

    cURL

    curl "https://api.nessflow.com/v1/exports/0190f5a2-7c4e-7b1a-9d3e-2f6b8c1a4e57/download" \
      -H "Authorization: Bearer $NESSFLOW_TOKEN"

    PHP

    $client = new GuzzleHttp\Client(['base_uri' => 'https://api.nessflow.com/v1/']);
    
    $response = $client->request('GET', 'exports/0190f5a2-7c4e-7b1a-9d3e-2f6b8c1a4e57/download', [
        'headers' => [
            'Authorization' => 'Bearer '.getenv('NESSFLOW_TOKEN'),
        ],
    ]);

    JavaScript

    const response = await fetch('https://api.nessflow.com/v1/exports/0190f5a2-7c4e-7b1a-9d3e-2f6b8c1a4e57/download', {
      headers: {
        Authorization: `Bearer ${process.env.NESSFLOW_TOKEN}`,
      },
    });

    Python

    import os
    
    import requests
    
    response = requests.get(
        "https://api.nessflow.com/v1/exports/0190f5a2-7c4e-7b1a-9d3e-2f6b8c1a4e57/download",
        headers={
            "Authorization": f"Bearer {os.environ['NESSFLOW_TOKEN']}",
        },
        timeout=30,
    )
    response.raise_for_status()

    Exemple de réponse

    Aucun corps de réponse.

    Référence de l’API Codes d’erreur Documentation de l’API

    Cette page en Markdown