Retrieving Record Statistics
You can use the InCountry REST API to retrieve the record statistics about the Salesforce objects. For example, you can find how many regulated records of the Account type are stored on the InCountry platform.
Prerequisites
The *.JKS
certificate that is currently used for the operation of the InCountry Data Residency package will not be appropriate for this operation.
-
You need to acquire the .CRT and .KEY certificate files from the InCountry team for your production or sandbox instances. If you do not already have these two files, please request them from the InCountry team.
-
Postman is installed on your desktop.
Please be careful when sharing your InCountry production certificates. These certificates grant full read/write access to your data records stored on the InCountry platform.
Retrieving Record statistics
-
Open Postman.
-
Copy this link to the Postman collection to your clipboard: https://www.getpostman.com/collections/702ed0584b9ff9e17fcd
-
On the menu, select File, then click Import.
-
In the Import form, select the Links tab.
-
In the Enter a URL box, paste your link to the Postman collection.
-
Click Continue, then click Import.
-
The imported collection appears in the Collections section.
-
Select the imported collection and switch to the Variables tab.
-
Copy the InCountry Rest API endpoint to the clipboard. You can find out your current REST API endpoint in the Salesforce org where the InCountry Data Residency package is installed. Then navigate to Setup > Custom Metadata Types > InCountryRestApiEndpoint > Manage Records > [country code].
-
Paste your endpoint into the
endpoint
environment variable and save the collection. -
Ensure that other variables are set as follows:
requestNumber=1
offset=0
limit=100
totalRecords=1
-
Navigate to Settings.
-
In the Settings form, select the Certificates tab.
-
In the Host box, paste your endpoint address.
-
Add the imported InCountry Rest API certificates. Click Select File and select your
.CRT
and.KEY
certificate files in the corresponding boxes. -
Save the certificate and close the Settings form.
-
Within the collection, locate and select the
Find records
request. -
Within the opened request, switch to the Body tab.
-
Within the request body, locate the country parameter and correct it to the ISO code of the country where regulated data records are stored.
-
Switch to the Tests tab. There you can find a JavaScript script that aggregates information about data records stored on the InCountry platform in a particular country. You can modify this script depending on your needs.
-
On the menu, select View, then click Show Postman Console. After the script execution, results will be outputted to the Postman console.
-
To capture the information, open the collection and click Run. The Runner tab opens.
-
On the Runner tab, click Run InCountry Rest API.
-
In the Postman console, you will see the debug information about requests to the InCountry Rest API.
-
Once the script execution has been completed, you will see the aggregated results on the Environment tab. The Variable name represents the Salesforce object type. For example,
001
is a Salesforce Account (4147 Accounts are stored on the InCountry platform according to the image below). You can find the prefixes for standard Salesforce objects at this resource (actually it always includes the first 3 characters of yourrecord Id
). -
You can modify the script to print additional information about your data records. For example, lines 28-30 in the screenshot below print identifiers of regulated Account records to the Postman console.
if (prefix === '001') {
console.log('Regulated account Id = ' + record.profile_key);
} -
You will see the output in the Postman console.
-
If necessary, you can export the output results to a file. Click Export results.