Upload or Update Asset Files

API Explorer: /tests/{testId}/files

To upload a file asset to a test, POST the file to the testId of the test.

A test script and a CSV data file are two examples of file assets.

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).

If you do not know the testId of the test to update, use List Tests to return a list of your created tests.

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": "API Created API Functional Test",
        "userId": 123456,
        "creatorClientId": "api",
        "overrideExecutions": [
            {
                "iterations": 1
            }
        ],
        "executions": [
            {
                "iterations": 1,
                "scenario": "default-scenario"
            }
        ],
        "shouldSendReportEmail": false,
        "dependencies": [],
        "created": 1577382114,
        "updated": 1577382115,
        "configuration": {
            "type": "functionalApi",
            "filename": "MyTest.jmx",
            "canControlRampup": false,
            "targetThreads": 0
        }
    },
    "request_id": "5e04f59830bd2"
}