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 sandbox | Means |
|---|---|
| Credentials | Integrations, with keys that reach the sandbox only: see Get API credentials |
| Webhook endpoints | Their own addresses and signing secrets, so test deliveries go to your test receiver |
| Access codes | Batches and codes of its own, for your testers |
| Members | Only 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
- Create a webhook endpoint for your test receiver.
- Order a batch of a few codes and read them.
- Give one code's
redeem_urlto a tester. They redeem it in the YOU(th) app as a customer would, with an account in your sandbox. - Check that your receiver got
AccessCode.redeemedand stored the time. - End its access with
ends_atleft out, and check that your receiver gotAccess.endedand that the tester's app shows it. - Stop your receiver, have a second code redeemed, and catch up from the list.
Go live
- In your live organization, create an integration and a webhook endpoint.
- Give your production backend the live client id, key id, private key and signing secret.
- Check
GET /v1/organization:organization.aliasis your live one. - Order your first live batch.
Ask your YOU(th) contact for a sandbox when you start.