Sandbox for trying the API
Available
One request gives you a test company with demo data and an API token valid for 24 hours, on CropPath's sandbox server.
The sandbox is a separate CropPath server at https://sandbox-txng.theio.vn, for trying the HTTP API and the SDKs without installing anything. It holds test data only and is fully separate from the live service at https://txng.theio.vn: nothing in the sandbox reaches the live service. Never put real company data or personal data into it.
Create a sandbox account
Send one request, with no body and no credentials. You get a test company of your own and an API token for it:
curl -sS -X POST https://sandbox-txng.theio.vn/v1/sandbox/accounts
# 201 Created
# {"tenant_id": "sbx-q7rk2m4xw5ta3bnc", "api_token": "agt_...", "expires_at": 1791853399.6,
# "base_url": "https://sandbox-txng.theio.vn"}tenant_id: your test company's id (sbx-followed by 16 letters and digits), which is also the tenant an SDK sends in theX-Tenantheader.api_token: an API token (agt_…) with the roletenant_admin, for this company only. It appears in this answer only: store it now.expires_at: when the token expires, in Unix seconds: 24 hours after it was created.base_url: the address to send your next requests to,https://sandbox-txng.theio.vn.
Within a few minutes of the answer, the company is filled with demo data: a packing house, a growing area and its grower, devices, and a lot of 128 measured fruits with its lab results, cartons, seal and shipment. Companies are filled one at a time, so it takes longer when many accounts were created just before yours. Until then, lists such as GET /v1/lots may be empty or incomplete, and the demo lot is listed before the filling ends: wait until the demo lot has the status shipped before you change anything, because recalling it earlier stops the demo data from being added.
Call the API
CROPPATH_TOKEN=agt_... # the api_token of the answer
curl -sS "https://sandbox-txng.theio.vn/v1/lots?limit=10" \
-H "Authorization: Bearer $CROPPATH_TOKEN"The token belongs to one company, so the X-Tenant header is optional; if you send it, it must be your tenant_id (any other value answers 403). Another company's records answer 404, as if they did not exist. The API reference applies; only the address is different.
Use an SDK
The API SDKs take the server's address as their base URL. Give them the sandbox's address, the token and your tenant_id:
TypeScript
const api = createCropPathClient({
baseUrl: "https://sandbox-txng.theio.vn",
token: process.env.CROPPATH_TOKEN!,
tenant: "sbx-q7rk2m4xw5ta3bnc",
});Java
CropPathClient client = CropPathClient.builder()
.baseUrl("https://sandbox-txng.theio.vn")
.apiToken(System.getenv("CROPPATH_TOKEN"))
.tenant("sbx-q7rk2m4xw5ta3bnc")
.build();C#
using var client = new CropPathClient(new CropPathClientOptions
{
BaseUrl = "https://sandbox-txng.theio.vn",
ApiToken = Environment.GetEnvironmentVariable("CROPPATH_TOKEN"),
Tenant = "sbx-q7rk2m4xw5ta3bnc",
});Go
client, err := croppath.New("https://sandbox-txng.theio.vn",
croppath.WithAPIToken(os.Getenv("CROPPATH_TOKEN")),
croppath.WithTenant("sbx-q7rk2m4xw5ta3bnc"))Limits
- The token is valid for 24 hours, then answers 401. To go on, create a new account.
- One IP address may create 5 accounts an hour; beyond that the answer is 429 with a
Retry-Afterheader (the seconds to wait). - Each company is deleted with all its records 7 days after it was created.
- The sandbox holds at most 500 companies at a time. When it is full, creating an account answers 503 with the
codesandbox_full; try again later. - Every company starts with the same demo data, with codes of its own: for example the lot code ends with the first 12 characters of your
tenant_idaftersbx-, in capitals (forsbx-6kvlw4zwnirazpgyit isLO-260928-014-6KVLW4ZWNIRA). UseGET /v1/lotsto find it. - No email address is needed and the sandbox never sends email. It has no sign-in page: use the API token.
- The sandbox has no MQTT broker, so devices and gateways cannot connect over MQTT. Devices you register wait for a platform approval that the sandbox does not give, so their readings count as Self-declared.
- Webhooks follow the same rules as on the live service: the receiving address must be a public
https://address with a valid certificate;localhostand private addresses are refused. The webhook documentwebhooks.md(linked at the end of this page) walks you through trying webhooks with the sandbox.
The sandbox is for testing only: its data is demo data, not real traceability records. Creating an account works only on the sandbox; on the live service, POST /v1/sandbox/accounts answers 404.
In the API reference
Downloads
This portal serves these files: you do not need access to the source repository.