Sorting

Control the sort of returned results using the sort[] parameter.

Use sort[] to set the attribute you want to sort the response with. The attributes to focus on are updated, created, or name. If you place just the attribute as is (i.e. name), it will sort from least to greatest, or alphabetical order. If you want the opposite behavior, you can add a - before the attribute (i.e. -name). For example, to sort by updated from newest to oldest, set sort[]=-updated

The sample code sets the sorting for items with a projectId of 123456 by most recently updated to oldest update.

To set sorting, an existing attribute in the result attribute of the response is required. You can also set pagination with a sort to focus in a specific workspace and/or project.

Setting Pagination through Tests

curl 'https://a.blazemeter.com/api/v4/tests?projectId=123456&sort[]=-updated' \
      -H 'Content-Type: application/json' \
      --user 'api_key_id:api_key_secret'

Response200 OK

{
    "limit": 10,
    "skip": 0,
    "total": 2,
    "hidden": 0,
    "api_version": 4,
    "error": null,
    "result": [
        {
            "id": 6776178,
            "name": "Dynatrace APM Test - Copy",
            "isNewTest": true,
            "userId": 344260,
            "created": 1555365941,
            "updated": 1555365941,
            "creatorClientId": "gui",
            "overrideExecutions": [
                {
                    "concurrency": 20,
                    "executor": "jmeter",
                    "holdFor": "19m",
                    "locations": {
                        "us-east-1": 20
                    },
                    "locationsPercents": {
                        "us-east-1": 100
                    },
                    "rampUp": "1m",
                    "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-6776177"
                }
            ],
            "shouldSendReportEmail": false,
            "projectId": 169410,
            "configuration": {
                "type": "taurus",
                "canControlRampup": false,
                "targetThreads": 500,
                "executionType": "taurusCloud",
                "scriptType": "jmeter",
                "threads": 500,
                "filename": "Dummy.jmx",
                "testMode": "",
                "plugins": {
                    "jmeter": {
                        "version": "auto",
                        "consoleArgs": "",
                        "enginesArgs": ""
                    },
                    "thresholds": {
                        "thresholds": [],
                        "ignoreRampup": false,
                        "slidingWindow": false
                    }
                }
            }
        },
        {
            "id": 6728358,
            "name": "Taurus YAML Configuration Test",
            "isNewTest": true,
            "userId": 344260,
            "lastRunTime": 1553625706,
            "created": 1553625654,
            "updated": 1553627839,
            "creatorClientId": "gui",
            "overrideExecutions": [],
            "executions": [
                {
                    "concurrency": 5,
                    "holdFor": "180s",
                    "rampUp": "1s",
                    "locations": {
                        "us-east-1": 1
                    },
                    "locationsWeighted": true,
                    "executor": "jmeter",
                    "scenario": "simple"
                }
            ],
            "shouldSendReportEmail": false,
            "projectId": 169410,
            "lastUpdatedById": 344260,
            "configuration": {
                "type": "taurus",
                "dedicatedIpsEnabled": false,
                "executionType": "taurusCloud",
                "scriptType": "taurus",
                "threads": 500,
                "filename": "Dummy.yml",
                "testMode": "",
                "plugins": {
                    "jmeter": {
                        "version": "auto",
                        "consoleArgs": "",
                        "enginesArgs": ""
                    },
                    "thresholds": {
                        "thresholds": [],
                        "ignoreRampup": false,
                        "slidingWindow": false
                    }
                }
            }
        }
    ]
}