Load Testing API
Ddosify Load Testing API
You can automate the process of load testing your web applications or APIs, and easily incorporate load testing into your CI/CD pipeline.
Our API provides a wide range of features, including the ability to create load test plans, run load tests, and retrieve detailed reports and metrics on test results. You can also create environment variables and test data (CSV) using this API. The API is designed to be easy to use, with a RESTful architecture and JSON-based responses.
In this section, you will find the APIs for test and plan endpoints. It's recommended to start the load test with a test plan using this endpoint. You can create test plans easily with no-code UI using Ddosify Cloud. You can select the Save as Test Plan in the summary page of the test suite. Once you create the test plan you can get the test plan id from the URL: https://app.ddosify.com/load/configure-test-plans/<TEST_PLAN_ID>
Create a Load Test with Plan (POST) <- Recommended
You can also find different examples of this API.
All endpoints require the X-API-KEY header for authentication. Please check the Get Your API Key section to learn how you can get it.
Load Test
Create a Load Test
POST https://api.ddosify.com/v1/load/test/
Headers
X-API-KEY*
UUID
Your API KEY
Request Body
name*
String
Name of the test
Create a Load Test with Plan (Recommended)
POST https://api.ddosify.com/v1/load/test/
Headers
X-API-KEY*
UUID
Your API KEY
Request Body
Get Load Tests
GET https://api.ddosify.com/v1/load/test/
Headers
X-API-KEY*
UUID
Your API KEY
Retrieve details of the Load Test
GET https://api.ddosify.com/v1/load/test/<TEST_ID>/
Headers
X-API-KEY*
UUID
Your API KEY
Result of Load Test
GET https://api.ddosify.com/v1/load/test/<TEST_ID>/result/
This endpoint waits until the test is finished. More.
Headers
X-API-KEY*
UUID
Your API KEY
Stop the Load Test
GET https://api.ddosify.com/v1/load/test/<TEST_ID>/stop/
Headers
X-API-KEY*
UUID
Your API KEY
Get Supported Load Locations
GET https://api.ddosify.com/v1/load/locations/
Headers
X-API-KEY*
UUID
Your API KEY
Config Data
Config data contains the configuration of the load test to start a load test and create load test plan endpoints. Here is an example:
This load-testing configuration includes two steps, each of which represents a specific action to be executed by the load-testing tool.
The first step represents a POST request to the "https://servdown.com" URL with a payload of {"id": 24}. The headers of the request include Test-Header with a value of Test Value and Test-Header2 with a value of Test Value2. The timeout for this step is set to 15 seconds.
The second step represents a GET request to the "https://app.servdown.com" URL. The timeout for this step is also set to 15 seconds.
The proxy_config field indicates that the load testing tool will use a mix of US (United States) and DE (Germany) servers, with a 50/50 distribution. You can get the full list of the supported locations by using this endpoint.
The iteration_count field indicates that the load testing tool will execute each step 1000 times. There will be a total of 1000*2=2000 requests.
The load_type field specifies a linear load pattern, which means that the load will be the same over time.
The duration field indicates that the load testing will last for 20 seconds.
Load Test Plan
Create a Load Test Plan
POST https://api.ddosify.com/v1/load/plan/
Headers
X-API-KEY*
UUID
Your API KEY
Request Body
name*
String
Test plan name. It's unique.
Get Load Test Plans
GET https://api.ddosify.com/v1/load/plan/
Headers
X-API-KEY*
UUID
Your API KEY
Retrieve details of the Load Test Plan
GET https://api.ddosify.com/v1/load/plan/<PLAN_ID>/
Headers
X-API-KEY*
UUID
Your API KEY
Update the Load Test Plan
PATCH https://api.ddosify.com/v1/load/plan/<PLAN_ID>/
Headers
X-API-KEY*
UUID
Your API KEY
Request Body
name
String
Test plan name
Delete the Load Test Plan
DELETE https://api.ddosify.com/v1/load/plan/<PLAN_ID>/
Headers
X-API-KEY*
UUID
Your API KEY
Environment
Create Environment
POST https://api.ddosify.com/v1/environment/
Headers
X-API-KEY*
UUID
Your API KEY
Request Body
name*
String
Environment name. It's unique.
Get Environments
GET https://api.ddosify.com/v1/environment/
Headers
X-API-KEY*
UUID
Your API KEY
Retrieve details of the Environment
GET https://api.ddosify.com/v1/environment/<ENVIRONMENT_ID>/
Headers
X-API-KEY*
UUID
Your API KEY
Update the Environment
PATCH https://api.ddosify.com/v1/environment/<ENVIRONMENT_ID>/
Headers
X-API-KEY*
UUID
Your API KEY
Request Body
name
String
Environment name. It's unique.
Delete the Environment
DELETE https://api.ddosify.com/v1/environment/<ENVIRONMENT_ID>/
Headers
X-API-KEY*
UUID
Your API KEY
vars
vars represents the environment variables for Create Environment endpoint.
Each key-value pair consists of a key and a value. The key represents the name of the environment variable to be set, and the value represents the value to be assigned to that variable.
The types of values can be bool, number, string and array. Here is an example of vars:
In this specific example, there are five environment variables:
test_key_boolwith a type of bool and value offalsetest_key_stringwith a type of string and value oftest_value_2test_key_number_intwith a type of number and value of15test_key_number_floatwith a type of number and value of15.2test_key_arraywith a type ofarrayand value of[14, 12, 15]
Test Data (CSV)
Create Test Data
POST https://api.ddosify.com/v1/testdata/
Headers
X-API-KEY*
UUID
Your API KEY
Request Body
name*
String
Test Data name. It's unique.
file*
File
CSV File
type
String
Default is csv.
Get Test Data
GET https://api.ddosify.com/v1/testdata/
Headers
X-API-KEY*
UUID
Your API KEY
Retrieve details of the Test Data
GET https://api.ddosify.com/v1/testdata/<TEST_DATA_ID>/
Headers
X-API-KEY*
UUID
Your API KEY
Delete the Test Data
DELETE https://api.ddosify.com/v1/testdata/<TEST_DATA_ID>/
Headers
X-API-KEY*
UUID
Your API KEY
file_config
Here is an example of file_config for Create Test Data endpoint:
This configuration defines the settings for parsing a CSV file. Here's a breakdown of each of the options specified:
delimiter: The delimiter is used to separate fields in the CSV file. In this case, the delimiter is;vars: A mapping of column numbers to variable names. Each key represents the column number (starting from 0), and the value is an object that specifies the variable name (tag). For example, the column at index 0 (the first column) will be mapped to the variableyear, the column at index 1 will be mapped to the variablecity, and so on.allow_quota: A boolean value that specifies whether or not the CSV file allows the use of quotes to enclose fields. In this case, it is set to true, indicating that quotes are allowed.order: Specifies the order in which the rows in the CSV file should be parsed. In this case, it is set torandom, indicating that the rows should be parsed in random order. Options:random,sequentialskip_first_line: A boolean value that specifies whether or not the first line of the CSV file should be skipped during parsing. In this case, it is set to true, indicating that the first line should be skipped.skip_empty_line: A boolean value that specifies whether or not empty lines should be skipped during parsing. In this case, it is set to true, indicating that empty lines should be skipped.
Last updated
Was this helpful?
