Importing results through the API¶
Calliope.pro supports importing test results through our API, here you'll get a basic explanation of how to do that. For more detailed and technical documentation you can take a look at our Swagger API Documentation.
Formatter endpoints¶
Specific formatters (Recommended)¶
http://app.calliope.pro/api/v2/profile/{profile_id}/import/cucumber
http://app.calliope.pro/api/v2/profile/{profile_id}/import/junit
http://app.calliope.pro/api/v2/profile/{profile_id}/import/zaproxy
http://app.calliope.pro/api/v2/profile/{profile_id}/import/testng
http://app.calliope.pro/api/v2/profile/{profile_id}/import/xctest
- And more...
The /import/formatter
endpoint will try to import your file with that specific formatter.
File size limit: 50 MB
Auto detect formatter (Not recommended)¶
http://app.calliope.pro/api/v2/profile/{profile_id}/import
The /import
endpoint will try out all available formatters. If your files are recognised by multiple formatters, it will return a failed status.
This endpoint is not recommended because processing takes longer and unexpected failures may occur. It is mainly used for front end functionality.
File size limit: 30 MB
Formatter variables¶
Profile ID¶
All formatter API endpoints contain {profile_id}
, this should be replaced with the profile you wish to push your results to. You can find the profile ID in the URL when you're on the profile.
API Key¶
You can verify yourself by putting your API key in the header as x-api-key
. You can find and copy your API key on your account page.
Test result (body)¶
The test results can be given in multiple ways.
- form-data by using the
?file[]=
parameter to attach one of multiple files <-- Recommended - raw by putting the result file as a string directly into the body
- binary by attaching the result file to the body
Import options¶
Go to the import options page for all details about every option.
The following parameters can be added to the URL.
Example API URL containing these variables
http://app.calliope.pro/api/v2/profile/2/import/cucumber?os=test&platform=test2&build=123test&smart=false
Curl examples¶
An API request that sends a JSON or XML test result file using curl looks like this:
Single file¶
curl -X POST \
-H "Content-Type:multipart/form-data" \
-H "x-api-key:<API_KEY>" \
-F "file[]=@path/to/testresult" \
"https://app.calliope.pro/api/v2/profile/<profile_id>/import/?os=<YOUR_OS>&platform=<YOUR_PLATFORM>&build=<YOUR_BUILD>"
\
's are suppose to escape the new-line characters. This might not work in all systems, so in that case put everything on 1 line
Multi-file¶
curl -X POST \
-H "Content-Type:multipart/form-data" \
-H "x-api-key:<API_KEY>" \
-F "file[]=@path/to/testresult_01" \
-F "file[]=@path/to/testresult_02" \
-F "file[]=@path/to/testresult_03" \
"https://app.calliope.pro/api/v2/profile/<profile_id>/import?os=<YOUR_OS>&platform=<YOUR_PLATFORM>&build=<YOUR_BUILD>"
You can find and copy your specific API import curl command on your Calliope.pro project overview page that contains the profile.