Docs
Contact

Sandbox

Build and test in a second organization of yours, which only your own testers join.

Any organization can be used for testing. A sandbox is simply a second organization of yours that you keep for it: same hosts, same routes, same events and signatures as your live one. You decide who joins it.

What makes an organization live is your agreement with YOU(th): the codes and limits you agreed are set on your live organization. A sandbox keeps the defaults every new organization starts with.

What a sandbox has of its own

Yours in the sandboxMeans
CredentialsIntegrations, with keys that reach the sandbox only: see Get API credentials
Webhook endpointsTheir own addresses and signing secrets, so test deliveries go to your test receiver
Access codesBatches and codes of its own, for your testers
MembersOnly the people you gave a sandbox code to

Going live changes your credentials, your signing secret and your receiver's address, and no code of yours.

Know where you are

An integration belongs to one organization. Ask which:

curl https://api.youth-platform.io/v1/organization \  --header "Authorization: Bearer $YOUTH_ACCESS_TOKEN"
{  "organization": { "alias": "example-mobile-sandbox", "name": "Example Mobile (sandbox)" },  "integration": {    "id": "0193b1a0-52c4-7b1e-a2d3-4f5a6b7c8d9e",    "name": "Billing backend (test)",    "scopes": ["access_codes:read", "access_codes:write", "webhooks:write"]  }}

It is also the quickest check that your credentials work. Have your test systems refuse to start when organization.alias is not your sandbox.

A whole run

  1. Create a webhook endpoint for your test receiver.
  2. Order a batch of a few codes and read them.
  3. Give one code's redeem_url to a tester. They redeem it in the YOU(th) app as a customer would, with an account in your sandbox.
  4. Check that your receiver got AccessCode.redeemed and stored the time.
  5. End its access with ends_at left out, and check that your receiver got Access.ended and that the tester's app shows it.
  6. Stop your receiver, have a second code redeemed, and catch up from the list.

Go live

  1. In your live organization, create an integration and a webhook endpoint.
  2. Give your production backend the live client id, key id, private key and signing secret.
  3. Check GET /v1/organization: organization.alias is your live one.
  4. Order your first live batch.

Ask your YOU(th) contact for a sandbox when you start.

Last updated