Unified.to
Blog

How to test unified APIs using Sandbox connections


December 6, 2023

Sometimes, as a developer, you'll want to test the configuration of an integration and simulate creating a user connection without having to add it to your application. Unified.to's Sandbox environment is a great option for doing this. This guide explains how to use our Sandbox environment to test pre-built integrations using Sandbox data. You'll be able to read and write data to any integration. To ensure data accuracy, we'll always return data in the format that the integration supports.

What is a Sandbox environment?

A Sandbox environment within our unified API platform is a secure and isolated space where you can experiment, test, and refine integrations without affecting live data or operations. It mirrors the production environment, allowing you to simulate real-world scenarios, assess the functionality of the integrations, and troubleshoot potential issues in a risk-free setting. By providing a controlled space for experimentation, our Sandbox environment makes it easy to walk through the entire implementation process before deploying to a live environment.

Types of Sandbox testing for integrations

Sandbox testing includes techniques like:

  • Activate all integration types (API-key based and OAuth 2)
  • Create a user connection with a dummy API key (for API-key based integrations)
  • Test calling the unified API with the Sandbox user connection
  • Read and write with Sandbox data

What you should not test in a Sandbox environment

In some cases, it's better to test in production:

  • If you would like to test the true authorization of an OAuth 2 integration, you'll need to generate an authentic Client ID and Client Secret
  • Authorizing an OAuth 2 integration and creating an authentic user connection
  • Getting actual data from the unified API using a non-Sandbox connection

How to add or reset your Sandbox

  • Activate any integration (in Sandbox env) to populate sandbox data
  • Deactivate an integration to remove all sandbox data for this integration
  • Sandbox data is separated by integration type, but is shared across all connections for the same integration. For example, all Salesforce sandbox connections will be accessing the same sandbox data.

Prerequisites

Before you can use our Sandbox environment, create your Unified.to account. Sandbox environments can be accessed on our Tester plan, which also has an allotted 2,500 free API requests.

Testing integrations in a Sandbox environment

  1. Once logged in, navigate to Settings and select Embed. This will automatically redirect you to the Authorization tab, where you can configure and preview your user authorization experience.
  2. In the right hand corner of the page, switch your environment from Production to Sandbox.
  3. Navigate to Integrations > Active Integrations and select an API key integration to activate. Any integrations you activate will automatically appear in your user authorization embed and preview. Return to the Authorization embed page (Settings > Embed > Authorization).
  4. Create a user connection by selecting one of your activated integrations and follow the authorization steps.
  5. You'll be automatically redirected to Integrations > User Connections. Copy the ID from the connection that you created.
  6. Use that connection to call the unified API. It will respond with mock data for that connection because it's a Sandbox connection. The mock data will only return fields that the integration supports.
    curl --request GET \
      --url 'https://api.unified.to/hris/6570b080c5c932b916c5d288/employee' \
      --header 'accept: application/json' \
      --header 'authorization: YOUR_API_TOKEN'
    

Deployment and release

Once you've efficiently tested integrations and user connections in the Sandbox environment, switch back to Production or any non-Sandbox environment to begin activating integrations, creating real user connections and getting real data via our unified APIs.

As always, reference our documentation for further details, chat with us on Discord, or contact us to request a dedicated Slack channel for your team.

Blog