Integration using Simulator
This page outlines the usage of Response Simulator by AA, FIU or FIP with entity APIs for the integration of Proxy. This Response Simulator will simulate the behaviour of the actual entity APIs to facilitate Sahamati proxy usage and testing.
Overview:
The Response Simulator is designed to simulate the behaviour of real Entity’s Protocol APIs. It provides a controlled environment for developers to test and verify proxy service without relying on an actual entity.
The sample workflow diagram below illustrates the usage of the Response Simulator by including a simulated response with the expected response.
The following two details are required in the request to use the APIs with Response Simulator:
recipient-id: This is specified in the x-request-meta header through which the proxy that will route the request to the respective response simulator. The available options are,
AA-SIMULATOR
FIU-SIMULATOR and
FIP-SIMULATOR.
x-simulate-res: This header should contain a hint for the expected response from the response simulator. It can be any of the options listed in the specific entity tables. If this is not included, the response simulator will default to returning a 200 OK response.
Sample Request Headers:
OTP Scenario:
The FIP's Accounts/link/verify API is the only one that utilizes the OTP received from the customer. This API is responsible for submitting the token/OTP back to the FIP to complete the account linkage process. The Response Simulator is set up to accept a predefined list of OTPs for successful account linkage. If an OTP outside of this list is used, the account linkage will fail. This is the default behavior of the Response Simulator, functioning without the need for the x-simulate-res header.
List of OTPs accepted by Response Simulator
1234 | 123456 | 654321 | 999999 | 223344 | 567890 | 456789 | 234567 | 345678 | 555444 | 222333 |
The sample workflow diagram below illustrates the usage of the valid OTP
The sample workflow diagram below illustrates the usage of the invalid OTP
API Specifications:
AA - Response Simulator:
This AA response simulator will support all the APIs listed under this ReBIT Spec - https://api.rebit.org.in/viewSpec/AA_2_1_0.yaml
API | Expected Response | x-simulate-res Header Options |
---|---|---|
All | 200 OK | Ok |
All | 400 Bad Request | BadRequest |
All | 401 Unauthorized Access | Unauthorized |
All | 404 Not Found | NotFound |
All | 409 Conflict | Conflict |
All | 412 Precondition failed | PreconditionFail |
All | 501 Not Implemented | NotImplemented |
All | 503 Service Unavailable | ServiceUnavailable |
FI/fetch | 403 Forbidden (DataFetchRequestInProgress) | Forbidden |
FI/fetch | 410 Data Gone | DataGone |
All | Timeout Scenario (delay in sending response) | TimeOut |
Sample FI/fetch workflow using AA-SIMULATOR:
FIU Response Simulator
This FIU response simulator will support all the APIs listed under this ReBIT Spec - https://api.rebit.org.in/viewSpec/FIU_2_0_0.yaml
API | Expected Response | x-simulate-res Header Options |
---|---|---|
All | 200 OK | Ok |
All | 400 Bad Request | BadRequest |
All | 401 Unauthorized Access | Unauthorized |
All | 404 Not Found | NotFound |
All | 409 Conflict | Conflict |
All | 412 Precondition failed | PreconditionFail |
All | 501 Not Implemented | NotImplemented |
All | 503 Service Unavailable | ServiceUnavailable |
All | Timeout Scenario (delay in sending response) | TimeOut |
FIP Response Simulator:
This FIP response simulator will support all the APIs listed under this ReBIT Spec - https://api.rebit.org.in/viewSpec/FIP_2_1_0.yaml
API | Expected Response | x-simulate-res Header Options |
---|---|---|
All | 200 OK | Ok |
All | 400 Bad Request | BadRequest |
All | 401 Unauthorized Access | Unauthorized |
All | 404 Not Found | NotFound |
All | 409 Conflict | Conflict |
All | 412 Precondition failed | PreconditionFail |
All | 501 Not Implemented | NotImplemented |
All | 503 Service Unavailable | ServiceUnavailable |
FI/fetch | 403 Forbidden (DataFetchRequestInProgress) | Forbidden |
All | Timeout Scenario (delay in sending response) | TimeOut |
Last updated