Send plugin command (JSON)
POST /api/v2/MT4/{tradePlatform}/ExternalCommandJSON
Plugin custom-command channel with JSON payload in both directions.
Manager (live) call wrapping ExternalCommandJSON. The MT4
server forwards the body to whichever installed plugin claims the
command first; the first plugin returning RET_OK wins and its
response becomes the v2 payload. The request body is sent verbatim
(no field renaming, no schema enforcement) so the plugin author
owns the over-the-wire contract on both ends.
The wrapper trio (ExternalCommand<TIn,TOut> for binary
marshal, ExternalCommandCustom<T> for caller-supplied
serializer) is intentionally not exposed in v2 — those variants
require compile-time struct layouts shared between client and
plugin, which a REST surface cannot guarantee. Plugin developers
who need binary transport should keep using the wrapper directly
from the WebAPI process or build a dedicated binary endpoint.
Idempotency-Key is strongly recommended — plugins may have side effects, and the channel itself gives no read-modify-write semantics.
Timeout: 60 s by default, adjustable per request with the X-Request-Timeout header. When the trade server does not answer in time: The operation may still be completed by the server (X-Request-Outcome: unknown): check its result before repeating it.
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| tradePlatform | path | string (uuid) | yes | Trade platform id (GUID) |
| X-Request-Timeout | header | number (double) | no | How long to wait for the trade server, in seconds (1–300). Default for this operation: 60 s (server maintenance). The query parameter requestTimeout does the same for clients that cannot set headers. The applied value is returned in the X-Request-Timeout-Applied response header. |
Request body
any (application/json, required) — The command as JSON, passed to the server plugin verbatim.
Responses
- 200 Success — JsonNodeApiResponse
Example
curl -X POST "https://cloud.mywebapi.com/api/v2/MT4/$TRADE_PLATFORM_ID/ExternalCommandJSON" \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{}'