Hub Listing - Request and Response Transformations

๐Ÿ“˜

Rapid Proxy Only

This functionality uses the Rapid Proxy. If you are an enterprise customer and your API does not use the Rapid Proxy, this page does not apply.

Transformations allow you to remove, remap, or add headers or parameters in API requests and API responses transparently to the developer using the API.

Transformation actions

FunctionDescriptionUse case
ADDAdd a header or parameter to an API request or response.Add a secret authentication parameter per plan in the case where each plan uses a different base URL (learn more about multi-base URLs here).
REMAPRemap a header or parameter in an API request or response.Remap request authentication from query to header to provide a better developer experience, without modifying the original API.
REMOVERemove a header or parameter in an API request or response.Remove a parameter in the original API response so that it isn't displayed to the API consumer.

Get started with transformations

To start, navigation to Studio (My APIs) and select the Hub Listing > Definitions tab for the API you want to edit. Click Endpoints, then click Edit for an endpoint in which you want to manage transformations.

Edit an endpoint in Studio to manage request and response transformations.

Edit an endpoint in Studio to manage request and response transformations.

This screen allows you to remove, remap, or add headers or parameters in API requests and API responses.

How to define a transformation

Step 1: Select either Request Transformation or Response Transformation

Request and response transformations for an endpoint.

Request and response transformations for an endpoint.

Step 2: Select an action

You can set the action to Remove, Remap, or Add.

2380

๐Ÿšง

[IMPORTANT]

The Method and Base URL Transformations can only be done from the Edit Endpoint tab.

See the instructions for this process below.

Step 3: Define the target Key

You can select from the available options, and add more detail using dot notation.

2378

Step 4: Select a variable type

You can select from Static, Variable, or Template.

  • Select type Static for if you want to send plain text/json or any fixed data
  • Select type Variable if you want to map the value from other parameters. Example request.header.xxxx
  • Select type Template if you want to read values from other variables and add more content and manipulate data. You can use the powerful mustache syntax to achieve complex mappings.

Example {{request.query.value}},{{request.body.item}} I am using transformation {{request.body.item2}}

Step 5: Set the variable value

2380

Step 6: Set the scope of the transformation

Set the scope to include the full API or select specific endpoints.

2376

Step 7: Select which subscription plans are impacted

You can choose to apply the transformation to all of the plans or select which specific plans it applies to.

2380

How to add header "content-type" [Required if transforming methods]

While transforming methods, you must add the header "content-type" explicitly.

From the Edit Endpoint page, select the Header tab. Add one of the following content-type headers to the Example Value field:

  • application/json
  • multipart/form-data
  • application/x-www-form-urlencoded
1640

Save the changes once you are finished