Create Transaction

To create a Transaction, you need to know your Workspace identifier and the Service identifier. The sample code uses a serviceId of 123 and a workspaceId of 123456. Use the actual ID values of your Workspace and Service.

The response contains an identifier that you should note down. You will need this transactionID when you want to configure, deploy, or delete this Transaction later.

The easiest way to create a Transaction is through the web interface, from where you can also copy and paste a valid default dsl. For more details how to write a dsl, see dsl in the Appendix.

The following parameters are the base parameters required to create a Transaction.

Create a TransactionMinimum Configuration Sample


curl 'https://mock.blazemeter.com/api/v1/workspaces/26208/transactions?serviceId=1645' \
  -X POST \
  -H 'accept: */*' \
  -H 'Content-Type: application/json' \
  -d '{ "transactions": [ { "name": "Transaction from API", "description": "Transaction created by API", "tags": [ "my_tag" ], "dsl": { "priority": 0, "requestDsl": { "method": "POST", "url": { "key": "url", "matcherName": "equals_url", "matchingValue": "http://www.example.com" }, "headers": [ { "key": "header1", "matcherName": "contains", "matchingValue": "value1" } ], "queryParams": [ { "key": "q1", "matcherName": "contains", "matchingValue": "q_value1" } ], "cookies": [ { "key": "cookie1", "matcherName": "contains", "matchingValue": "c_value1" } ], "credentials": { "username": "joe user", "password": "p455w0rd" }, "body": [ { "matcherName": "matches_json", "matchingValue": "JFsnbWVudSddWydpZCdd" } ] }, "responseDsl": { "status": 200, "statusMessage": "HTTP/1.1 200 OK", "headers": [ { "name": "Content-Type", "value": "text/plain; charset=UTF-8" } ], "binary": false, "content": "SGVsbG8gd29ybGQhCg==", "charset": "UTF-8" } } } ] }' 

Create a Transaction Request Attributes

Attributes

  • workspaceId integer

    required

    The Workspace identifier

  • serviceId integer

    required

    The Service identifier

  • name string

    required

    The name of this transaction

  • description string

    An optional description that helps you identify this transaction

  • tags array

    An optional array of custom tags to help you identify this transaction. New tags are created if they do not exist yet

  • dsl object

    required

    The dsl is the object that stores properties of Transactions. For details, see dsl in the Appendix.

Response200 OK

{
  "apiVersion": 0,
  "error": "string",
  "limit": 0,
  "link": "string",
  "requestId": "string",
  "result": {
    "description": "string",
    "dsl": {
      "array": true,
      "bigDecimal": true,
      "bigInteger": true,
      "binary": true,
      "boolean": true,
      "containerNode": true,
      "double": true,
      "float": true,
      "floatingPointNumber": true,
      "int": true,
      "integralNumber": true,
      "long": true,
      "missingNode": true,
      "nodeType": "ARRAY",
      "null": true,
      "number": true,
      "object": true,
      "pojo": true,
      "short": true,
      "textual": true,
      "valueNode": true
    },
    "id": 0,
    "link": "string",
    "name": "string",
    "serviceId": 0,
    "serviceName": "string",
    "tags": [
      "string"
    ]
  },
  "skip": 0,
  "total": 0
}