# Parameter Transformation

This article will show you how to perform API transformation on FabriXAPI, for example, adding a header in an API request

You need to create an API before transforming an API, please follow ”Add API as Providers” to create an API.

# Where to Transform API?

You can transform an API by editing an API, please refer to “Edit API as Providers” for how to edit an API.

# How to Create a Transformation?

  1. On the Transformations tab, select "Request" or "Response" then click Create .
  2. Fill in the form with all required information, including
    1. Parameter Type
    2. Action
    3. Key *Please be reminded not to use the ”List of Reserved Words for API Transformation
    4. Type
    5. Value
  3. Click Save after you're done.

# Examples of using Parameter Transformation for API Authorization

API Key

Sample Settings

  • Parameter Type : Header
  • Action : Add
  • Key : X-API-Key
  • Type : Static
  • Value : abcdef12345
GET /something HTTP/1.1
X-API-Key: abcdef12345

Basic Auth

Sample Settings

  • Parameter Type : Header
  • Action : Add
  • Key : Authorization
  • Type : Static
  • Value : Basic am9obkBleGFtcGxlLmNvbTphYmMxMjM=
GET /echo/get/json HTTP/1.1
Authorization: Basic am9obkBleGFtcGxlLmNvbTphYmMxMjM=

Bearer Token

Sample Settings

  • Parameter Type : Header
  • Action : Add
  • Key : Authorization
  • Type : Static
  • Value : Bearer <token>
GET /echo/get/json HTTP/1.1
Authorization: Bearer <token>

JWT Token

Sample Settings

  • Parameter Type : Header
  • Action : Add
  • Key : Authorization
  • Type : Static
  • Value : Bearer <jwt token>
GET /echo/get/json HTTP/1.1
Authorization: Bearer <jwt token>