With WSO2 API Manager, you can maintain a production and a sandbox endpoint for a given API. The production endpoint is the actual location of the API, whereas the sandbox endpoint points to its testing/pre-production environment.
When you publish an API using the API Publisher, it gets deployed on the API Gateway. By default, there's a single Gateway instance (deployed either externally or embedded within the publisher). This Gateway instance supports handles both production and sandbox token types. When traffic. Therefore, it is called a Hybrid API Gateway. When an API request comes to the API Gateway, it checks whether the requesting token is of type PRODUCTION or SANDBOX and forwards the request to the appropriate endpoint. The diagram below depicts the default scenariosthis scenario.
Figure: Both production and testing sandbox API requests are handled through a single gateway Gateway (default scenario)
The above API Gateway is known as a Hybrid API Gateway since it passes Having a single gateway instance to pass through both production and sandbox traffic. Instead of having the above approach, it is also possible to publish an API to two different API testing requests can negatively impact the performance of the production server. To avoid this, you can set up two separate API Gateways. One which will only to pass through production traffic and the other which will only pass through for sandbox traffic.
Using
Figure: Two Gateways to handle production and sandbox API requests separately
In this approach, the Production production API Gateway will only pass through requests which handles requests that are made using ' PRODUCTION ' type tokens and the Sandbox sandbox API Gateway will only pass through requests which handles requests that are made using ' SANDBOX ' type tokens. If
In either of the two approaches, if an API Gateway receives an invalid token the is received on any of the two Gateways, it will return returns an error response to the requesting client saying that the token is invalid token type. The <APIGateway>
section element of the api-manager.xml
file contains details of how to configure the API Publisher to publish APIs to different Gateways. Visit this section of the API Manager documentation to see details of the <APIGateway> configuration and a sample configuration of an API Publisher which has 3 Gateways configured.
...