Rapid Spike Web Service.

Welcome to the Rapid Spike Journey and Load Test Web Service. The following actions are available.

/api-run

Expects the JSON data to be submitted to the service with the parameter name json via the POST method. The json value should be a valid Rapid Spike Journey File (See Below)


/api-report

The reporting end-point allows users to request data from the Journey system. All output is JSON.

Authentication

This end-point requires authentication using a public and private key. The public key, requesting unix time and any other required parameters are combined and signed using SHA1 and the private key.

A requesting app must provide the following in the request:

  • public_key
    • provided public key
  • time
    • unix timestamp at time of request
  • signature
    • signed signiture using the provided private key - see example

PHP Example

Here we take the public key, private key, unix time and plan ID to produce a SHA1 signature using the private key. The plan ID is not required by all end-points - see individual end-point docs.

$public_key = 'publickey_example';
$private_key = 'privatekey_example';
$time = time();

$package = $public_key . "\n" . $time . "\n" . $plan_id;

$binary_signature = hash_hmac('sha1', $package, $private_key, true);
$url_signature = urlencode(base64_encode($binary_signature));

$requestUrl = "?public_key=" . $public_key . "&time=" . $time . "&signature=" . $url_signature;

Available End-Points

/plans

Read all plans

Parameters:

Key Required Decription Options Default
planids yes Required plans

Example Request

GET /api-report/plans?public_key=publickey_example&time=1458657222&signature=gg9kriz4WvGqf7h6ZGYq6k8w6rE%3D&planids=rapidspike_browse,rapidspike_login

Example Response

{
    "Error": false,
    "PlanID": false,
    "Message": "Success",
    "Report": [
        {
            "PlanId": "rapidspike_browse",
            "Data": {
                "CurrentStatus": "Passing",
                "RecentErrorsCount": 1,
                "LatestLoadTime": 2.54,
                "LatestRunDate": "2016-03-29 16:13:20",
                "LatestRunRegion": "Dublin"
            }
        },
        {
            "PlanId": "rapidspike_login",
            "Data": {
                "CurrentStatus": "Passing",
                "RecentErrorsCount": 0,
                "LatestLoadTime": 12.19,
                "LatestRunDate": "2016-03-29 15:55:10",
                "LatestRunRegion": "HongKong"
            }
        }
    ]
}

/plan-{id}

/dailyaverage

Read one plan's daily average load times

Parameters:

Key Required Decription Options Default
days no Number of days of data 7

Example Request

GET /api-report/plan-rapidspike_browse/dailyaverage?public_key=publickey_example&time=1458295770&signature=mNH3jmPcfzmR%2FH01fuKlkjsI%2FX4%3D&days=7

Example Response

{
    "Error": false,
    "PlanID": "rapidspike_browse",
    "Message": "Success",
    "Report": [
        {
            "date": "2016-03-22",
            "regions": [
                {
                    "title": "Dublin",
                    "average": "9.33"
                },
                {
                    "title": "HongKong",
                    "average": 0
                },
                {
                    "title": "London",
                    "average": 0
                },
                {
                    "title": "NewYork",
                    "average": 0
                }
            ]
        },
        {
            "date": "2016-03-17",
            "regions": [
                {
                    "title": "Dublin",
                    "average": 0
                },
                {
                    "title": "HongKong",
                    "average": "18.01"
                },
                {
                    "title": "London",
                    "average": "12.50"
                },
                {
                    "title": "NewYork",
                    "average": "11.27"
                }
            ]
        }
    ]
}

/loadtimes

Read one plan's load times

Parameters:

Key Required Decription Options Default
hours no Number of hours of data 24
region no Region to fetch load time for All

Example Request

GET /api-report/plan-rapidspike_browse/loadtimes?public_key=publickey_example&time=1458295770&signature=mNH3jmPcfzmR%2FH01fuKlkjsI%2FX4%3D&hours=24

Example Response

{
    "Error": false,
    "PlanID": "rapidspike_browse",
    "Message": "Success",
    "Report": {
        "Dublin": {
            "Region": "Dublin",
            "Results": {
                "2016-03-23 10:52:00": {
                    "RunDate": "2016-03-23 10:52:00",
                    "RunDateUnix": 1458730320,
                    "LoadTime": 12.17,
                    "SampleID": "9c0c9d6c-4348-47ac-ba82-c2623fd35244"
                }
            }
        }
    }
}

/tests

Read one plan's tests paged

Parameters:

Key Required Decription Options Default
page yes Current page number 1
per_page yes Number of tests per page 20
sample_data no Whether to include sample result data true / false false

Example Request

GET /api-report/plan-rapidspike_browse/tests?public_key=publickey_example&time=1458295770&signature=mNH3jmPcfzmR%2FH01fuKlkjsI%2FX4%3D&page=2&per_page=10&sample_data=true

Example Response

{
    "Error": false,
    "PlanID": "rapidspike_browse",
    "Message": "Success",
    "Report": {
        "Tests": [
            {
                "TestID": "bd78fe88-6414-4bf7-b784-7807731f8468",
                "Comment": "This test loads the RapidSpike homepage",
                "CreatedDate": "2016-03-23 10:51",
                "Samples": [
                    {
                        "Type": "Browser",
                        "Start": "https://www.rapidspike.com",
                        "Steps": [
                            {
                                "Type": "Capture",
                                "Comment": "Go to RapidSpike homepage"
                            },
                            {
                                "Type": "HTTPArchive",
                                "Comment": "Go to RapidSpike homepage"
                            }
                        ],
                        "Region": {
                            "Select": "All",
                            "Include": [
                                "Dublin",
                                "HongKong",
                                "NewYork"
                            ]
                        },
                        "Comment": "Dashboard Capture",
                        "ViewPort": {
                            "Width": 768,
                            "Height": 1024
                        },
                        "UserAgent": "Mozilla/5.0 (iPad; CPU OS 7_0 like Mac OS X) AppleWebKit/537.51.1 (KHTML, like Gecko) CriOS/30.0.1599.12 Mobile/11A465 Safari/8536.25"
                    }
                ]
            }
        ],
        "Paging": {
            "pagefirst": true,
            "pagelast": 1,
            "pagenext": 1,
            "pageprevious": 0,
            "resultsstart": 1,
            "resultsend": 10,
            "offset": 0,
            "limit": 10,
            "resultspages": 1,
            "resultstotal": 1,
            "resultspage": 1,
            "pages": [
                {
                    "page": 1,
                    "current": true
                }
            ]
        }
    }
}
/latest

Read one plan's latest test

Parameters:

Key Required Decription Options Default
sample_data no Whether to include sample result data true / false false

Example Request

GET /api-report/plan-rapidspike_browse/tests/latest?public_key=publickey_example&time=1458295770&signature=mNH3jmPcfzmR%2FH01fuKlkjsI%2FX4%3D

Example Response

{
    "Error": false,
    "PlanID": "rapidspike_browse",
    "Message": "Success",
    "Report": {
        "Test": {
            "TestID": "bd78fe88-6414-4bf7-b784-7807731f8468",
            "Comment": "This test loads the RapidSpike homepage",
            "CreatedDate": "2016-03-23 10:51",
            "Samples": false
        }
    }
}
/testid-{id}

Read one plan's one test

Parameters:

Key Required Decription Options Default
sample_data no Whether to include sample result data true / false false

Example Request

GET /api-report/plan-rapidspike_browse/tests/testid-93265787-b54a-4f16-bea0-73b2d2778671?public_key=publickey_example&time=1458295770&signature=mNH3jmPcfzmR%2FH01fuKlkjsI%2FX4%3D

Example Response

{
    "Error": false,
    "PlanID": "rapidspike_browse",
    "Message": "Success",
    "Report": {
        "Test": {
            "TestID": "93265787-b54a-4f16-bea0-73b2d2778671",
            "Comment": "This test loads the RapidSpike homepage",
            "CreatedDate": "2016-03-22 10:07",
            "Samples": false
        }
    }
}

/samples

Read one plan's samples paged

Parameters:

Key Required Decription Options Default
page yes Current page number 1
per_page yes Number of tests per page 20
sample_data no Whether to include test result data true / false false
errors_only no Whether to only give error samples true / false false

Example Request

GET /api-report/plan-rapidspike_browse/samples?public_key=publickey_example&time=1458295770&signature=mNH3jmPcfzmR%2FH01fuKlkjsI%2FX4%3D&page=1&per_page=10

Example Response

{
    "Error": false,
    "PlanID": "rapidspike_browse",
    "Message": "Success",
    "Report": {
        "Samples": [
            {
                "SampleID": "9c0c9d6c-4348-47ac-ba82-c2623fd35244",
                "Comment": "This test loads the RapidSpike homepage",
                "RunDate": "2016-03-23 10:52",
                "RunRegion": "Dublin",
                "LoadTime": 12.17,
                "ErrorsCount": 0,
                "Data": false
            },
            {
                "SampleID": "01409b69-b611-4723-86bb-7d439e6665fc",
                "Comment": "This test loads the RapidSpike homepage",
                "RunDate": "2016-03-22 10:08",
                "RunRegion": "Dublin",
                "LoadTime": 9.33,
                "ErrorsCount": 1,
                "Data": false
            },
            {
                "SampleID": "c4dd3330-6afe-4cab-8d62-e5f13d800d6d",
                "Comment": "This test loads the RapidSpike homepage",
                "RunDate": "2016-03-17 16:46",
                "RunRegion": "HongKong",
                "LoadTime": 19.54,
                "ErrorsCount": 0,
                "Data": false
            },
            {
                "SampleID": "2275e998-eb18-4ce9-9515-c282fead7f88",
                "Comment": "This test loads the RapidSpike homepage",
                "RunDate": "2016-03-17 16:46",
                "RunRegion": "NewYork",
                "LoadTime": 15.23,
                "ErrorsCount": 0,
                "Data": false
            },
            {
                "SampleID": "a9979e57-47dd-4342-a83c-e2d6adbad25a",
                "Comment": "This test loads the RapidSpike homepage",
                "RunDate": "2016-03-17 16:45",
                "RunRegion": "London",
                "LoadTime": 11.62,
                "ErrorsCount": 0,
                "Data": false
            },
            {
                "SampleID": "d015860a-6312-4b58-9219-dfc871480a33",
                "Comment": "This test loads the RapidSpike homepage",
                "RunDate": "2016-03-17 16:31",
                "RunRegion": "HongKong",
                "LoadTime": 20.62,
                "ErrorsCount": 0,
                "Data": false
            },
            {
                "SampleID": "f070ba23-31ee-48fb-84e1-a0f83432287f",
                "Comment": "This test loads the RapidSpike homepage",
                "RunDate": "2016-03-17 16:31",
                "RunRegion": "NewYork",
                "LoadTime": 11.83,
                "ErrorsCount": 0,
                "Data": false
            },
            {
                "SampleID": "dd70aef1-4b3d-4b32-8eaf-2f622979d1ec",
                "Comment": "This test loads the RapidSpike homepage",
                "RunDate": "2016-03-17 16:30",
                "RunRegion": "London",
                "LoadTime": 11.61,
                "ErrorsCount": 0,
                "Data": false
            },
            {
                "SampleID": "287bdf00-a4ec-4872-b803-7ee25265c8cb",
                "Comment": "This test loads the RapidSpike homepage",
                "RunDate": "2016-03-17 16:16",
                "RunRegion": "HongKong",
                "LoadTime": 16.76,
                "ErrorsCount": 0,
                "Data": false
            },
            {
                "SampleID": "6b35000b-2d4b-4674-a02e-e77163d0d25a",
                "Comment": "This test loads the RapidSpike homepage",
                "RunDate": "2016-03-17 16:16",
                "RunRegion": "London",
                "LoadTime": 17.73,
                "ErrorsCount": 0,
                "Data": false
            }
        ],
        "Paging": {
            "pagefirst": true,
            "pagelast": 424,
            "pagenext": 2,
            "pageprevious": 0,
            "resultsstart": 1,
            "resultsend": 10,
            "offset": 0,
            "limit": 10,
            "resultspages": 424,
            "resultstotal": 4237,
            "resultspage": 1,
            "pages": [
                {
                    "page": 1,
                    "current": true
                },
                {
                    "page": 2,
                    "current": false
                },
                {
                    "page": 3,
                    "current": false
                },
                {
                    "page": 4,
                    "current": false
                },
                {
                    "page": 5,
                    "current": false
                }
            ]
        }
    }
}
/latest

Read one plan's latest sample

Parameters:

Key Required Decription Options Default
sample_data no Whether to include sample result data true / false false

Example Request

GET /api-report/plan-rapidspike_browse/samples/latest?public_key=publickey_example&time=1458295770&signature=mNH3jmPcfzmR%2FH01fuKlkjsI%2FX4%3D

Example Response

{
    "Error": rapidspike_browse,
    "PlanID": "beam",
    "Message": "Success",
    "Report": {
        "Sample": {
            "SampleID": "9c0c9d6c-4348-47ac-ba82-c2623fd35244",
            "Comment": "This test loads the RapidSpike homepage",
            "CreatedDate": "2016-03-23 10:52",
            "RunRegion": "Dublin",
            "LoadTime": 12.17,
            "Data": false
        }
    }
}
/sampleid-{id}

Read one plan's one sample

Parameters:

Key Required Decription Options Default
sample_data no Whether to include sample result data true / false false

Example Request

GET /api-report/plan-rapidspike_browse/samples/sampleid-cd0c01c0-eead-4387-b476-22509cf05e44?public_key=publickey_example&time=1458295770&signature=mNH3jmPcfzmR%2FH01fuKlkjsI%2FX4%3D

Example Response

{
    "Error": false,
    "PlanID": "rapidspike_browse",
    "Message": "Success",
    "Report": {
        "Sample": {
            "SampleID": "cd0c01c0-eead-4387-b476-22509cf05e44",
            "Comment": "This test loads the RapidSpike homepage",
            "CreatedDate": "2016-03-01 12:12",
            "RunRegion": "London",
            "LoadTime": 14.94,
            "Data": false
        }
    }
}

Journey File

The Journey File should be a valid JSON file and can contain the following elements.

Element Type Description Default Required
Global Object
Global.Version Numeric Version number that the file format conforms to 0.5 Yes
Global.PlanID String A unique ID for this plan, it should be alphanu... example Yes
Global.Comment String Summary about this plan No
Options Object
Options.AccountID String Your account ID Yes
Options.AccountKey String Your account Key Yes
Options.Concurrent Numeric The maximum number of concurrent connections th... 1 No
Options.SampleCount Numeric The number of samples that should be taken as p... 1 No
Samples Array
Samples.Comment String Brief comment to explain this sample Yes
Samples.Type String Define the type of sample required Browser Yes
Samples.Start String The starting location for the sample http://domain.com Yes
Samples.UserAgent String The UserAgent string that the injector should use No
Samples.ViewPort Object
Samples.ViewPort.Width Integer The Browser window width 1024 No
Samples.ViewPort.Height Integer The Browser window height 768 No
Samples.Region Object
Samples.Region.Selection String How the regions should be selected All No
Samples.Region.Include Array
Samples.Steps Array
         
Samples.Steps.Type = Capture Token Create a screen capture No
Samples.Steps.Wait Integer The time in milliseconds before the step is exe... 5000 No
Samples.Steps.Comment String Brief comment to explain this step, the comment... Yes
         
Samples.Steps.Type = HTTPArchive Token Captures the HAR for the current page No
Samples.Steps.Wait Integer The time in milliseconds before the step is exe... 5000 No
Samples.Steps.Comment String Brief comment to explain this step, the comment... Yes
         
Samples.Steps.Type = Evaluate Token Evaluate the given expression and hold in the v... No
Samples.Steps.Name String The name of the variable where the expression v... No
Samples.Steps.Expression String Supports a JQuery selector $('a[href^="/somelink/"]') No
         
Samples.Steps.Type = Open Token Opens the given link No
Samples.Steps.Link String The URL to open https://domain.com/ No
Samples.Steps.Append String A variable name to append to the Link, the vari... No
         
Samples.Steps.Type = Form Token Fill form information No
Samples.Steps.Selector String CSS3 Selector to get the form form[name="contact"] No
Samples.Steps.Fields Object
Samples.Steps.Fields.FIELDNAME String The Key should be the field name and the value ... No
Samples.Steps.Submit Boolean If the form should be auto submitted True No
         
Samples.Steps.Type = Click Token Performs a Click on the selected element
Samples.Steps.Selector String CSS3 Selector to get the element requiring a click No

Report Request File

The Journey File should be a valid JSON file and can contain the following elements.

Element Type Description Required
Version String Version number that the file format conforms to
PlanID String A unique ID for this plan.
Format String The report format. Options: JSON, PDF, HTML