When to use this endpoint

Use after recording scenarios to share a test evidence register. It exports stored evidence and does not run tests, contact the provider or certify approval.

Authentication and permissions

Authenticate with signed API-key fields or a logged-in CRM session; session dispatch applies CSRF checks. The authenticated tenant must have features2.ukDigitalWasteManagement=1. The feature is read from the account record, not trusted from request input.

Requires client-administrator access. A page Edit permission or wildcard role alone does not replace the client-admin check.

Parameters

This endpoint has no operation-specific parameters.

Example request

$result = FM_api('DigitalWasteTracking_patExport', []);

Example response

{
    "ok": 1,
    "filename": "digital-waste-tracking-pat-evidence.csv",
    "base64": "U2NlbmFyaW8sIkpvYiByZWZlcmVuY2UiLCJSZWNvcmRlZCBhdCIsT3V0Y29tZSwiVHJhY2tpbmcgSUQiLCJFeHBlY3RlZCBjYXRlZ29yeSIsIlByb3ZpZGVyIGNhdGVnb3JpZXMiLCJQcm9maWxlIElEIixFbnZpcm9ubWVudCwiU3VibWl0dGVkIGRhdGEgaGFzaCIKUjAxLCwsLCwsLCwsClIwMiwsLCwsLCwsLApSMDMsLCwsLCwsLCwKUjA0LCwsLCwsLCwsClIwNSwsLCwsLCwsLApSMDcsLCwsLCwsLCwKQzAxLCwsLCwsLCwsCkMwMiwsLCwsLCwsLApCMDEsLCwsLCwsLCwKUDAxLCwsLCwsLCwsCkgwMSwsLCwsLCwsLApIMDIsLCwsLCwsLCwKSDAzLCwsLCwsLCwsClgwMSwsLCwsLCwsLAo="
}

The example contains the header and all 14 scenario rows with blank, unrecorded evidence.

Errors and unusual responses

ResponseCondition
{"error":"not logged in"}No authenticated tenant context is available. Invalid signed credentials can be rejected by the dispatcher before the handler runs.
{"error":"UK Digital Waste Tracking is not enabled for this account"}The account feature is disabled.
{"error":"client administrator access required"}The identity is not a client administrator.
{"error":"PAT evidence is not enabled for this account"}The service allowlist check is false/unavailable.

Legacy application errors may be returned with HTTP 200. Check the decoded response for error, not only the HTTP status.

Behaviour and edge cases

  • Requires both client administrator and the signed service’s PAT account allowlist (DWT_PAT_CLIENT_IDS); the tenant feature alone is insufficient. A PAT availability lookup is made on every call. These are synthetic provider-acceptance tests, not an automatic declaration of approval.
  • Always includes all 14 supported scenarios in fixed order, including blank unrecorded evidence. There are no table filters, pagination controls or rows count in this response.
  • CSV columns: Scenario, Job reference, Recorded at, Outcome, Tracking ID, Expected category, Provider categories, Profile ID, Environment, Submitted data hash. Provider categories join with |. Recorded at formats Unix seconds using DATE_ATOM and the PHP/server timezone; it is not the UTC table string from patStatus.
  • Returns ok, filename and base64; decode the latter rather than treating the endpoint as a public CSV URL. Evidence content is whatever was retained at recording time and is not revalidated against a changed Job/profile.
  • Values use ordinary fputcsv serialization, with formula-like spreadsheet cells apostrophe-prefixed. Test Job references remain caller-authored content.

Side effects

  • Builds a temporary in-memory CSV only; the availability guard makes a signed PAT-enabled lookup. No provider receipt is submitted.

See it in Fieldmotion

CRM1

No direct CRM1 caller was found in the production JavaScript source. The operator workflow is implemented in CRM2.

CRM2

Provider testing > Export evidence calls DigitalWasteTracking_patExport and downloads the base64 content using its filename.

Related endpoints