The Sandbox is a live simulated non-production environment where you can begin your integration with Tesouro. Unlike the Playground, which provides a full UI to initially explore and learn about our GraphQL schema, the Sandbox is designed for developers ready to start building their actual integration using API calls.
The Sandbox environment uses real API endpoints but with simulated data -
perfect for testing your integration before going to production.
Access
Your organization’s API access key and secret are created by Tesouro and shared with you. To receive access:
-
Have your designated team lead submit your access request here (external site managed by Tesouro)
-
Tesouro will email you an API access key and secret that will require passwordless authentication via email address.
Create and authenticate your JWT
Create a JWT, then add it to the header of your call to query the Tesouro Sandbox environment.
POST /openid/connect/token
curl --location '[https://api.sandbox.tesouro.com/openid/connect/token](https://api.sandbox.tesouro.com/openid/connect/token)' \
--header 'Content-Type: application/x-www-form-urlencoded' \
--data-urlencode 'grant_type=client_credentials' \
--data-urlencode 'client_id=CLIENT_ID' \
--data-urlencode 'client_secret=CLIENT_SECRET'
{
"access_token": "efJhbGcifiJv4zI1NiIsInR5cCI6IkpXVCJ9.eyJ0X2FwaWtleSI6Iml1bm5p9EtYTk1IYjNudGJIZTRZYVVER9JiTT0iLCJ0X29yZ2lkIjoiZWRhMGU5MmItMmRkNS00ZWE2LWI0YjgtZTIyYmRiODVjYjVjIiwidF9wcmVzaWQiOiIwOTUyZmEwMi1hOWUzLTRjMjgtYjEyOC00MTIxODY5MzEwZTQiLCJzY29wZXMiOiJ7fSIsIm5iZiI6MTY4OTk2MjQzNywiZXhwIjoxNjg5OTY0MjM3LCJpYXQiOjE2ODk5NjI0MzcsImlzcyI6Imh0dHBzOi8vYXV0aC50ZXNvdXJvLmNvbSIsImF1ZCI6Imh0dHBzOi8vdGVzb3Vyby5jb20ifQ.M7o-I9Rdb3fjOXsoAmR5NSSbF_Vs2WdHWpenstDLn7M",
"token_type": "Bearer",
"expires_in": 3600
}
curl -X POST \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ADD_TOKEN_HERE" \
-d '{
"query": "query MyOrganization {
organization {
id
businessName
}
}",
"variables": {}
}' \
[https://api.sandbox.tesouro.com/graphql](https://api.sandbox.tesouro.com/graphql)
{
"data": {
"organization": {
"id": "66f41f51-cc83-440b-948f-afe3d4c57406",
"businessName": "Tesouro Docs Playground (Sandbox)"
}
}
}
For production, use https://api.tesouro.com instead of https://api.sandbox.tesouro.com with production credentials
Additional resources
Learn more about JWTs