Tyk v2.2 Documentation Components

  1. Home
  2. Tyk v2.2 Documentation Components
  3. Request body modification: setup via API

Request body modification: setup via API

Setting up transforms in your API definition is easy:

"extended_paths": {
    "ignored": [],
    "white_list": [],
    "black_list": [],
    "cache": ["get"],
    "transform": [
            "path": "widgets/{id}",
            "method": "POST",
            "template_data": {
                "template_mode": "file",
                "template_source": "./templates/transform_test.tmpl"

Tyk will load and evaluate the template on start, if you modify the template, you will need to restart Tyk in order for the changes to take effect.

The field representations are:

  • path: The path to match.
  • method : The method to match.
  • template_data.input_type: Either xml or json, this represents the type of data the parser should expect.
  • enable_session: This makes session metadata available to the transform template (see the section on session data below).
  • template_source: Either a file path, or a base64 encoded representation of your template.
  • template_mode: Set to blob for a base64 template and file for a file path in the template source.