Get Run Item PDF Report
The Get Run Item PDF Report endpoint returns a PDF report file, identified by the RunItemID.
The RunItemID can be fetched from the Response Body of the Get Run Items Id by Run Id endpoint.
Note: This endpoint allows retrieving PDF reports for completed flow executions that were originally configured to generate Standard or Detailed reports in Leapwork Studio.
Even if the schedule configuration changes later, as long as the report is still stored on the Leapwork Controller (according to the retention policy), it can be retrieved via this API.
Request URL
http://{controllerMachine}:{controllerPort}/api/v4/runItems/{runItemId}/report
Input parameters
| Field | Type | Description | Comment |
|---|---|---|---|
| runitemId | string | The runitemId is a unique Id for the individual run instance of a flow in a test run | runitemId can be fetched from the Response Body of the Get Run Items Id by Run Id endpoint |
| accessKey | string | An access key used for authentication. | Required in the request header as AccessKey: {your-token}. |
Examples
Curl
curl -X GET \
--header 'Accept: application/pdf' \
--header 'AccessKey: Mo87Nc4qDAtzJNDb' \
'http://{controllerMachine}:{controllerPort}/api/v4/runItems/0553c8fa-f0ac-4aab-8d10-fb0b46897ff0/report'
PowerShell
$headers = @{}
$headers.Add("AccessKey","Mo87Nc4qDAtzJNDb")
$headers.Add("Accept","application/pdf")
Invoke-WebRequest -Uri "http://{controllerMachine}:{controllerPort}/api/v4/runItems/0553c8fa-f0ac-4aab-8d10-fb0b46897ff0/report" `
-ContentType "application/pdf" `
-Headers $headers `
-Method GET `
-OutFile "runItemReport.pdf"
Response Body
A binary stream is returned which can be downloaded and saved as a PDF file, for example:
Run_<FlowName>_<Environment>_<Date>_<Time>.pdf
Response Code
- 200 (OK)
- 404 (Not Found)
- 401 (Unauthorized)
- 400 (Bad Request)
- 405 (Method Not Allowed)
- 500 (Internal Server Error)