Table of Contents |
---|
...
You can apply transformations the requests and responses in your Proxy APIs through the API Policies tab. Request and response transformation enables you modify the contents of your APIs using key/value pairs in the following ways:
- Request transformation: use this policy to transform a header, body, or the query string in the upstream request before the API user consumes itit is sent to its endpoint.
- Response transformation: use this policy to transform a header or JSON content in the API response that is returned to the caller.
Supported Operation Types
You can perform the following operations when apply the transformation policy:
- Add key/value pairs
- Append a key/value pair to an existing key/value pair
- Remove
...
- a key/value pair
- Rename an existing
...
- key
- Replace a key/value pair
Order of Operations
The following table lists the order of operations for requests and response transformations:
Order | Request Transformer | Response Transformer |
---|---|---|
1 | Remove | Remove |
2 | Rename | Replace |
3 | Replace | Add |
4 | Add | Append |
5 | Append | N/A |
Limitations
You cannot apply transformations to the Authorization header of a request.
Transform Requests
You can transform contents in the API requests for the following situations:
- To hide obfuscate sensitive information in the URL endpoint, like a data key, from the API consumer.
- To simplify a part of the Proxy query string for usability
- To clarify the purpose or nature of the APIs bundled in the Proxy
...
- swap an existing bearer token with a new one.
- To pass Pipeline parameters to an API that does not support the parameters in the body.
Note | ||
---|---|---|
| ||
This operation is not viewable in the Developer Portal or API Manager. |
Transform Responses
You can transform contents in the API responses for the following situations:
- To add parameters for clarifying information.
- To expose the original query string to the consumer.
- To rename or replace contents sensitive content (like data keys or bearer tokens) not intended to be viewed by the API consumer.
...
The following image shows the content-type key totalNumbers added to the Response Header response header after the Proxy is executed in the Developer Portal via through the Try it functionality.