CPlugin

MT4 v2 :: Online

API v2 (beta) · MT4 · 2 operations · base URL https://cloud.mywebapi.com · OpenAPI v2 (JSON) · Redoc

Every call needs Authorization: Bearer $TOKEN — an OAuth 2.0 client-credentials token from https://auth.cplugin.net/connect/token (scope webapi). $TRADE_PLATFORM_ID is the id of a trade platform registered in Toolbox.

Operations

List online users (cached)

GET /api/v2/MT4/{tradePlatform}/OnlineGet

Pump-cached snapshot of currently online users, paginated by login.

Pump-cached read — instant local lookup, no MT4 round-trip. Sort order is the login ascending. ?limit= caps the page size; without it the full set returns in one page. When the pump cache is not yet warmed (fresh connection) the response is a NoConnect error with a retry hint, not an empty list — empty list means "warmed but currently no online sessions".

Timeout: 10 s by default, adjustable per request with the X-Request-Timeout header. When the trade server does not answer in time: Nothing was changed; the request is safe to repeat.

Parameters

NameInTypeRequiredDescription
tradePlatform path string (uuid) yes
limit query integer (int32) no Maximum number of items to return in one page. Omit to return all items in a single page. Maximum allowed value is 5000.
cursor query string no Opaque continuation token. Pass the value from the previous response's meta.paging.nextCursor to fetch the next page; omit for the first page.
X-Request-Timeout header number (double) no How long to wait for the trade server, in seconds (1–300). Default for this operation: 10 s (read). 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.

Responses

Example

curl "https://cloud.mywebapi.com/api/v2/MT4/$TRADE_PLATFORM_ID/OnlineGet" \
  -H "Authorization: Bearer $TOKEN"

List online sessions (live)

GET /api/v2/MT4/{tradePlatform}/OnlineRequest

Live snapshot of every currently-online session, fetched from the MT4 server (Manager round-trip — not pump cache).

Manager (live) counterpart to OnlineGet. Useful when the pump cache hasn't warmed yet, when staleness is unacceptable, or as a reconciliation pass against the pump snapshot. Heavier than OnlineGet: every call hits the MT4 server. Paged the same way for caller symmetry — cursor is the trailing login (ascending).

Timeout: 10 s by default, adjustable per request with the X-Request-Timeout header. When the trade server does not answer in time: Nothing was changed; the request is safe to repeat.

Parameters

NameInTypeRequiredDescription
tradePlatform path string (uuid) yes Trade platform id (GUID)
limit query integer (int32) no Maximum number of items to return in one page. Omit to return all items in a single page. Maximum allowed value is 5000.
cursor query string no Opaque continuation token. Pass the value from the previous response's meta.paging.nextCursor to fetch the next page; omit for the first page.
X-Request-Timeout header number (double) no How long to wait for the trade server, in seconds (1–300). Default for this operation: 10 s (read). 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.

Responses

Example

curl "https://cloud.mywebapi.com/api/v2/MT4/$TRADE_PLATFORM_ID/OnlineRequest" \
  -H "Authorization: Bearer $TOKEN"

Schemas

Types the operations above take and return, with their first-level properties; * marks a required one. The full graph is in the OpenAPI specification.

MT4OnlineListApiResponse

Unified v2 response envelope: data is the payload (null on error); error is the error object (null on success, always serialised); meta contains response metadata (activityId and optional paging). HTTP status is always 200.

PropertyTypeDescription
data MT4Online[]
error ApiError v2 error body. Code is the stable transport error code; ManagerCode is the raw MT4 ResultCode (serialized as a string for a known enum member, or as a number for an unrecognised value returned by MT4); Message is a human-readable description.
meta ApiMeta Response metadata. ActivityId is the W3C trace-id for correlation in Seq/SigNoz. Paging is present only on paginated list responses; otherwise it is omitted — the global JSON context policy serialises null fields, so we override that here with System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingNull.

MT4Online

v2 DTO describing an online user session entry. Curated subset of the wrapper's OnlineRecord — exposes the login id and group name, which is what callers actually need to know who is connected. IP, Counter and internal Reserved fields are intentionally omitted: IP is potentially PII and not always meaningful (NAT, proxies), Counter/Reserved are wrapper bookkeeping.

PropertyTypeDescription
login integer (int32) Trading account number (login)
group string, nullable Group name the account belongs to

ApiError

v2 error body. Code is the stable transport error code; ManagerCode is the raw MT4 ResultCode (serialized as a string for a known enum member, or as a number for an unrecognised value returned by MT4); Message is a human-readable description.

PropertyTypeDescription
code WebApiErrorCode Stable transport-level error code.
managerCode ResultCode Raw MT4/MT5 manager result code, when the error came from the trading platform; otherwise null.
message string, nullable Human-readable error description.

ApiMeta

Response metadata. ActivityId is the W3C trace-id for correlation in Seq/SigNoz. Paging is present only on paginated list responses; otherwise it is omitted — the global JSON context policy serialises null fields, so we override that here with System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingNull.

PropertyTypeDescription
activityId string, nullable W3C trace id for correlating this response in logs and tracing (Seq/SigNoz).
paging PagingMeta Pagination info; present only on list responses, omitted otherwise.