cURL command samples
To use cURL commands to execute the Smart Reporting API, familiarize yourself with the sample cURL commands provided in this article.
On this page:
Download Test Summary Report in PDF format
With Perfecto's Smart Reporting API, you can download the test execution summary in PDF format.
Method | API |
---|---|
GET |
https://<reporting-server>/export/api/v1/test-executions/pdf?jobName [0]=<JobName>&jobNumber [0]=<JobNumber> |
The GET request must include the following header:
Header parameter name | Parameter value |
---|---|
PERFECTO_AUTHORIZATION |
<Your personal security token> |
To run the cURL command:
-
Construct the API URL:
https://<reporting-server>/export/api/v1/test-executions/pdf?jobName[0]=<JobName>&jobNumber[0]=<JobNumber>
Parameter
reporting-server
Reporting server url.
Example: https://demo.reporting.perfectomobile.com
Job Name
CI Dashboard Job Name
Job Number
CI Dashboard Job Number
-
Open a terminal/command prompt.
-
Run following cURL command. This command generates the result.pdf file in the current directory.
CopycURL Commandcurl -g -X GET \
'Reporting API created in step 1' \
-H 'PERFECTO_AUTHORIZATION: <Security token>' \
-H 'cache-control: no-cache' -o result.pdf
Get details about test cases based on driver ID
With Perfecto's Smart Reporting API, you can get test case details based on filter.
Method | API |
---|---|
GET |
https://<reporting-server>/export/api/v1/test-executions?filters filters example - jobName[0], jobNumber[0] For more details - Smart Reporting Public API |
The GET request must include the following header:
Header parameter name | Parameter value |
---|---|
PERFECTO_AUTHORIZATION |
<Your personal security token> |
To run the cURL command:
-
Construct the API URL:
https://<reporting-server>/export/api/v1/test-executions?<filter1>[0]=<value>[&<filter2>[0]=<value>]
-
Open a terminal/command prompt.
-
Run following cURL command. This command writes the JSON result to the output.txt file in the current directory.
CopycURL Command
curl -g -X GET \
'Reporting API created in step 1' \
-H 'PERFECTO_AUTHORIZATION: <Security token>' \
-H 'cache-control: no-cache' > output.txt
Generate an equivalent cURL command from PostMan
In the native app version of postman, you can generate code snippets for API requests, as follows:
-
In PostMan, click the Code option. You will be asked to select a programming language.
-
From the options provided, select cURL.
- Copy the generated cURL code snippet and paste it into the command prompt.