Route Description
GET /test-cases/:testCaseId/gateways Get list of gateways
GET /gateways/:id Get gateway details
POST /test-cases/:testCaseId/gateways Create gateway
HEAD /gateways/:id Check if gateway exists
PATCH /gateways/:id Update gateway
DELETE /gateways/:id Delete gateway
GET /gateways/:gatewayId/recordings Get list of recordings
GET /recording/:id Get recording details
GET /recording/:id/traffic Get recorded traffic
GET /recording/:id/traffic/:connectionId Get recorded traffic related to one connection
GET /recording/:id/load Record the loading of a URL
POST /gateways/:gatewayId/recordings Start new recording
HEAD /recording/:id Check if recording exists
PATCH /recording/:id Update recording
PATCH /recording/:id/stop Stop recording
DELETE /recording/:id Delete recording

Overview

In order to create a recorded scenario we first need to create a gateway.

Gateway

Once a gateway is created, we can then create a recording to capture traffic. Each recording has a script generated corresponding to its steps. The script ID is then used when creating a test configuration to run the recording at scale.

Get list of gateways

Retrieve a list of all gateways within a given test case. One gateway can have one or more recordings.

GET /test-cases/:testCaseId/gateways

Request Parameters

  • up: Whether or not to include the test case details in each gateway JSON object. Defaults to false.
  • down: Whether or not to include the recordings within each gateway JSON. Defaults to true.
  • includeKeys: Whether or not to include the full set of gateway keys associated with this gateway. When a gateway encounters a new base URL it will create a new gateway key to proxy that URL. So one gateway can have many keys. Each key can be loaded at host [key].gateway.testable.io. Defaults to true.

Sample Response

[
    {
       "id":203,
       "createdAt":"2016-03-11T06:06:23.848Z",
       "updatedAt":"2016-03-11T06:06:23.848Z",
       "name":"Default",
       "gatewayType":"Http",
       "keys":[
          {
             "id":354,
             "createdAt":"2016-03-11T06:06:23.851Z",
             "updatedAt":"2016-03-11T06:06:23.851Z",
             "key":"uysblxfs",
             "url":"http://google.com",
             "isPrimary":true
          },
          {
             "id":355,
             "createdAt":"2016-03-11T06:06:40.473Z",
             "updatedAt":"2016-03-11T06:06:40.508Z",
             "key":"jwjoolyo",
             "url":"http://www.google.com",
             "isPrimary":false
          }
       ],
       "recordings":[
          {
             "id":188,
             "createdAt":"2016-03-11T06:06:32.224Z",
             "updatedAt":"2016-03-11T06:06:42.756Z",
             "name":"HTTP GET",
             "running":false,
             "startedAt":"2016-03-11T06:06:34.494Z",
             "finishedAt":"2016-03-11T06:06:42.755Z",
             "limitBreached":false,
             "active":true,
             "trafficSizeBytes":615,
             "trafficConnections":1,
             "script":{
                "id":297,
                "createdAt":"2016-03-11T06:06:32.221Z",
                "updatedAt":"2016-03-11T06:06:42.754Z",
                "name":"HTTP GET",
                "sourceType":"Recording",
                "sourceId":188,
                "length":0,
                "hasInit":false,
                "hasTeardown":false,
                "scriptType":"Code"
             }
          }
       ]
    }
]

Get gateway details

Retrieve details about a specific gateway.

GET /gateways/:id

Request Parameters

  • up: Whether or not to include the test case details in each gateway JSON object. Defaults to false.
  • down: Whether or not to include the recordings within each gateway JSON. Defaults to true.
  • includeKeys: Whether or not to include the full set of gateway keys associated with this gateway. When a gateway encounters a new base URL it will create a new gateway key to proxy that URL. So one gateway can have many keys. Each gateway key proxies a URL, and can be loaded at host [key].gateway.testable.io. Defaults to true.

Sample Response

{
   "id":203,
   "createdAt":"2016-03-11T06:06:23.848Z",
   "updatedAt":"2016-03-11T06:06:23.848Z",
   "name":"Default",
   "gatewayType":"Http",
   "active":false,
   "testCase":{
      "id":203,
      "createdAt":"2016-03-11T06:06:23.186Z",
      "updatedAt":"2016-03-11T06:06:23.186Z",
      "name":"New Test",
      "active":true
   },
   "keys":[
      {
         "id":354,
         "createdAt":"2016-03-11T06:06:23.851Z",
         "updatedAt":"2016-03-11T06:06:23.851Z",
         "key":"uysblxfs",
         "url":"http://google.com",
         "isPrimary":true
      },
      {
         "id":355,
         "createdAt":"2016-03-11T06:06:40.473Z",
         "updatedAt":"2016-03-11T06:06:40.508Z",
         "key":"jwjoolyo",
         "url":"http://www.google.com",
         "isPrimary":false
      }
   ],
   "recordings":[
      {
         "id":188,
         "createdAt":"2016-03-11T06:06:32.224Z",
         "updatedAt":"2016-03-11T06:06:42.756Z",
         "name":"HTTP GET",
         "running":false,
         "startedAt":"2016-03-11T06:06:34.494Z",
         "finishedAt":"2016-03-11T06:06:42.755Z",
         "limitBreached":false,
         "active":true,
         "trafficSizeBytes":615,
         "trafficConnections":1,
         "script":{
            "id":297,
            "createdAt":"2016-03-11T06:06:32.221Z",
            "updatedAt":"2016-03-11T06:06:42.754Z",
            "name":"HTTP GET",
            "sourceType":"Recording",
            "sourceId":188,
            "length":0,
            "hasInit":false,
            "hasTeardown":false,
            "scriptType":"Code"
         }
      }
   ]
}

Create gateway

Creates a new gateway. The key defines the gateway URL, [key].gateway.testable.io.

POST /test-cases/:testCaseId/gateways

Request Body

  • name Required: Name of the configuration.
  • url Required: The target URL to point the gateway at.

Example:

{
    "name": "New Gateway",
    "url": "https://www.google.com"
}

Response

{
   "id":203,
   "createdAt":"2016-03-11T06:06:23.848Z",
   "updatedAt":"2016-03-11T06:06:23.848Z",
   "name":"New Gateway",
   "gatewayType":"Http",
   "active":false,
   "testCase":{
      "id":203,
      "createdAt":"2016-03-11T06:06:23.186Z",
      "updatedAt":"2016-03-11T06:06:23.186Z",
      "name":"My Test Case",
      "active":true
   },
   "keys":[
      {
         "id":355,
         "createdAt":"2016-03-11T06:06:40.473Z",
         "updatedAt":"2016-03-11T06:06:40.508Z",
         "key":"jwjoolyo",
         "url":"https://www.google.com",
         "isPrimary":true
      }
   ]
}

Check if gateway exists

HEAD /gateways/:gateway

Response

HTTP Status: 200 OK or 404 NOT FOUND

Update gateway

Update the gateway name.

PATCH /gateways/:id

Request Body

{
    "name": "New Name 123"
}

Response

{
   "id":203,
   "createdAt":"2016-03-11T06:06:23.848Z",
   "updatedAt":"2016-03-11T06:06:23.848Z",
   "name":"New Name 123",
   "gatewayType":"Http",
   "active":false,
   "testCase":{
      "id":203,
      "createdAt":"2016-03-11T06:06:23.186Z",
      "updatedAt":"2016-03-11T06:06:23.186Z",
      "name":"My Test Case",
      "active":true
   },
   "keys":[
      {
         "id":355,
         "createdAt":"2016-03-11T06:06:40.473Z",
         "updatedAt":"2016-03-11T06:06:40.508Z",
         "key":"jwjoolyo",
         "url":"https://www.google.com",
         "isPrimary":true
      }
   ]
}

Delete gateway

DELETE /gateways/:id

Response

The deleted gateway

{
   "id":203,
   "createdAt":"2016-03-11T06:06:23.848Z",
   "updatedAt":"2016-03-11T06:06:23.848Z",
   "name":"New Name 123",
   "gatewayType":"Http",
   "active":false,
   "testCase":{
      "id":203,
      "createdAt":"2016-03-11T06:06:23.186Z",
      "updatedAt":"2016-03-11T06:06:23.186Z",
      "name":"My Test Case",
      "active":true
   },
   "keys":[
      {
         "id":355,
         "createdAt":"2016-03-11T06:06:40.473Z",
         "updatedAt":"2016-03-11T06:06:40.508Z",
         "key":"jwjoolyo",
         "url":"https://www.google.com",
         "isPrimary":true
      }
   ]
}

Get list of recordings

Retrieve a list of all recordings within a given gateway. One gateway can have one or more recordings.

GET /gateways/:gatewayId/recordings

Request Parameters

  • showTraffic: Whether or not to include the recorded traffic in the response. Defaults to false.
  • includeData: Whether or not to include the data captured as part of the traffic packets in the response. Defaults to false. Note that setting this to true can result in a huge response depending on the recording size.

Sample Response

[
    {
       "id":194,
       "createdAt":"2016-03-13T04:37:59.606Z",
       "updatedAt":"2016-03-13T04:38:21.048Z",
       "name":"Test R",
       "running":false,
       "startedAt":"2016-03-13T04:37:59.637Z",
       "finishedAt":"2016-03-13T04:38:21.048Z",
       "limitBreached":false,
       "active":true,
       "trafficSizeBytes":223182,
       "trafficConnections":7,
       "script":{
          "id":304,
          "createdAt":"2016-03-13T04:37:59.605Z",
          "updatedAt":"2016-03-13T04:38:21.047Z",
          "name":"Test R",
          "sourceType":"Recording",
          "sourceId":194,
          "length":3703,
          "hasInit":false,
          "hasTeardown":false,
          "scriptType":"Code"
       }
    }
]

Get recording details

Retrieve details about a specific recording.

GET /recordings/:id

Request Parameters

  • showTraffic: Whether or not to include the recorded traffic in the response. Defaults to false.
  • includeData: Whether or not to include the data captured as part of the traffic packets in the response. Defaults to false. Note that setting this to true can result in a huge response depending on the recording size.
  • includeTests: Whether or not to include any test configurations which use this recording as the scenario. Defaults to false.

Sample Response

{
   "id":194,
   "createdAt":"2016-03-13T04:37:59.606Z",
   "updatedAt":"2016-03-13T04:38:21.048Z",
   "name":"Test R",
   "running":false,
   "startedAt":"2016-03-13T04:37:59.637Z",
   "finishedAt":"2016-03-13T04:38:21.048Z",
   "limitBreached":false,
   "active":true,
   "trafficSizeBytes":223182,
   "trafficConnections":7,
   "script":{
      "id":304,
      "createdAt":"2016-03-13T04:37:59.605Z",
      "updatedAt":"2016-03-13T04:38:21.047Z",
      "name":"Test R",
      "sourceType":"Recording",
      "sourceId":194,
      "length":3703,
      "hasInit":false,
      "hasTeardown":false,
      "scriptType":"Code"
   },
   "gateway":{
      "id":203,
      "createdAt":"2016-03-11T06:06:23.848Z",
      "updatedAt":"2016-03-11T06:06:23.848Z",
      "name":"Default",
      "gatewayType":"Http",
      "active":false,
      "testCase":{
         "id":203,
         "createdAt":"2016-03-11T06:06:23.186Z",
         "updatedAt":"2016-03-11T06:06:23.186Z",
         "name":"New Test",
         "active":true
      },
      "keys":[
         {
            "id":354,
            "createdAt":"2016-03-11T06:06:23.851Z",
            "updatedAt":"2016-03-11T06:06:23.851Z",
            "key":"uysblxfs",
            "url":"http://google.com",
            "isPrimary":true
         },
         {
            "id":355,
            "createdAt":"2016-03-11T06:06:40.473Z",
            "updatedAt":"2016-03-11T06:06:40.508Z",
            "key":"jwjoolyo",
            "url":"http://www.google.com",
            "isPrimary":false
         }
      ]
   }
}

Get recorded traffic

Get the traffic captured as part of this recording

GET /recordings/:id/traffic

Request Parameters

  • includeData: Whether or not to include the data captured as part of the traffic packets in the response. Defaults to false. Note that setting this to true can result in a huge response depending on the recording size.

Sample Response

[
   {
      "id":7661,
      "createdAt":"2016-03-13T04:38:08.917Z",
      "updatedAt":"2016-03-13T04:38:08.925Z",
      "trafficType":"ConnectionOpened",
      "trafficTimestamp":"2016-03-13T04:38:08.841Z",
      "clientIp":"/52.2.187.201:38588",
      "serverIp":"google.com/216.58.219.206:80",
      "ssl":false,
      "protocol":"Http",
      "connectionId":"7ffd4720-2af2-48fe-b170-523b7199eaa9",
      "length":14,
      "httpMethod":"GET",
      "httpPath":"/"
   },
   {
      "id":7662,
      "createdAt":"2016-03-13T04:38:08.934Z",
      "updatedAt":"2016-03-13T04:38:08.936Z",
      "trafficType":"DataSent",
      "trafficTimestamp":"2016-03-13T04:38:08.841Z",
      "clientIp":"/52.2.187.201:38588",
      "serverIp":"google.com/216.58.219.206:80",
      "ssl":false,
      "protocol":"Http",
      "connectionId":"7ffd4720-2af2-48fe-b170-523b7199eaa9",
      "length":296,
      "httpMethod":"GET",
      "httpPath":"/",
      "httpHeaders":"User-Agent: Mozilla/5.0 (Unknown; Linux x86_64) AppleWebKit/534.34 (KHTML, like Gecko) PhantomJS/1.9.7 Safari/534.34\r\nAccept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8\r\nConnection: Keep-Alive\r\nAccept-Encoding: gzip\r\nAccept-Language: en-US,*\r\nHost: google.com\r\n"
   },
   {
      "id":7663,
      "createdAt":"2016-03-13T04:38:08.943Z",
      "updatedAt":"2016-03-13T04:38:08.948Z",
      "trafficType":"DataReceived",
      "trafficTimestamp":"2016-03-13T04:38:08.889Z",
      "clientIp":"/52.2.187.201:38588",
      "serverIp":"google.com/216.58.219.206:80",
      "ssl":false,
      "protocol":"Http",
      "connectionId":"7ffd4720-2af2-48fe-b170-523b7199eaa9",
      "length":537,
      "httpHeaders":"Location: http://www.google.com/\r\nContent-Type: text/html; charset=UTF-8\r\nDate: Sun, 13 Mar 2016 04:38:08 GMT\r\nExpires: Tue, 12 Apr 2016 04:38:08 GMT\r\nCache-Control: public, max-age=2592000\r\nServer: gws\r\nContent-Length: 219\r\nX-XSS-Protection: 1; mode=block\r\nX-Frame-Options: SAMEORIGIN\r\n",
      "httpStatus":301,
      "httpStatusText":"Moved Permanently"
   },
   {
      "id":7664,
      "createdAt":"2016-03-13T04:38:08.953Z",
      "updatedAt":"2016-03-13T04:38:08.957Z",
      "trafficType":"ConnectionClosed",
      "trafficTimestamp":"2016-03-13T04:38:08.889Z",
      "clientIp":"/52.2.187.201:38588",
      "serverIp":"google.com/216.58.219.206:80",
      "ssl":false,
      "protocol":"Http",
      "connectionId":"7ffd4720-2af2-48fe-b170-523b7199eaa9",
      "length":0,
      "closeReason":"ServerInitiated"
   }
]

Get recorded traffic related to one connection

Get the traffic captured related to a specific connection ID. Each traffic packet has a connection ID (a UUID). All traffic captured on one connection will have the same connection ID.

GET /recordings/:id/traffic/:connectionId

Request Parameters

  • includeData: Whether or not to include the data captured as part of the traffic packets in the response. Defaults to false. Note that setting this to true can result in a huge response depending on the recording size.

Sample Response

[
   {
      "id":7661,
      "createdAt":"2016-03-13T04:38:08.917Z",
      "updatedAt":"2016-03-13T04:38:08.925Z",
      "trafficType":"ConnectionOpened",
      "trafficTimestamp":"2016-03-13T04:38:08.841Z",
      "clientIp":"/52.2.187.201:38588",
      "serverIp":"google.com/216.58.219.206:80",
      "ssl":false,
      "protocol":"Http",
      "connectionId":"7ffd4720-2af2-48fe-b170-523b7199eaa9",
      "length":14,
      "httpMethod":"GET",
      "httpPath":"/"
   },
   {
      "id":7662,
      "createdAt":"2016-03-13T04:38:08.934Z",
      "updatedAt":"2016-03-13T04:38:08.936Z",
      "trafficType":"DataSent",
      "trafficTimestamp":"2016-03-13T04:38:08.841Z",
      "clientIp":"/52.2.187.201:38588",
      "serverIp":"google.com/216.58.219.206:80",
      "ssl":false,
      "protocol":"Http",
      "connectionId":"7ffd4720-2af2-48fe-b170-523b7199eaa9",
      "length":296,
      "httpMethod":"GET",
      "httpPath":"/",
      "httpHeaders":"User-Agent: Mozilla/5.0 (Unknown; Linux x86_64) AppleWebKit/534.34 (KHTML, like Gecko) PhantomJS/1.9.7 Safari/534.34\r\nAccept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8\r\nConnection: Keep-Alive\r\nAccept-Encoding: gzip\r\nAccept-Language: en-US,*\r\nHost: google.com\r\n"
   },
   {
      "id":7663,
      "createdAt":"2016-03-13T04:38:08.943Z",
      "updatedAt":"2016-03-13T04:38:08.948Z",
      "trafficType":"DataReceived",
      "trafficTimestamp":"2016-03-13T04:38:08.889Z",
      "clientIp":"/52.2.187.201:38588",
      "serverIp":"google.com/216.58.219.206:80",
      "ssl":false,
      "protocol":"Http",
      "connectionId":"7ffd4720-2af2-48fe-b170-523b7199eaa9",
      "length":537,
      "httpHeaders":"Location: http://www.google.com/\r\nContent-Type: text/html; charset=UTF-8\r\nDate: Sun, 13 Mar 2016 04:38:08 GMT\r\nExpires: Tue, 12 Apr 2016 04:38:08 GMT\r\nCache-Control: public, max-age=2592000\r\nServer: gws\r\nContent-Length: 219\r\nX-XSS-Protection: 1; mode=block\r\nX-Frame-Options: SAMEORIGIN\r\n",
      "httpStatus":301,
      "httpStatusText":"Moved Permanently"
   },
   {
      "id":7664,
      "createdAt":"2016-03-13T04:38:08.953Z",
      "updatedAt":"2016-03-13T04:38:08.957Z",
      "trafficType":"ConnectionClosed",
      "trafficTimestamp":"2016-03-13T04:38:08.889Z",
      "clientIp":"/52.2.187.201:38588",
      "serverIp":"google.com/216.58.219.206:80",
      "ssl":false,
      "protocol":"Http",
      "connectionId":"7ffd4720-2af2-48fe-b170-523b7199eaa9",
      "length":0,
      "closeReason":"ServerInitiated"
   }
]

Record the loading of a URL

Simulate loading a URL across the gateway and capturing the traffic into this recording.

GET /recordings/:id/load

Request Parameters

  • action: http-get to add an HTTP GET step to the recording. load-chrome to add a series of steps corresponding to loading the url in a Chrome browser.
  • path: The path to load. This is relative to the gateway URL
  • endRecording: Whether or not to stop the recording after performing the requested action. Defaults to false.

Sample Response

DONE

Start new recording

Creates a new recording.

POST /gateways/:gatewayId/recordings

Request Body

  • name Required: Name of the configuration.

Example:

{
    "name": "New Recording"
}

Response

{
   "id":194,
   "createdAt":"2016-03-13T04:37:59.606Z",
   "updatedAt":"2016-03-13T04:38:21.048Z",
   "name":"New Recording",
   "running":false,
   "startedAt":"2016-03-13T04:37:59.637Z",
   "finishedAt":"2016-03-13T04:38:21.048Z",
   "limitBreached":false,
   "active":true,
   "trafficSizeBytes":223182,
   "trafficConnections":7,
   "script":{
      "id":304,
      "createdAt":"2016-03-13T04:37:59.605Z",
      "updatedAt":"2016-03-13T04:38:21.047Z",
      "name":"Test R",
      "sourceType":"Recording",
      "sourceId":194,
      "length":3703,
      "hasInit":false,
      "hasTeardown":false,
      "scriptType":"Code"
   },
   "gateway":{
      "id":203,
      "createdAt":"2016-03-11T06:06:23.848Z",
      "updatedAt":"2016-03-11T06:06:23.848Z",
      "name":"Default",
      "gatewayType":"Http",
      "active":false,
      "testCase":{
         "id":203,
         "createdAt":"2016-03-11T06:06:23.186Z",
         "updatedAt":"2016-03-11T06:06:23.186Z",
         "name":"New Test",
         "active":true
      },
      "keys":[
         {
            "id":354,
            "createdAt":"2016-03-11T06:06:23.851Z",
            "updatedAt":"2016-03-11T06:06:23.851Z",
            "key":"uysblxfs",
            "url":"http://google.com",
            "isPrimary":true
         },
         {
            "id":355,
            "createdAt":"2016-03-11T06:06:40.473Z",
            "updatedAt":"2016-03-11T06:06:40.508Z",
            "key":"jwjoolyo",
            "url":"http://www.google.com",
            "isPrimary":false
         }
      ]
   }
}

Check if recording exists

HEAD /recordings/:id

Response

HTTP Status: 200 OK or 404 NOT FOUND

Update recording

Update the recording name.

PATCH /recordings/:id

Request Body

{
    "name": "New Name 123"
}

Response

{
   "id":194,
   "createdAt":"2016-03-13T04:37:59.606Z",
   "updatedAt":"2016-03-13T04:38:21.048Z",
   "name":"New Name 123",
   "running":true,
   "startedAt":"2016-03-13T04:37:59.637Z",
   "finishedAt":"2016-03-13T04:38:21.048Z",
   "limitBreached":false,
   "active":true,
   "trafficSizeBytes":223182,
   "trafficConnections":7,
   "script":{
      "id":304,
      "createdAt":"2016-03-13T04:37:59.605Z",
      "updatedAt":"2016-03-13T04:38:21.047Z",
      "name":"Test R",
      "sourceType":"Recording",
      "sourceId":194,
      "length":3703,
      "hasInit":false,
      "hasTeardown":false,
      "scriptType":"Code"
   }
}

Stop recording

Stop the recording. It will no longer capture traffic on the gateway.

PATCH /recordings/:id/stop

Request Body

None

Response

{
   "id":194,
   "createdAt":"2016-03-13T04:37:59.606Z",
   "updatedAt":"2016-03-13T04:38:21.048Z",
   "name":"New Name 123",
   "running":false,
   "startedAt":"2016-03-13T04:37:59.637Z",
   "finishedAt":"2016-03-13T04:38:21.048Z",
   "limitBreached":false,
   "active":true,
   "trafficSizeBytes":223182,
   "trafficConnections":7,
   "script":{
      "id":304,
      "createdAt":"2016-03-13T04:37:59.605Z",
      "updatedAt":"2016-03-13T04:38:21.047Z",
      "name":"Test R",
      "sourceType":"Recording",
      "sourceId":194,
      "length":3703,
      "hasInit":false,
      "hasTeardown":false,
      "scriptType":"Code"
   }
}

Delete recording

DELETE /recordings/:id

Response

The deleted recording

{
   "id":194,
   "createdAt":"2016-03-13T04:37:59.606Z",
   "updatedAt":"2016-03-13T04:38:21.048Z",
   "name":"New Name 123",
   "running":false,
   "startedAt":"2016-03-13T04:37:59.637Z",
   "finishedAt":"2016-03-13T04:38:21.048Z",
   "limitBreached":false,
   "active":true,
   "trafficSizeBytes":223182,
   "trafficConnections":7,
   "script":{
      "id":304,
      "createdAt":"2016-03-13T04:37:59.605Z",
      "updatedAt":"2016-03-13T04:38:21.047Z",
      "name":"Test R",
      "sourceType":"Recording",
      "sourceId":194,
      "length":3703,
      "hasInit":false,
      "hasTeardown":false,
      "scriptType":"Code"
   }
}