Upload or Update Asset Files
API Explorer: /tests/{testId}/files
To upload a file asset to a test, POST the file to the testId
(you need to know the testId
of the created test). Use the following template for the file path and name:
curl -X POST -F 'file=@path to file/file.ext' ...
The sample code uploads a file (@/my/path/to/MyTest.jmx
) to a test with an ID of 1234567
. Replace @/my/path/to/MyText.jmx
with the actual path and file name and 1234567
with your testId
.
To update the contents of an uploaded file, repeat the same operation (upload the updated file using the same file name).
Upload or Update Asset Files
curl 'https://a.blazemeter.com/api/v4/tests/1234567/files' \
-X POST \
-F 'file=@/my/path/to/MyTest.jmx' \
--user 'api_key_id:api_key_secret'
Upload or Update Asset Files Response Attributes
For the all the supported attributes, see the The Test Object.
Response201 Created
{
"api_version": 4,
"error": null,
"result": {
"id": 1234567,
"isNewTest": true,
"name": "Typical Configuration Sample",
"userId": 123456,
"creatorClientId": "api",
"overrideExecutions": [
{
"executor": "jmeter",
"holdFor": "19m",
"rampUp": "1m",
"concurrency": 20,
"locations": {
"us-east-1": 20
},
"locationsPercents": {
"us-east-1": 100
},
"steps": 0
}
],
"executions": [
{
"concurrency": 20,
"holdFor": "19m",
"rampUp": "1m",
"steps": 0,
"locations": {
"us-east-1": 20
},
"locationsPercents": {
"us-east-1": 100
},
"executor": "jmeter",
"scenario": "default-scenario"
}
],
"shouldSendReportEmail": true,
"created": 1551635668,
"updated": true,
"configuration": {
"type": "taurus",
"executionType": "taurusCloud",
"filename": "MyTest.jmx",
"testMode": "script",
"scriptType": "jmeter"
}
}
}