Sandbox

All endpoints

The sandbox’s scenarios and forced errors

GET/api/v1/test/scenarios

Key
Test key only (404 for any other)
Scope
None

Test keys only; a live key gets 404. Pass a scenario as ?scenario=<name> on any read, and ?force_error=<code> to get that error.

Answer, 200

  • scenariosarray of object

    Every scenario

    2 fields in scenarios
    • namestring

      Pass it as ?scenario=<name>

    • descriptionstring

      What the sandbox answers in it

  • forceErrorsarray of object

    Every error code force_error can produce

    2 fields in forceErrors
    • codestring

      Pass it as ?force_error=<code>

    • statusinteger

      The HTTP status it answers with

Errors

  • 404
    not_found

    Nothing at that address, or another team’s match or application (so their existence does not leak).

And any request (4) to GET /test/scenarios
  • 429
    rate_limited

    Over the per-minute limit for the key or the address. Wait for Retry-After.

  • 429
    daily_limit

    A personal or test key used its requests for the day.

  • 429
    too_many_bad_keys

    Too many wrong keys from one address. Wait for Retry-After.

  • 500
    internal_error

    A fault on the league’s side. Try again later.

Request, curl
curl "https://gwl.gg/api/v1/test/scenarios" \
  -H "Authorization: Bearer $GWL_API_KEY"
Example answer, 200
{
  "scenarios": [
    {
      "name": "default",
      "description": "Test Team with 8 members, 2 upcoming and 3 recent matches, 2 applications and 2 open slots. Used when no scenario is given."
    },
    {
      "name": "empty-team",
      "description": "A team made today: only its Team Leader, no matches, applications, slots or Elo history, and no rank."
    },
    {
      "name": "busy-week",
      "description": "A busy week: 7 upcoming and 4 recent matches (one disputed), 6 applications and 5 open slots."
    },
    {
      "name": "full-roster",
      "description": "The default team with a full roster of 32."
    },
    {
      "name": "errors",
      "description": "Every call answers an error: the one named by force_error, or internal_error without it."
    }
  ],
  "forceErrors": [
    {
      "code": "invalid_request",
      "status": 400
    },
    {
      "code": "invalid_json",
      "status": 400
    },
    {
      "code": "missing_key",
      "status": 401
    },
    {
      "code": "invalid_key",
      "status": 401
    },
    {
      "code": "key_revoked",
      "status": 401
    },
    {
      "code": "key_expired",
      "status": 401
    },
    {
      "code": "missing_scope",
      "status": 403
    },
    {
      "code": "scope_lost",
      "status": 403
    },
    {
      "code": "wrong_key_type",
      "status": 403
    },
    {
      "code": "team_suspended",
      "status": 403
    },
    {
      "code": "key_maker_left",
      "status": 403
    },
    {
      "code": "key_maker_no_access",
      "status": 403
    },
    {
      "code": "not_found",
      "status": 404
    },
    {
      "code": "method_not_allowed",
      "status": 405
    },
    {
      "code": "invalid_id",
      "status": 400
    },
    {
      "code": "already_on_roster",
      "status": 409
    },
    {
      "code": "on_other_team",
      "status": 409
    },
    {
      "code": "roster_write_limit",
      "status": 429
    },
    {
      "code": "player_not_found",
      "status": 404
    },
    {
      "code": "leader_cannot_be_removed",
      "status": 409
    },
    {
      "code": "rep_cannot_be_removed_by_api",
      "status": 409
    },
    {
      "code": "role_above_you",
      "status": 403
    },
    {
      "code": "cannot_remove",
      "status": 409
    },
    {
      "code": "application_closed",
      "status": 409
    },
    {
      "code": "already_member",
      "status": 409
    },
    {
      "code": "already_on_team",
      "status": 409
    },
    {
      "code": "steam_required",
      "status": 409
    },
    {
      "code": "league_suspended",
      "status": 409
    },
    {
      "code": "leads_suspended_team",
      "status": 409
    },
    {
      "code": "roster_conflict",
      "status": 409
    },
    {
      "code": "body_too_large",
      "status": 413
    },
    {
      "code": "unsupported_media_type",
      "status": 415
    },
    {
      "code": "rate_limited",
      "status": 429
    },
    {
      "code": "daily_limit",
      "status": 429
    },
    {
      "code": "too_many_bad_keys",
      "status": 429
    },
    {
      "code": "internal_error",
      "status": 500
    },
    {
      "code": "public_api_off",
      "status": 503
    }
  ]
}

Forget this test key’s answers to applications

POST/api/v1/test/reset

Key
Test key only (404 for any other)
Scope
None

Test keys only; a live key gets 404. The sandbox also forgets them by itself 10 minutes after the first answer.

Answer, 200

  • resetboolean

    Always true

Errors

  • 404
    not_found

    Nothing at that address, or another team’s match or application (so their existence does not leak).

And any request (4) to POST /test/reset
  • 429
    rate_limited

    Over the per-minute limit for the key or the address. Wait for Retry-After.

  • 429
    daily_limit

    A personal or test key used its requests for the day.

  • 429
    too_many_bad_keys

    Too many wrong keys from one address. Wait for Retry-After.

  • 500
    internal_error

    A fault on the league’s side. Try again later.

Request, curl
curl -X POST "https://gwl.gg/api/v1/test/reset" \
  -H "Authorization: Bearer $GWL_API_KEY"
Example answer, 200
{
  "reset": true
}