DM Web Services Documentation

RunReports

Runs a batch of reports in a single call. Each entry is the same RunReportRequest used by RunReport; the response carries one result entry per requested report.

Normal outcomes return HTTP 200 with a top-level success flag plus a per-report success flag for each entry. An unexpected server error returns HTTP 500.

REST and SOAP: This function is available over both transports, sharing the same RunReportsRequest / RunReportResponse objects. The reports SOAP service is at /soap/public/v1/reports.

Function Overview

  • Purpose: Generate multiple reports in one request and return a file reference for each.
  • REST Endpoint: POST /api/public/v1/reports/runs
  • SOAP Operation: RunReports(RunReportsRequest)
  • Authentication: Required — Bearer token in HTTP Authorization header

REST Interface

Headers

Authorization: Bearer <token>
Content-Type: application/json

Request Body

A list of report requests plus an optional batch-level correlation id. Each item in reportRequests has the same shape as the single RunReport body.

{
  "reportRequests": [
    {
      "reportGuid": "3f2504e0-4f89-41d3-9a0c-0305e82c3301",
      "parameters": [
        { "name": "StartDate", "dataType": 4, "length": 0, "data": "2026-06-01" },
        { "name": "EndDate", "dataType": 4, "length": 0, "data": "2026-06-30" }
      ],
      "originalFileName": "JuneShipments",
      "useOriginalFileName": true,
      "correlationId": "req-2026-0629-001"
    },
    {
      "reportGuid": "7c9e6679-7425-40de-944b-e07fc1f90ae7",
      "parameters": [
        { "name": "BranchGuid", "dataType": 12, "length": 0, "data": "1b2c3d4e-5f60-7180-92a3-b4c5d6e7f809" }
      ],
      "useOriginalFileName": false,
      "correlationId": "req-2026-0629-002"
    }
  ],
  "correlationId": "batch-2026-0629-001"
}

Request Fields

FieldTypeRequiredDescription
reportRequestsarrayYesOne or more RunReport requests to run in the batch.
reportRequests[].reportGuidstring (GUID)YesIdentifier of the stored report definition to run.
reportRequests[].parametersarrayNoRuntime parameter values for that report (see Parameter object below).
reportRequests[].originalFileNamestringNoBase output file name when useOriginalFileName is true.
reportRequests[].useOriginalFileNamebooleanNoWhen true, names the output using originalFileName.
reportRequests[].correlationIdstringNoPer-report tracking id; echoed on that report's result entry.
correlationIdstringNoBatch-level tracking id; echoed on the top-level response.

Parameter object

FieldTypeDescription
namestringParameter name as defined by the report.
dataTypeintSQL data type code (see codes below).
lengthintDeclared length; use 0 when not applicable.
datastringParameter value as a string; converted per dataType.

dataType codes: 2 = Bit, 4 = DateTime, 6 = Float, 8 = Int, 9 = Money, 12 = NVarChar / GUID, 13 = Real, 15 = Decimal, 16 = SmallInt.

Parameter validation: Each report defines the parameters it accepts. Parameter names are matched to the report's declared parameters (a leading @ and letter case are ignored), and each supplied value is checked against the parameter's declared type (date, number, boolean, GUID, or text). A parameter the report does not declare, or a value that is not valid for its declared type, is rejected with a message in that report's errorText; that report is not generated, and the other reports in the batch are unaffected. Parameters the report does not require may be omitted. The dataType and length fields are optional — the server resolves each parameter's type from the report definition.

Response — Success (HTTP 200)

The response is a single RunReportResponse whose reports array holds one entry per requested report. A per-report failure sets that entry's errorText without failing the whole batch.

{
  "success": true,
  "errorText": null,
  "correlationId": "batch-2026-0629-001",
  "reports": [
    {
      "reportGuid": "3f2504e0-4f89-41d3-9a0c-0305e82c3301",
      "success": true,
      "errorText": null,
      "fileName": "JuneShipments.xlsx",
      "referencePath": "/reports/generated/2026/06/JuneShipments.xlsx",
      "copyPath": null,
      "correlationId": "req-2026-0629-001"
    },
    {
      "reportGuid": "7c9e6679-7425-40de-944b-e07fc1f90ae7",
      "success": false,
      "errorText": "Report definition not found for the supplied ReportGuid.",
      "fileName": null,
      "referencePath": null,
      "copyPath": null,
      "correlationId": "req-2026-0629-002"
    }
  ]
}

Response — Error (HTTP 200, top-level failure)

{
  "success": false,
  "errorText": "No report requests were supplied.",
  "correlationId": "batch-2026-0629-001",
  "reports": []
}

Response — Unexpected Error (HTTP 500)

{
  "status": "Error",
  "message": "An unexpected error occurred while running the reports."
}

Response Fields

FieldDescription
successStatus of the batch call itself (true when the request was processed).
errorTextTop-level error message; null when there is no top-level error.
correlationIdEcho of the batch-level correlationId.
reportsPer-report results; one entry per requested report.
reports[].reportGuidThe report definition that produced this entry.
reports[].successTrue when this report has no errorText.
reports[].errorTextPer-report error message, if any.
reports[].fileNameGenerated output file name.
reports[].referencePathPath to the generated report.
reports[].copyPathSecondary copy path, if the definition specifies one.
reports[].correlationIdPer-report correlation id.

SOAP Interface

WSDL

Live WSDL -- /soap/public/v1/reports?singlewsdl

The live WSDL is the authoritative schema. The envelopes below are illustrative; element names match the shared request and result objects.

Authentication note: Pass your Bearer token as an HTTP header, not inside the SOAP envelope.
Authorization: Bearer <token>

SOAP Operation

RunReports(RunReportsRequest) returns RunReportResponse — the same objects used by the REST endpoint.

SOAP Request

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
  <soapenv:Header/>
  <soapenv:Body>
    <RunReports xmlns="http://dmwebservices.com/reports/public/v1">
      <request>
        <ReportRequests>
          <RunReportRequest>
            <ReportGuid>3f2504e0-4f89-41d3-9a0c-0305e82c3301</ReportGuid>
            <Parameters>
              <ParameterObject>
                <Name>StartDate</Name>
                <DataType>4</DataType>
                <Length>0</Length>
                <Data>2026-06-01</Data>
              </ParameterObject>
            </Parameters>
            <OriginalFileName>JuneShipments</OriginalFileName>
            <UseOriginalFileName>true</UseOriginalFileName>
            <CorrelationId>req-2026-0629-001</CorrelationId>
          </RunReportRequest>
        </ReportRequests>
        <CorrelationId>batch-2026-0629-001</CorrelationId>
      </request>
    </RunReports>
  </soapenv:Body>
</soapenv:Envelope>

SOAP Response -- Success

<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">
  <s:Body>
    <RunReportsResponse xmlns="http://dmwebservices.com/reports/public/v1">
      <result>
        <Success>true</Success>
        <ErrorText i:nil="true" xmlns:i="http://www.w3.org/2001/XMLSchema-instance"/>
        <CorrelationId>batch-2026-0629-001</CorrelationId>
        <Reports>
          <ReportDetail>
            <ReportGuid>3f2504e0-4f89-41d3-9a0c-0305e82c3301</ReportGuid>
            <Success>true</Success>
            <FileName>JuneShipments.xlsx</FileName>
            <ReferencePath>/reports/generated/2026/06/JuneShipments.xlsx</ReferencePath>
            <CorrelationId>req-2026-0629-001</CorrelationId>
          </ReportDetail>
        </Reports>
      </result>
    </RunReportsResponse>
  </s:Body>
</s:Envelope>

Integration Samples


Related Resources