PRODUCT
Follow

Overview

Running a report actually creates a new entity behind the scenes called execution. This entity represents the report generation process and gathers information about report such as execution time, execution status, type of report (ad hoc or scheduled), URL to the report file (if it exists), and the error message (if any occurred). Each report can have zero or more executions.

The Report Builder provides access to the last execution of the report and a URL to the report file. If the report is not ready or failed to complete, the execution status reflects this condition and the URL will be unavailable. It is possible to poll the report execution several times until the Report Builder finishes generating the report and returns the URL. Clicking the report file URL downloads the report.

Polling Execution Request

An HTTP GET request returns the last execution of a specific report. reportID is returned as part of the response to an HTTP POST run report request. Use reportID in the URL to poll the report execution status running the report.

Important:
  • A polling execution request must be made by the same user who generated the report.
  • After an HTTP POST run report request, verify that you are not logging in as another user and trying to get last execution of the same report. If so, the API generates an error.
  • Another option would be to perform the pulling by using the "Report History Search" service that is described in the documintation, however pulling with "executions/last" service is more practical for single report.
  • In order to prevent load on the server RB allowing to perform up to 10 pulling requests in a second.
  • An authorization token in the header of the request is required. For more information about obtaining an authorization token, see OVERVIEW: Authentication.
Request Format

GET https://mdx.sizmek.com/rest/ReportBuilder/reports/REPORT ID/executions/last

Polling Execution Response

Legal requests yield a synchronous response in following format:


{
 "metadata": null,
 "debug": null,
 "error": "",
 "result": {
     "executionID": …,
     "reportName": "…",
     "executionStatus": "…",
     "executionType": "…",
     "files": [
              {
               "url": "…",
               "size": …,
               "modificationTime": …
               }     
               ]
      }
}

The result field represents an execution entity. The execution entity includes the following fields:

Parameters
Field Description  Possible Values
reportName Report name as defined in the HTTP POST run report request.  
executionStatus Representing status of report execution. PENDING, EXECUTING, FAILED, FINISHED
executionType Report execution type. AD HOC, SCHEDULED
files List of files for this specific execution.  
url Link to the report file, which expires after 24 hours. If the link is expired, re-run the GET request to get a new link to the report file.  
size File size in bytes.  
modificationTime sizeCreation/modification time represented in milliseconds.  

Possible Response Examples

Report Execution has not Finished


{
  "metadata": null,
  "debug": null,
  "error": null,
  "result": {
    "executionID": 29313,
    "reportName": "ADHOC_EMAIL",
    "executionStatus": "EXECUTING",
    "executionType": "AD_HOC",
    "files": null
  }
}

 

Ready Execution with File Link


{
  "metadata": null,
  "debug": null,
  "error": null,
  "result": {
    "executionID": 29316,
    "reportName": "ADHOC_EMAIL",
    "executionStatus": "FINISHED",
    "executionType": "AD_HOC",
    "files": [
      {
        "url": "URL_TOKEN,
        "size": SIZE,
        "modificationTime": TIME
      }
    ]
  }
}

     

Report Exists but does not Include Executions


{
  "metadata": null,
  "debug": null,
  "error": "This report has no executions. Report name [ADHOC_EMAIL]",
  "result": "Error occurred when tried to retrieve execution details for a report [b38fc107-69c6-4be9-99e7-3ffba9924ba9]."
}

     

Report Does not Exist


{
  "metadata": null,
  "debug": null,
  "error": "Couldn't retrieve execution status. Report or its execution info doesn't exist!",
  "result": "Error occurred when tried to retrieve execution details for a report [c7c6d349-0fea-450c-8452-c0d587d9976a]."
}

 

User is not Owner of Requested Report


{
  "metadata": null,
  "debug": null,
  "error": "You should be an owner of this report to see its execution status!",
  "result": "Error occurred when tried to retrieve execution details for a report [b38fc107-69c6-4be9-99e7-3ffba9924ba9]."
}

 

Was this article helpful?
0 out of 1 found this helpful
Have more questions? Submit a request

Comments

Powered by Zendesk