InCountry logo
mobile-nav
Search
  • Products
    • Products
      • InCountry for Salesforce
      • Data Residency-as-a-Service
      • Alibaba Cloud InCountry Service
      • Compliance and security
    • Gateways
      • Email
      • Payment Vault
      • Web Forms
      • HTML
    • Developers
      • REST API
      • SDK
  • Solutions
    • Automotive
    • Energy
    • Financial services
    • Healthcare
    • Retail
    • Technology
    • Latest success story
      • IBM Consulting
  • Integrations
    • Cegid
    • Intertrust
    • MuleSoft
    • PayPal
    • Salesforce
    • ServiceNow
    • Stripe
    • Veeva Systems
    • Yandex
  • Resources
    • Country compliance
    • Documentation
    • Library
    • Partners
    • Pricing
  • About
    • News and Blog
    • Careers
    • Contact Us
    • FAQ
    • Leadership
  • Login
  • Schedule a Demo

›REST API

Home
  • InCountry Platform
Portal
  • Getting started
  • Documentation
    • Dashboard
    • Managing environments
    • Managing SDK credentials and services
    • Managing Border configuration
    • Managing payment vaults
    • Managing email gateways
    • Managing resident functions
    • Managing file imports
    • Managing profile and organization
    • Managing users
    • Managing encryption keys
  • Release notes
Border
  • Documentation
  • Release notes
REST API
  • Documentation
  • How to test CRUD requests through REST API
  • Release notes
POP API
  • Documentation
  • Release notes
Resident Functions
  • Documentation
Salesforce
  • About
  • Overview
  • Quick start guide for three-model package
  • Quick start guide for legacy package
  • Administrator's guide
    • Managing the package
    • Managing permissions
    • Managing OAuth2 authentication and authorization
    • Managing certificates
    • Registering CSP Trusted Sites
    • Managing InCountry Endpoints
    • Managing REST endpoints
    • Managing InCountry flags
    • Loading the application
    • Managing data regulation policies
    • Managing protected fields
    • Hashing the UserName field
    • Managing custom objects
    • Replacing standard elements
    • Configuring record search
    • Managing components
    • Managing web components
    • Setting up Salesforce Experience Cloud
    • Managing resident functions
    • Managing InCountry cache
    • Managing Apex triggers
    • Managing record synchronization
    • Managing web forms
    • Tracking changes to data regulation policies and regulated fields
    • Using formula fields
    • Using frontend validations
    • Using Email-to-Case feature
    • Debugging
    • Migrating data from one Salesforce organization to another
  • Developer’s guide
    • Apex SDK
    • JavaScript API
    • Retrieving record statistics
    • Tracking field history
  • User's guide
    • Working with protected fields
    • Sending compliant email messages
    • Importing data into Salesforce
    • Migrating records
    • Managing audit reports
    • Converting leads
    • Managing reports
    • FAQ
    • Release notes
Payment Vault
  • Documentation
BYOK
  • Documentation
FAQ
  • Get started with the platform
  • Integration options
  • Data regulation models
  • Limits and quotas
  • Video tutorials
Service Status
  • Status

How to test CRUD requests through REST API

Prerequisites

  1. Register on InCountry Portal at https://portal.incountry.com/login.

  2. Create a new REST API integration.

  3. Copy details of the REST API integration, as follows:

    1. Environment ID

    2. Client ID

    3. Client Secret

    4. REST API address

      REST API integration

  4. Download the Postman collection.

  5. Load the request collection into Postman.

Creating an access token

tip

To find out the appropriate OAuth server (authorization endpoint) for you country, please check this page.

  1. Within the Postman collection, locate and select the Authorization request.

  2. Enter the address of the authorization endpoint:

    1. EMEA: https://auth-emea.incountry.com/oauth2/token

    2. APAC: https://auth-apac.incountry.com/oauth2/token

  3. In the Username box, enter the Client ID you received on InCountry Portal.

  4. In the Password box, enter the Client Secret you received on InCountry Portal.

    Authorization request

  5. Switch to the Body tab.

    Body parameters

  6. Define the body parameters, as follows:

    • grant_type - enter client_credentials. This value is already specified in the collection you loaded.

    • audience - enter the address of the REST API endpoint that you received on InCountry Portal. Add the address of the point-of-presence in addition to the REST API endpoint. For example, the address of the REST API endpoint you received is https://id-restapi-mt-01.api.incountry.io. Within this URL, remove the -restapi part, so the point-of-presence will be https://id-mt-01.api.incountry.io. You need to add these two addresses separated with a space, as follows: https://id-restapi-mt-01.api.incountry.io https://id-mt-01.api.incountry.io. Please consider that for each country, the REST API endpoint address will vary, as well as the point-of-presence.

    • scope - enter the environment ID you received on InCountry Portal.

    warning

    Please consider that the authorization token expires every 300 seconds. You need to re-generate a new token regularly.

  7. Click Send. Upon successful execution of the request, you will get the authorization token in the response.

Creating a new record

  1. Within the Postman collection, locate and select the Create a record request.

  2. Enter the address of the REST API endpoint instead of the {{DEMO_URL}} snippet.

  3. Switch to the Body tab, then select raw.

    Select raw

  4. Enter the body request with the record data, as follows. For the country parameter, enter the country code. For example, your REST API endpoint is attributed to Sweden, use se.

    {
      "country": "id",
      "key": "eternals",
      "record_key": "eternals",
      "body": "{ firstName: 'Marvel', lastName: 'Comics'}",
      "key1": "eternals"
    }
    
  5. Switch to the Authorization tab.

  6. In the Type box, select Bearer Token.

  7. In the Token box, enter the authorization token you get in the Authorization request.

  8. Click Send. Upon successful execution of the request, a new record will be created on the InCountry platform.

Creating multiple records

  1. Within the Postman collection, locate and select the Create batch request.

  2. Enter the address of the REST API endpoint instead of the {{DEMO_URL}} snippet.

  3. Switch to the Body tab, then select raw.

  4. Enter the body request with the record data, as follows. For the country parameter, enter the country code. For example, your REST API endpoint is attributed to Sweden, use se.

    {
        "country": "id",
        "records": [
            {
                "record_key": "superman",
                "body": "{firstName: 'Tony', lastName: 'Stark'}",
                "range_key1": 1001,
                "key1": "'Tony'"
            },
            {
                "record_key": "batman",
                "body": "{firstName: 'Gemma', lastName: 'Chan'}",
                "range_key1": 1002,
                "key1": "'Gemma'"
            }
        ]
    }
    
  5. Switch to the Authorization tab.

  6. In the Type box, select Bearer Token.

  7. In the Token box, enter the authorization token you get in the Authorization request.

  8. Click Send. Upon successful execution of the request, multiple records will be created on the InCountry platform.

Finding a specific record

  1. Within the Postman collection, locate and select the Find records request.

  2. Enter the address of the REST API endpoint instead of the {{DEMO_URL}} snippet.

  3. Switch to the Body tab, then select raw.

  4. Enter the body request with the record data, as follows. For the country parameter, enter the country code. For example, your REST API endpoint is attributed to Sweden, use se.

    {
        "country": "id",
        "filter": {
            "key1": "'Tony'"
        },
        "options": {
            "limit": 10,
            "offset": 0
        }
    }
    
  5. Switch to the Authorization tab.

  6. In the Type box, select Bearer Token.

  7. In the Token box, enter the authorization token you get in the Authorization request.

  8. Click Send. Upon successful execution of the request, you will see information about the created record on the InCountry platform.

Deleting a specific record

  1. Within the Postman collection, locate and select the Delete a record request.

  2. Enter the address of the REST API endpoint instead of the {{DEMO_URL}} snippet.

  3. Replace the ae snippet with the actual country code.

  4. Replace the :recordKey snippet with the record key you created on the InCountry platform.

    Replace the record key

  5. Switch to the Authorization tab.

  6. In the Type box, select Bearer Token.

  7. In the Token box, enter the authorization token you get in the Authorization request.

  8. Click Send. Upon successful execution of the request, the created record will be removed on the InCountry platform.

Attaching a file

  1. Within the Postman collection, locate and select the Attach file request.

  2. Enter the address of the REST API endpoint instead of the {{DEMO_URL}} snippet.

  3. Replace the ae snippet with the actual country code.

  4. Replace the :recordKey snippet with the key of the record which an uploaded file will be mapped to on the InCountry platform.

  5. Switch to the Body tab, then select form-data.

    Select form-data

  6. For the file parameter, click Select Files and select the attachment you want to upload.

  7. Switch to the Authorization tab.

  8. In the Type box, select Bearer Token.

  9. In the Token box, enter the authorization token you get in the Authorization request.

  10. Click Send. Upon successful execution of the request, the file will be attached to the record on the InCountry platform. Within the response, you will get the identifier of the attached file.

Downloading an attached file

  1. Within the Postman collection, locate and select the Attach file request.

  2. Enter the address of the REST API endpoint instead of the {{DEMO_URL}} snippet.

  3. Replace the ae snippet with the actual country code.

  4. Replace the :recordKey snippet with the key of the record which an uploaded file is mapped to on the InCountry platform.

  5. Replace the :fileId snippet with the file identifier you received when attached a file.

    Replace the fileID

  6. Switch to the Authorization tab.

  7. In the Type box, select Bearer Token.

  8. In the Token box, enter the authorization token you get in the Authorization request.

  9. Click Send. Upon successful execution of the request, the file will be downloaded from the InCountry platform.

Deleting an attached file

  1. Within the Postman collection, locate and select the Attach file request.

  2. Enter the address of the REST API endpoint instead of the {{DEMO_URL}} snippet.

  3. Replace the ae snippet with the actual country code.

  4. Replace the :key snippet with the key of the record which an uploaded file is mapped to on the InCountry platform.

  5. Replace the :fileId snippet with the file identifier you received when attached a file.

    Replace the fileID

  6. Switch to the Authorization tab.

  7. In the Type box, select Bearer Token.

  8. In the Token box, enter the authorization token you get in the Authorization request.

  9. Click Send. Upon successful execution of the request, the file will be deleted from the InCountry platform.

← DocumentationRelease notes →
  • Prerequisites
  • Creating an access token
  • Creating a new record
  • Creating multiple records
  • Finding a specific record
  • Deleting a specific record
  • Attaching a file
  • Downloading an attached file
  • Deleting an attached file
InCountry logo blue
© InCountry 2022.
All rights reserved. InCountry, Inc
  • PRIVACY POLICY
  • TERMS OF SERVICE
  • Social share
    • YouTube logo
    • Facebook logo
    • Twitter logo
    • LinkedIn
  • Column 1
    • Products
      • Products
        • InCountry for Salesforce
        • Data Residency-as-a-Service
        • Alibaba Cloud InCountry Service
        • Compliance and security
      • Gateways
        • Email
        • Payment Vault
        • Web Forms
        • HTML
      • Developers
        • REST API
        • SDK
  • Column 2
    • Solutions
      • Automotive
      • Energy
      • Financial services
      • Healthcare
      • Retail
      • Technology
    • Integrations
      • Cegid
      • Intertrust
      • MuleSoft
      • PayPal
      • Salesforce
      • ServiceNow
      • Stripe
      • Veeva Systems
      • Yandex
  • Column 3
    • Resources
      • Country compliance
      • Documentation
      • Library
      • Partners
      • Pricing
    • About
      • News and Blog
      • Careers
      • Contact Us
      • FAQ
      • Leadership