API Sandbox
The API Sandbox allows you to simulate API responses without incurring charges or impacting your live data. By simply setting sandbox.trustfull.com, your API calls, you can test your integration with our Onboarding Solution and other products in a controlled environment.
This feature helps you validate requests, experiment with different scenarios, and understand how our APIs respond under various conditions.
How it works
To use the sandbox feature:
- Replace the endpoint with sandbox.trustfull.com.
- Ensure you include an active API key in the request.
- Send a formally correct request with the required payload (as it will be validated as an actual request).
- Use the customer_id to simulate specific scenarios:
- high: Simulates a response containing a very positive score.
- good: Simulates a response containing a positive score.
- moderate: Simulates a response containing a moderate score.
- bad: Simulates a response containing a negative score.
- poor: Simulates a response containing a very negative score.
In case you can't change the customer_id, you can use any other field to select the scenario. Fields allowed for this logic are first_name, phone_number, email, domain->value, and ip.
Test different products or solutions
In case you want to receive a score for a specific product (email, phone, name, domain) or for a solution (onboarding) you'll need to create a correctly formatted request and then pass the demo parameter.
Depending on the product combination, the sandbox will produce the correct response with the requested score cluster.
If you want to test how the API handles bad requests, you can send an intentionally invalid payload.
Examples
curl --request POST \
--url https://sandbox.trustfull.com/1.0/hub \
--header 'Accept: application/json' \
--header 'Content-Type: application/json' \
--header 'x-api-key: [your_app_key]' \
--data '
{
"customer_id": "good",
"claims": [
"phone",
"email",
"name",
"score"
],
"phone_number": "39349xxxxxxx",
"email": "t***@trustfull.com",
"first_name": "Tony",
"last_name": "Stark"
}'
curl --request POST \
--url https://sandbox.trustfull.com/1.0/hub \
--header 'Accept: application/json' \
--header 'Content-Type: application/json' \
--header 'x-api-key: [your_app_key]' \
--data '
{
"customer_id": "bad",
"claims": [
"phone",
"email",
"name",
"score"
],
"phone_number": "39349xxxxxxx",
"email": "t***@trustfull.com",
"first_name": "Tony",
"last_name": "Stark"
}'
curl --request POST \
--url https://sandbox.trustfull.com/1.0/hub \
--header 'Accept: application/json' \
--header 'Content-Type: application/json' \
--header 'x-api-key: [your_app_key]' \
--data '
{
"customer_id": "moderate",
"claims": [
"phone"
],
"phone_number": "39349xxxxxxx"
}'
curl --request POST \
--url https://sandbox.trustfull.com/1.0/hub \
--header 'Accept: application/json' \
--header 'Content-Type: application/json' \
--header 'x-api-key: [your_app_key]' \
--data '
{
"customer_id": "your_real_autogenerated_customer_id",
"claims": [
"phone",
"email",
"name",
"score"
],
"phone_number": "39349xxxxxxx",
"email": "t***@trustfull.com",
"first_name": "bad",
"last_name": "bad"
}'
Replace your_app_key
with your active API key and customize the payload as needed for your use case
FAQ
I can't change the customer_id in the request is it's auto-generated how can i select the correct scenario?
You can also use other fields if you can't change the customer id. Try setting "bad" as a value for the "first_name" field. You can do the same with all other fields as well such as
"phone_number": "bad"
or even"email":"bad".
I can't change the endpoint how can i activate the sandbox?
In case you can't change the endpoint you can still activate the sandbox by setting the following header:
"demo": 1
this will set the api in sandbox mode even if you use the production endpoint.
The scenario i'm looking for is not in the list
We support 5 default scenarios that are connected to our 5 score cluster. You can reach out to [email protected] if need additional scenarios and we'll evaluate if the scenario can be useful for all customers.
Updated 14 days ago