PFLB Platform API

Download OpenAPI specification:Download

Welcome to the PFLB Platform API Reference!

Our REST API gives you programmatic access to PFLB Platform tests and SLAs.

  1. Create a test.
  2. Configure SLA.
  3. Generate an API token. You can find the API token in your profile.
  4. Send requests, for example, using cURL.

Files

Upload a file to the storage

Uploads a file to the platform storage. For example, you can upload CSV parameters files or supporting files for JMX tests

header Parameters
api-token
required
string

API access token

Request Body schema: multipart/form-data
files
Array of strings <binary>

List of the files

Responses

Request samples

curl --request POST \
--url https://platform.pflb.us/public-api/v1/file \
--header 'Content-Type: multipart/form-data' \
--header 'api-token: API access token' \
--form 'files=@/home/csv/params.csv'

Response samples

Content type
application/json
[
  • {
    }
]

Settings sets

Update parameters in the settings set

Updates test parameters in the settings set. You can update literal parameters and CSV parameters

header Parameters
api-token
required
string

API access token

Request Body schema: application/json
settingsId
required
integer <int64>

Unique identifier for the settings set

Array of objects (UpdateFileDto)

CSV parameters

Array of objects (VariableSettingSet)

Literal parameters

Responses

Request samples

Content type
application/json
{
  • "settingsId": 2,
  • "updateFileList": [
    ],
  • "variableList": []
}

Response samples

Content type
application/json
{
  • "exceptionMessage": "UNSUPPORTED_SETTING_MODEL_VERSION",
  • "description": "Unsupported test settings model version"
}

Tests

List tests

Gets a list of tests for the team

query Parameters
required
object (Pageable)

Paging and sorting settings

header Parameters
api-token
required
string

API access token

Responses

Request samples

curl --request GET \
--url 'https://platform.pflb.us/public-api/v1/test?page=0&size=2&sort=name%2Cdesc' \
--header 'api-token: API access token'

Response samples

Content type
application/json
{
  • "exceptionMessage": "INVALID_TOKEN",
  • "description": "Invalid jwt token"
}

Create a JMX test

Creates a test based on the JMeter script

query Parameters
testName
required
string

The name of the new test

comment
string

The test version comment

header Parameters
api-token
required
string

API access token

Request Body schema: multipart/form-data
jmx
string <binary>

JMeter script file

file
Array of strings <binary>

List of the supporting files

Responses

Request samples

curl --request POST \
--url 'https://platform.pflb.us/public-api/v1/test/jmx?testName=JMX-test&comment=Add%20timer' \
--header 'Content-Type: multipart/form-data' \
--header 'api-token: API access token' \
--form 'jmx=@/home/csv/csv.jmx' \
--form 'file=@/home/csv/params.csv'

Response samples

Content type
application/json
{
  • "id": 2,
  • "name": "JMX test",
  • "lastModified": "2019-08-24T14:15:22Z",
  • "labelSet": [
    ]
}

Test runs

Run a test

Creates a test run and submits it for starting

header Parameters
api-token
required
string

API access token

Request Body schema: application/json
testId
required
integer <int64>

Unique identifier for the test

testVersionId
integer <int64>

Unique identifier for the test’s version. If the parameter isn’t specified, a the latest test’s version will run

comment
string

Comment for the test run

testMode
string
Default: "TEST"
Enum: "TEST" "DEBUG_TEST"

Test run mode

inheritLabelsFromTest
boolean
Default: true

If true then copy labels from the test to the new test run. True by default

Responses

Request samples

Content type
application/json
{
  • "testId": 3,
  • "testVersionId": 47,
  • "comment": "string",
  • "testMode": "TEST",
  • "inheritLabelsFromTest": true
}

Response samples

Content type
application/json
{
  • "id": 339,
  • "testId": 3,
  • "testVersionId": 11,
  • "testMode": "TEST",
  • "state": "CREATED",
  • "displayState": "FINISHED",
  • "userId": 2,
  • "teamId": 2,
  • "createDate": "2019-08-24T14:15:22Z",
  • "startDate": "2019-08-24T14:15:22Z",
  • "endDate": "2019-08-24T14:15:22Z",
  • "comment": "string",
  • "labelSet": [
    ]
}

Get SLA

Gets SLA result for the test run

query Parameters
testRunId
required
integer <int64>
Example: testRunId=357

Unique identifier for the test run

header Parameters
api-token
required
string

API access token

Responses

Request samples

curl --location --request GET 'https://platform.pflb.us/public-api/v1/testRun/sla?testRunId=304' \
--header 'api-token: API access token'

Response samples

Content type
*/*
{
  "testRunId": 357,
  "testResultSlaState": "FINISHED",
  "slaResults": {
    "slaGroupList": [
      {
        "type": "GENERAL_TEST_SLA",
        "targetType": "TEST",
        "slaList": [
          {
            "restrictionType": "AVERAGE",
            "fromDate": 0,
            "toDate": 90,
            "operation": "LESS_EQUALS",
            "value": 2,
            "result": 0.19,
            "status": "SUCCESS"
          }
        ]
      }
    ],
    "status": "SUCCESS"
  }
}

Test versions

Create test version

Creates test version and updates parameters

header Parameters
api-token
required
string

API access token

Request Body schema: application/json
id
required
integer <int64>

Unique identifier for the test

versionId
integer <int64>

Unique identifier for the test’s version. If the parameter isn’t specified, a the latest test’s version will use

Array of objects (UpdateFileDto)
Array of objects (VariableTest)
comment
string

Comment for the test version

Responses

Request samples

Content type
application/json
{
  • "id": 3,
  • "versionId": 47,
  • "updateFileList": [
    ],
  • "variableList": [],
  • "comment": "string"
}

Response samples

Content type
*/*
{
  "id": 8,
  "testId": 3,
  "settingsId": 2,
  "createdOn": "2024-05-07T12:12:58.582Z",
  "comment": "string",
  "contentModelVersion": "1.0.0",
  "testType": "STABLE",
  "requestCount": 3,
  "totalDuration": 300,
  "versionNumber": 2
}