View as Markdown

API reference / Native /v1

Sandbox

Native /v1. Generated from the OpenAPI document the services export (/openapi.json).

Samples use the placeholders YOUR_API_KEY and YOUR_ACCOUNT_ID. Paste a sandbox key (twsk_…) to fill them in and to use Try it. It stays in this browser tab and is only sent to the sandbox, never to the live API.

Try it is off in this build: No sandbox URL is configured for this build of the docs.

GET /v1/sandbox

Sandbox Info Auth: X-API-Key

Public description of the sandbox; no key needed. {sandbox: true, server, keyPrefix, maxAccounts, signup, magicLogins: [{login, scenario}]}. signup says whether anonymous sign-up is open; each magic login, used as the account login on the sandbox server, plays its scenario (see the Sandbox guide).

Responses

  • 200 Successful Response

Errors (common for this kind of call; every error uses one envelope)

curl

curl -sS -X GET 'https://api.tickwire.io/v1/sandbox' \
  -H 'X-API-Key: YOUR_API_KEY'

Python

from tickwire import Tickwire

with Tickwire("https://api.tickwire.io", "YOUR_API_KEY") as tw:
    result = tw.request(
        "GET",
        "/v1/sandbox",
    )
    print(result)

TypeScript

import { TickwireClient } from "@tickwire/sdk";

const tw = new TickwireClient({ baseUrl: "https://api.tickwire.io", token: "YOUR_API_KEY" });
const result = await tw.request("GET", "/v1/sandbox");
console.log(result);
tw.close();
Try it in the sandbox

Try it is off in this build of the docs: no sandbox URL is configured. The samples above work against the sandbox with your sandbox key.

POST /v1/sandbox/keys

Create Key Idempotency-Key Auth: X-API-Key

A twsk_ key for the caller's sandbox (linked to a live tenant). Idempotency-Key is honoured: a replay mints nothing and answers apiKey: null with an apiKeyNotice.

Parameters of POST /v1/sandbox/keys
ParameterInTypeDescription
Idempotency-Keyheaderstring | null

Request body KeyBody | null

Responses

Errors (common for this kind of call; every error uses one envelope)

curl

curl -sS -X POST 'https://api.tickwire.io/v1/sandbox/keys' \
  -H 'X-API-Key: YOUR_API_KEY' \
  -H 'Idempotency-Key: my-request-1' \
  -H 'Content-Type: application/json' \
  -d '{"name":"sandbox"}'

Python

from tickwire import Tickwire

with Tickwire("https://api.tickwire.io", "YOUR_API_KEY") as tw:
    result = tw.request(
        "POST",
        "/v1/sandbox/keys",
        json={"name": "sandbox"},
        idempotency_key="my-request-1",
        reason="why you are doing this",
    )
    print(result)

TypeScript

import { TickwireClient } from "@tickwire/sdk";

const tw = new TickwireClient({ baseUrl: "https://api.tickwire.io", token: "YOUR_API_KEY" });
const result = await tw.request("POST", "/v1/sandbox/keys", {
  body: {"name":"sandbox"},
  idempotencyKey: "my-request-1",
  reason: "why you are doing this",
});
console.log(result);
tw.close();
Try it in the sandbox

Try it is off in this build of the docs: no sandbox URL is configured. The samples above work against the sandbox with your sandbox key.

POST /v1/sandbox/signup

Signup Auth: X-API-Key

Anonymous sandbox sign-up: a sandbox, a restricted twsk_ key and one deployed account (login 1000, server Tickwire-Sandbox). Body (optional): {"platform": "mt5"|"mt4"}. 201 {sandbox: true, restricted: true, tenantId, apiKey, account: {id, platform, server, login, state, connectionStatus}}. The key is shown once. A restricted key may manage its accounts, trade, stream and read; anything else that changes state (webhooks, pre-trade hooks, agent keys, more keys or tokens) answers 403 sandbox_key_restricted. Sign-ups are limited per client address (5 an hour, 10 a day) and in total; over a limit, 429 rate_limited with Retry-After. 403 forbidden when sign-up is turned off. Anonymous sandboxes unused for 7 days are deleted.

Request body SandboxSignupBody | null

Responses

Errors (common for this kind of call; every error uses one envelope)

curl

curl -sS -X POST 'https://api.tickwire.io/v1/sandbox/signup' \
  -H 'X-API-Key: YOUR_API_KEY' \
  -H 'Content-Type: application/json' \
  -d '{"platform":"mt5"}'

Python

from tickwire import Tickwire

with Tickwire("https://api.tickwire.io", "YOUR_API_KEY") as tw:
    result = tw.request(
        "POST",
        "/v1/sandbox/signup",
        json={"platform": "mt5"},
        idempotency_key="my-request-1",
        reason="why you are doing this",
    )
    print(result)

TypeScript

import { TickwireClient } from "@tickwire/sdk";

const tw = new TickwireClient({ baseUrl: "https://api.tickwire.io", token: "YOUR_API_KEY" });
const result = await tw.request("POST", "/v1/sandbox/signup", {
  body: {"platform":"mt5"},
  idempotencyKey: "my-request-1",
  reason: "why you are doing this",
});
console.log(result);
tw.close();
Try it in the sandbox

Try it is off in this build of the docs: no sandbox URL is configured. The samples above work against the sandbox with your sandbox key.