-
Notifications
You must be signed in to change notification settings - Fork 11
Testing the integration
There are multiple ways to test and validate the integration with Swasth's HCX Sandbox environment. As per the HCX Specification, the integration system should expose the Protocol APIs to get the response for a request. So, the integration system should handle the incoming APIs and process the request and generate the response payload and call outgoing APIs.
Base Path for the Sandbox Environment: https://staging-hcx.swasth.app/api
Below are the HCX Protocol API details. These APIs use the HTTP Post
method.
Please use the below participant code to send the requests to Mock Server in Sandbox environment.
Participant | Code |
---|---|
Payer | 1-29482df3-e875-45ef-a4e9-592b6f565782 |
Provider | 1-521eaec7-8cb9-4b6c-8b4e-4dba300af6f4 |
The Postman Collection with standard request payload is available for Payor and Provider use cases. Please use these Postman collections to test and validate the integration. Please update the below variables before accessing the request from the Postman client.
-
host
- Please use the Sandbox environment base path in the environment variable to access the APIs. -
Authorization
- Please use the Token Generate API to generate the access token and update it in Postman Client.
The integration system should enable the APIs as per the HCX Specification to get the callbacks (responses). It should be able to understand and handle all the possible requests from the incoming APIs. The below sections will be helpful to test and validate Incoming APIs.
The above section has the Sandbox environment details. Please use them to test the integration with HCX Sandbox. There are two ways to test and validate the integration.
Then integration system enables the APIs as per the HCX Specification to the callbacks for the requests. Swasth's sandbox environment has a Mock service to help with the integration testing and validation.
While making the API call to Mock service, include the below test headers to define and get the expected object in the incoming API.
Below are the test headers defined for the Protocol headers to expect the given input in callback API.
-
x-hcx-debug_flag_test
forx-hcx-debug_flag
-
x-hcx-status_test
forx-hcx-status
-
x-hcx-error_details_test
forx-hcx-error_details
-
x-hcx-debug_details_test
forX-hcx-debug_details
-
x-hcx-test_random
- This header will be used to simulate a random response.- The accepted value for this header are
true
orfalse
.
- The accepted value for this header are
Once all the possible scenarios are tested and validated with mock, use the below section details to test it with the actual counterparty.
To test and validate the incoming API call with the actual counterparty, integration system details (encryption_cert
, endpoint_url
etc,.) should be updated in the Sandbox participant registry.
Once the registry is updated with the participant details, the request payload with x-hcx-recipent_code
having your identifier will be sent to the integration system API service.
The integration system should test and validate the request payload created to use for outgoing APIs. The below sections will help to check the same.
The above section has the Sandbox environment details. Please use them to test the integration with HCX Sandbox. There are two ways to test and validate the integration.
Configure the Mock service base path to send the Outgoing API call to test and validate the API requests. The Mock server will help in creating the valid request payload with Protocol headers and processing the response.
Configure the Sandbox environment base path to send the Outgoing API call to test and validate the API requests. Please follow the below steps to create the request payload for any counterparty in the sandbox environment.
- Use the username and password to generate the API access token.
- Call the Participant list API to get the details of the required participant.
- Use the selected participant public key to encrypt and generate the request payload as per the HCX Protocol API Specification.
- Make the API call to the Sandbox environment by providing the
x-hcx_sender_code
as the selected participant id.