Skip to content
pierre-leonard edited this page Feb 27, 2020 · 5 revisions

Installation instructions

Swagger documentation available at [YOUR HOST]/swagger-ui.html#/

The typical usage flow goes like this:

  1. Program a dataset recording (using curl/postman)
  2. Create a player from the UI (List recordings/create a player)
  3. Control the playback from the UI (List players/control buttons)

Program a dataset recording

Single URL recording

POST to /record/start/single with JSON body

{ "url": [URL to record], "period": [recording period in seconds, 0 for a single record], "duration": [recording duration in seconds], "start": [optional, time of the first record, format YYYY-MM-DDTHH:mm:ssZ], "name": [recording name], "method": [http method to use, default GET] , "headers": [optional list of headers] , "body": [optional body], "feedItemPath": [Optional path to sub items, see below] }

Multi URL recording

POST to /api/record/start/set with body

{ "urlsToRecord": [Array of recording objects, see below], "duration": [recording duration in seconds], "start": [optional, time of the first record, format YYYY-MM-DDTHH:mm:ssZ], "name": [recording name], "globalParameters": [Optional array of parameters, see below], "feedItemPath": [Optional path to sub items, see below] }

Recording object structure: { "url": [URL to record], "parameters": [Optional array of parameters, see below], "period": [recording period in seconds, 0 for a single record], "body": [optional body], "headers": [optional list of headers], "method": [http method to use, default GET] }

Parameters

It's possible to parametrize the url or the body of the requests to reduce the size of the json. When a parameter is detected in the url/body, it is replaced by all the matching values found in the json, in the local parameters array and in the globalParametersArray. If there are several parameters in the url/body, one url/body will be recorded for every combination of parameter values.

For instance the following recording object, { "url": "http://hosttorecord.com/PARAM1?id=PARAM2", "period": 10, "parameters":[ { "name" : "PARAM1", "values" : ["foo", "bar"] }, { "name" : "PARAM2", "values" : ["123", "456"] } ] } will record the urls:

Feed items

If the document you're recording contains a list of items available at a different location (for instance a list of article urls), it's possible to record the sub items as well by specifying where to get the url of the items. At the moment this only work using jsonpath (so for json documents only). The sub items will be recorded only once.

For instance if your datasource looks like [{ "title": "article 1", "url" : "http://host/path/article1" }, { "title": "article 2", "url" : "http://host/path/article2" } ]

By specifying the jsonpath $..["url"] you will also record http://host/path/article1 and http://host/path/article2. If new articles are later added to the list, they will also be recorded.

Create a player from a recording

Open the app in a browser. Click "list recordings" and then "Create a player". It's possible to give it a uuid of your choice or to generate a random one.

Control the player

Open the app in a browser. Click "list players".

  • Speed: delta to the offset for every second
  • Offset: number of seconds since the beginning of the recording

Read the data from the player

The data from the recorded urls is visible at [your host]/watch/[player uuid]/url/[recorded url] There are 2 ways to integrate this in your application:

  • add the api recorder prefix in front of the host you've recorded and make a new build
  • use a proxy with some logic that will redirect your application to the recorder. Tested with Fiddler.