# prescriptio_dce_download

URL de telechargement signee (valable 1 h) d'une piece de DCE, ou de l'archive complete du dossier. { marche_id } (UUID de marche OU annonce_id) telecharge le dossier entier ; ajouter { filename } cible une piece precise si elle est stockee isolement. Renvoie une erreur honnete si le dossier n'est pas heberge chez Prescriptio (jamais de lien mort ni de lien vers la plateforme externe).

État : implémenté ; distribution : connectors-1.0.0 ; offre payante : false ; effets : lecture.

## Entrée MCP

```json
{
  "properties": {
    "filename": {
      "description": "Nom exact d'une piece a telecharger (facultatif). Omis, ou piece non stockee isolement : l'archive complete du dossier est renvoyee.",
      "type": "string"
    },
    "marche_id": {
      "description": "Identifiant du dossier : UUID de marche OU annonce_id betterplace (ex \"2833189\").",
      "type": "string"
    }
  },
  "required": [
    "marche_id"
  ],
  "type": "object"
}
```

## Sortie MCP

```json
{
  "properties": {
    "action": {
      "const": "telechargement_dce"
    },
    "content_type": {
      "type": "string"
    },
    "count": {
      "type": "integer"
    },
    "doc_type": {
      "type": "string"
    },
    "download_url": {
      "description": "Lien temporaire ; ne pas journaliser ni indexer.",
      "type": "string"
    },
    "expires_in": {
      "type": "integer"
    },
    "fichiers": {
      "items": {
        "properties": {
          "filename": {
            "type": "string"
          },
          "pages_estimees": {
            "type": "integer"
          },
          "parties": {
            "type": "integer"
          }
        },
        "type": "object"
      },
      "type": "array"
    },
    "fields": {
      "type": "object"
    },
    "filename": {
      "type": "string"
    },
    "hint": {
      "type": "string"
    },
    "marche_id": {
      "type": "string"
    },
    "ok": {
      "const": true
    },
    "page": {
      "type": "integer"
    },
    "pages_total": {
      "type": "integer"
    },
    "query": {
      "type": "string"
    },
    "results": {
      "items": {
        "properties": {
          "acheteur": {
            "type": [
              "string",
              "null"
            ]
          },
          "doc_type": {
            "type": [
              "string",
              "null"
            ]
          },
          "extrait": {
            "type": "string"
          },
          "filename": {
            "type": "string"
          },
          "lieu": {
            "type": [
              "string",
              "null"
            ]
          },
          "marche_id": {
            "type": "string"
          },
          "titre": {
            "type": [
              "string",
              "null"
            ]
          }
        },
        "type": "object"
      },
      "type": "array"
    },
    "texte": {
      "type": "string"
    },
    "titre": {
      "type": [
        "string",
        "null"
      ]
    }
  },
  "required": [
    "ok",
    "action",
    "marche_id",
    "filename",
    "download_url",
    "content_type",
    "expires_in"
  ],
  "type": "object"
}
```

[Contrats externes et limites](/docs/reference/concepts.md).
