CPlugin

MT4 :: Groups

API v1 (stable) · MT4 · 5 operations · base URL https://cloud.mywebapi.com · OpenAPI v1 (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

All groups (pumping)

GET /api/MT4/{tradePlatform}/GroupsGet

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
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/MT4/$TRADE_PLATFORM_ID/GroupsGet" \
  -H "Authorization: Bearer $TOKEN"

All groups

GET /api/MT4/{tradePlatform}/GroupsRequest

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
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/MT4/$TRADE_PLATFORM_ID/GroupsRequest" \
  -H "Authorization: Bearer $TOKEN"

Group (pumping)

GET /api/MT4/{tradePlatform}/GroupRecordGet/{group}

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
group path string yes MT4 group name
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/MT4/$TRADE_PLATFORM_ID/GroupRecordGet/$GROUP" \
  -H "Authorization: Bearer $TOKEN"

All groups (admin)

GET /api/MT4/{tradePlatform}/CfgRequestGroup

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
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/MT4/$TRADE_PLATFORM_ID/CfgRequestGroup" \
  -H "Authorization: Bearer $TOKEN"

Update group settings (admin)

POST /api/MT4/{tradePlatform}/CfgUpdateGroup

Timeout: 15 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

NameInTypeRequiredDescription
tradePlatform path string (uuid) yes Trade platform id
X-Request-Timeout header number (double) no How long to wait for the trade server, in seconds (1–300). Default for this operation: 15 s (change). 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

ConGroup (application/json) — Group to be updated

Responses

Example

curl -X POST "https://cloud.mywebapi.com/api/MT4/$TRADE_PLATFORM_ID/CfgUpdateGroup" \
  -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/json" \
  -d '{ "secGroups": [{}], "secMargins": [{}], "enable": 0, "group": "", "timeout": 0, "otpMode": "Disabled" }'

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.

ConGroup

PropertyTypeDescription
secGroups ConGroupSec[]
secMargins ConGroupMargin[]
enable integer (int32)
group string, nullable
timeout integer (int32)
otpMode OTPMode
company string, nullable
signature string, nullable
supportPage string, nullable
smtpServer string, nullable
smtpLogin string, nullable
smtpPassword string, nullable
supportEmail string, nullable
templates string, nullable
copies integer (int32)
reports integer (int32)
defaultLeverage integer (int32)
defaultDeposit number (double)
maxSecurities integer (int32)
secMarginsTotal integer (int32)
currency string, nullable
credit number (double)
marginCall integer (int32)
marginMode MarginMode
marginStopout integer (int32)
interestRate number (double)
useSwap integer (int32)
newsMode NewsMode
groupRights GroupRights
checkIEPrices integer (int32)
maxPositions integer (int32)
closeReopen integer (int32)
hedgeProhibited integer (int32)
closeFIFO integer (int32)
hedgeLargeLeg integer (int32)
securitiesHash string (byte), nullable
marginControllingType MarginControllingType
archivePeriod integer (int32)
archiveMaxBalance integer (int32)
stopoutSkipHedged integer (int32)
archivePendingPeriod integer (int32)
newsLanguages integer (int32)[]
newsLanguagesTotal integer (int32)
reserved integer (int32)[]
unusedRights integer (int32)[]

ConGroupSec

PropertyTypeDescription
show integer (int32)
trade integer (int32)
dealingMode DealingMode
standardCommission number (double)
commissionType CommissionType
commissionLotsMode CommissionLotsMode
agentCommission number (double)
agentCommissionMode CommissionType
spreadDiff integer (int32)
lotMin integer (int32)
lotMax integer (int32)
lotStep integer (int32)
ieDeviation integer (int32)
confirmation integer (int32)
tradeRights ClientsTradeRights
ieQuickMode integer (int32)
autoCloseOutMode AutoCloseOutMethod
commissionTaxes number (double)
commissionAgentLots CommissionLotsMode
freeMarginMode integer (int32)
reserved integer (int32)[]

ConGroupMargin

PropertyTypeDescription
symbol string, nullable
swapLong number (double)
swapShort number (double)
marginDivider number (double)
reserved integer (int32)[]

OTPMode

Values: Disabled, TOTP_SHA256

MarginMode

Values: DontUse, UseAll, UseProfit, UseLoss

NewsMode

Values: No, Topics, Full

GroupRights

Flags: names of the set bits joined by ", " ("Signals, Trailing"), "None" when none is set; a set bit without a name is "Bit<n>" (bit number). Bits: Signals = 0x1, Trailing = 0x2, Advisor = 0x4, Expiration = 0x8, SignalAll = 0x10, SignalsOwn = 0x20, RiskWarning = 0x40, ForcedOTPUsage = 0x80.

MarginControllingType

Values: Percent, Currency