Country Selection
Calling the right country for your REST API integration
To call the right REST API endpoint, you need to select REST API URL based on the record’s country attribution.
const get_api_url = (country) => `https://${country}-restapi-mt-01.api.incountry.io/`;
Calling the right country for your Web Services integration
As the result, after saving the Web Services endpoint you will get a Web Services URL address through which you need to route requests with regulated data. You need to apply a new request path only to requests that were specified in the Web Services endpoint.
Within your web application, you need to do the following:
-
Create a separate field (for regulated records) that will store the country attribution. Depending on the value within this field, your web application will run a normal flow or a flow to handle records through Web Services and save or query clear-text values to or from InCountry DRaaS.
-
Implement a static function that returns a URL for the request based on the record’s country attribution.
const get_border_url = (country, client_id) => `https://${country}-proxy-mt-01.api.incountry.io/x-inc-${client_id}`;
So, before integration with InCountry DRaaS, your web application was using one URL for the same request, as follows:
GET https://webapplication.com/api/customers/85d117f8-1b1a-11ee-be56-0242ac120002
After integration with InCountry DRaaS, you will have two URLs for request execution:
-
for non-regulated records: a request is executed through the web application’s backend:
GET https://webapplication.com/api/customers/85d117f8-1b1a-11ee-be56-0242ac120002
-
for regulated records: a request is proxied through the Web Services:
GET https://cn-border-incountry.com/x-inc-<UUID>/api/customers/85d117f8-1b1a-11ee-be56-0242ac120002