Skip to content

LegacyController

LegacyController retrieves the output document produced by a previously tracked convert/merge request, identified by its tracking id.

Field Value
Controller LegacyController
Base System.Web.Http.ApiController
Route prefix [RoutePrefix("v1/legacy")]
Source PdfAPI\Controllers\v1\LegacyController.cs
Controller-level authorization None in code
Error handling Per-action try/catch + ILogService.LogException; response then passes through ApiResponseHandler, whose final outer envelope is unknown** (details)
Endpoints 1

GET v1/legacy/download/{trackingId}

Looks up a tracking record by id and returns the associated output document only when the tracking status is Succeeded and an output file path is recorded; otherwise returns an explanatory failure result.

Field Value
HTTP verb GET
Resolved route v1/legacy/download/{trackingId}
Route composition [RoutePrefix("v1/legacy")] + [Route("download/{trackingId}")]
Action Download(long trackingId)
Return type IHttpActionResult (Ok(result))
Authorization None in code
Idempotent Yes — repeated calls with the same trackingId return the same result while the underlying tracking record is unchanged*
Operation OP-DOWNLOAD-BY-TRACKING-ID

Parameters

Name In Type Required Default Binding Purpose
trackingId Route long Yes — Route segment Identifies the tracking record to retrieve

Response

Field Value
DTO PdfAPI.Core.PdfResult
Media type application/json
Property Type Nullable Purpose
Status PdfStatus No Status of the tracked request
Message string Yes Explanatory failure message when the document is not downloadable
Document Document Yes The output document, present only when the tracked request succeeded

Status codes

Status Condition Body
200 OK Every outcome — success, "tracking record does not exist", "output file does not exist", and any non-Succeeded status — all return 200 with a PdfResult (BR-PDFAPI-013) PdfResult

Errors

Error status Trigger Produced by Body
404 Not Found {trackingId} does not parse as long — the route does not match* Framework (routing) Framework default routing-failure body

The Body column above describes only the pre-envelope detail produced by the framework's routing. Every response also passes through the globally registered ApiResponseHandler message handler (SAIF.Web.API package), which wraps or post-processes the HTTP response for the whole service. That handler's exact outer envelope shape is implemented inside the package and is not visible in this repository — see Endpoints: Error response shape.

Business rules

  • BR-PDFAPI-013 — a tracked document is downloadable only when its status is Succeeded and a non-null output file path is recorded; otherwise an explanatory failure result is returned with HTTP 200.

Authorization

No authorization attribute or programmatic check is present. See Authentication and authorization.

Side effects and idempotency

Aspect Finding
Records written None — this action only reads the PDFTracking record (see Data model)
Downstream calls None identified
Files or messages produced None — reads the previously produced output file from disk
Repeat-call behavior Same result on every call while the tracking record is unchanged

Example

GET v1/legacy/download/12345 HTTP/1.1
Host: <host>
HTTP/1.1 200 OK
Content-Type: application/json

{
  "Status": "Succeeded",
  "Document": { "FileName": "output.pdf" }
}

Note: Statements marked with * were inferred from code structure, naming conventions, or contextual evidence where direct confirmation was not available in source artifacts. Statements marked with ** could not be confirmed; treat as unknown until verified.

Sources

  • PdfAPI\Controllers\v1\LegacyController.cs
  • PdfAPI\Services\PdfTrackingService.cs
  • PdfAPI.Core\PdfResult.cs