cURL Command Samples
We can use cURL commands to execute the Smart Reporting API. Following are some sample curl commands:
Download Test Summary Report in PDF format |
cURL Command |
||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Perfecto's Smart Reporting API provides option to download test execution summary in PDF format.
We have to send following header along above request:
|
Step 1. Construct the URL url: https://<reporting-server>/export/api/v1/test-executions/pdf?jobName[0]=<JobName>&jobNumber[0]=<JobNumber>
Step 2. Open Terminal/Command prompt. Step 3. Run following curl command: Copy
cURL Command
The above command will generate result.pdf file in current directory. |
Get detail about test cases based on driver id |
cURL Command |
||||||||
---|---|---|---|---|---|---|---|---|---|
Perfecto's Smart Reporting API provides option to get test case details based on filter(s):
We have to send following header along above request:
|
Step 1. Construct the API URL: https://<reporting-server>/export/api/v1/test-executions?<filter1>[0]=<value>[&<filter2>[0]=<value>] Step 2. Open Terminal/Command prompt. Step 3. Run following curl command: Copy
cURL Command
The above command will write JSON result in output.txt file in current directory. |
Generate equivalent cURL command from PostMan:
In Native app version of postman (I used v6.7.2), we have option to generate code snippets for API request.