Platforms

On this page:

THE PLATFORM OBJECT

A detailed description of the JSON object

THE PLATFORM GROUP OBJECT

A detailed description of the JSON object

THE PLATFORM DRIVER OBJECT

A detailed description of the JSON object

GET[base]/platforms

Get a list of platforms

GET[base]/platforms/{platformId}

Get platform details

POST[base]/platforms/

Add a new platform

PUT[base]/platforms/{platformId}

Update a platform

DELETE[base]/platforms/{platformId}

Delete a platform

GET[base]/platforms/{platformId}/metrics

Get platform metrics

GET[base]/platforms/groups

Get a list of platform groups

GET[base]/platforms/groups/{platformGroupId}

Get platform group details

PUT[base]/platforms/groups/{platformGroupId}

Update a platform group

GET[base]/platforms/groups/{platformGroupId}/metrics

Get platform group metrics

GET[base]/platforms/{platformId}/drivers

Get a list of platform drivers

GET[base]/platforms/{platformId}/drivers/{driverId}

Get platform driver details

POST[base]/platforms/{platformId}/drivers

Add a new platform driver

PUT[base]/platforms/{platformId}/drivers/{driverId}

Update a platform driver

DELETE[base]/platforms/{platformId}/drivers/{driverId}

Delete a platform driver

GET[base]/platforms/{platformId}/drivers/{driverId}/diagnostics

Run platform diagnostics


The Platform object

This object provides the following data about a connected trading platform:

platformId string

The platform identifier.

address string

The platform address.

credentials object

The username and password strings used to set up connection to a platform.

environment string

The working environment. Possible values:

  • production

  • demo

name string

The trading platform name.

minPositionLifetime integer

The minimum lifetime of a position. If a position was closed earlier than the min position lifetime, it’s not taken into account in rewards calculating.

provider string

The platform provider. Possible values:

  • b2trader

  • metatrader5

  • metatrader4

workStatus string

The current platform status. Possible values:

  • enabled

  • disabled

createTime string

The date and time when the object has been created.

updateTime string

The date and time when the object has been last updated.

uuid string

The unique universal identifier of the object (if provided). Refer to Integrations for more information.

THE PLATFORM OBJECT
{
  "platformId": "6006dda272f002519c3eb505",
  "address": "host.name:443",
  "credentials": {
    "username": "Login"
  },
  "environment": "production",
  "name": "MetaTrader 5",
  "minPositionLifetime": 2,
  "provider": "metatrader5",
  "createTime": "2021-01-01T00:00:00+00:00",
  "updateTime": "2021-01-01T00:00:00+00:00",
  "uuid": null,
  "workStatus": "enabled"
}

The Platform group object

This object provides the following data about a platform group:

platformGroupId string

The platform group identifier.

platformId string

The platform identifier.

environment string

The working environment. Possible values:

  • production

  • demo

name string

The platform group name.

currency string

The currency of a platform group.

archived boolean

If true, a platform group is archived; otherwise, false.

lotMultiplier string

A multiplier applied to each lot within a platform group.

This value must be within 0.1—1 range.

createTime string

The date and time when the object has been created.

updateTime string

The date and time when the object has been last updated.

uuid string

The unique universal identifier of the object (if provided). Refer to Integrations for more information.

THE PLATFORM GROUP OBJECT
{
  "platformGroupId": "6006dda272f002519c3eb505",
  "platformId": "6006dda272f002519c3eb505",
  "environment": "production",
  "name": "B2BUSD",
  "currency": "BTC",
  "archived": false,
  "lotMultiplier": "1.000000000000000000",
  "createTime": "2021-01-01T00:00:00+00:00",
  "updateTime": "2021-01-01T00:00:00+00:00",
  "uuid": null
}

The Platform driver object

This object provides the following data about a trading platform driver:

driverId string

The driver identifier.

driverNumber string

The driver number.

address string

The driver address.

credentials object

The username and password strings used to set up connection to a platform.

name string

The driver name.

priority integer

The priority based on which a driver is selected when multiple drivers are specified for a single platform.

provider string

The driver provider.

version integer

The version of a driver.

createTime string

The date and time when the object has been created.

updateTime string

The date and time when the object has been last updated.

uuid string

The unique universal identifier of the object (if provided). Refer to Integrations for more information.

THE PLATFORM DRIVER OBJECT
{
  "driverId": "6006dda272f002519c3eb505",
  "driverNumber": "12345",
  "address": "mysql:host=localhost;port=3306;dbname=test;charset=utf8;collation=utf8_unicode_ci;timezone=+00:00",
  "credentials": {
    "username": "Report",
    "password": "password"
  },
  "name": "Report",
  "priority": 1,
  "provider": "PDO",
  "version": 2,
  "createTime": "2021-01-01T00:00:00+00:00",
  "updateTime": "2021-01-01T00:00:00+00:00",
  "uuid": null
}

Get a list of platforms

Use this method to obtain a list of trading platforms.

To obtain detailed information about a specified trading platform, use a separate method to get platform details.

Request

Header parameters:

  • Authorization: Bearer <token>

Query parameters:

This method supports pagination, sorting, filtering, and query. For details on applying the parameters, refer to the Query parameters section. Possible parameters for filtering, sorting, and query are listed below. For values description, refer to the Platform object.

Possible values for the filter parameter:

  • address

  • platformName

  • platformWorkStatus

Possible values for the sort_by parameter:

  • address

  • createTime (default)

  • name

  • platformId

  • provider

  • trades

  • updateTime

  • workStatus

Possible values for the query parameter:

  • metric — information about the total number of trades on a platform

GET[base]/platforms

curl --location -g --request GET 'https://your.base-url.here/platforms?limit=10&offset=0&sort_by=createTime&sort_order=desc&filter[address]=host.name:443:443&filter[name]=MetaTrader 5&filter[workStatus]=enabled&query[metrics]=1' \
--header 'Authorization: Bearer <token>'

Response

Body:

In case of success, the response body contains an array of Platform objects providing information about all trading platforms that correspond to the query parameters specified in the request.

Additionally, the response body may contain the following information if it was specified in the query parameters of the request:

  • the metrics array providing information about the total number of trades on a platform


Get platform details

Use this method to obtain information about a specified trading platform.

To obtain a list of trading platforms, use a separate method to get a list of platforms.

Request

Header parameters:

  • Authorization: Bearer <token>

Path parameters:

platformId required

The platform identifier.

Query parameters:

This method supports query. For details on applying the parameters, refer to the Query parameters section.

Possible values for the query parameter:

  • metric — information about the total number of trades on a platform

GET[base]/platforms/{platformId}

curl --location -g --request GET 'https://your.base-url.here/platforms/60ba407d15951453e60e49f8?query[metrics]=1' \
--header 'Authorization: Bearer <token>'

Response

Body:

In case of success, the response body contains a Plafrom object providing information about the specified trading platform.

Additionally, the response body may contain the following information if it was specified in the query parameters of the request:

  • the metrics array providing information about the total number of trades on a platform


Add a new platform

Use this method to add a new trading platform.

Request

Header parameters:

  • Authorization: Bearer <token>

Body:

environment string required

The working environment. Possible values:

  • production

  • demo

provider string required

The platform provider. Possible values:

  • b2trader

  • metatrader5

  • metatrader4

address string

The platform address.

credentials object

The credentials used to connect to a platform:

username string

The username.

password string

The password.

drivers array

An array of objects specifying the drivers used to set up connection to a platform.

Expand fields
address string

The driver address.

credentials object

The username and password strings used to set up connection to a platform.

name string

The driver name.

provider string

The service provider. Possible values:

  • b2trader

  • metatrader5

  • metatrader4

version integer

The driver version.

minPositionLifetime integer

The minimum lifetime of a position. If a position was closed earlier than the min position lifetime, it’s not taken into account in rewards calculating.

name string

The platform name.

uuid string

The unique universal identifier of the object. Refer to Integrations for more information.

POST[base]/platforms/

curl --location -g --request POST 'https://your.base-url.here/platforms' \
--header 'Authorization: Bearer <token>' \
--data-raw '{
  "environment": "production",
  "provider": "metatrader5",
  "address": "host.name:443",
  "credentials": {
    "username": "Login",
    "password": "Password"
  },
  "drivers": [
    {
      "address": "mysql:host=localhost;port=3306;dbname=test;charset=utf8;collation=utf8_unicode_ci;timezone=+00:00",
      "credentials": {
        "username": "Report",
        "password": "password"
      },
      "name": "Report",
      "provider": "PDO",
      "version": 2
    },
    {
      "address": "mysql:host=localhost;port=3306;dbname=test;charset=utf8;collation=utf8_unicode_ci;timezone=+00:00",
      "credentials": {
        "username": "Report",
        "password": "password"
      },
      "name": "Report",
      "provider": "PDO",
      "version": 2
    }
  ],
  "minPositionLifetime": 2,
  "name": "MetaTrader 5",
  "uuid": null
}'

Response

Body:

In case of success, the response body contains a Platform object providing information about the newly created trading platform.


Update a platform

Use this method to update the settings of specified a trading platform.

Note

Instead of the method described below, you can use a similar method that uses the HTTP verb PATCH.

Request

Header parameters:

  • Authorization: Bearer <token>

Path parameters:

platformId required

The platform identifier.

Body:

The following field values can be updated for a specified platform:

address string

The platform address.

credentials object

The credentials used to connect to a platform:

username string

The username.

password string

The password.

environment string

The working environment. Possible values:

  • production

  • demo

minPositionLifetime integer

The minimum lifetime of a position. If a position was closed earlier than the min position lifetime, it’s not taken into account in rewards calculating.

name string

The platform name.

uuid string

The unique universal identifier of the object. Refer to Integrations for more information.

workStatus string

The current platform status. Possible values:

  • enabled

  • disabled

PUT[base]/platforms/{platformId}

curl --location --request PUT 'https://your.base-url.here/platforms/60ba407d15951453e60e49f8' \
--header 'Authorization: Bearer <token>' \
--data-raw '{
  "address": "5.9.30.186:4443",
  "credentials": {
    "username": "Login",
    "password": "Password"
  },
  "environment": "production",
  "minPositionLifetime": 2,
  "name": "MetaTrader 5",
  "uuid": null,
  "workStatus": "enabled"
}'

Response

Body:

In case of success, the response body contains a Platform object providing information about the updated trading platform.


Delete a platform

Use this method to remove a trading platform from the list of connected platforms.

Request

Header parameters:

  • Authorization: Bearer <token>

Path parameters:

platformId required

The platform identifier.

DELETE[base]/platforms/{platformId}

curl --location --request DELETE 'https://your.base-url.here/platforms/60ba407d15951453e60e49f8' \
--header 'Authorization: Bearer <token>'

Response

Body:

In case of success, no response body is returned.


Get platform metrics

Use this method to obtain up-to-date metrics related to a specified platform.

Request

Header parameters:

  • Authorization: Bearer <token>

Path parameters:

platformId required

The platform identifier.

GET[base]/platforms/{platformId}/metrics

curl --location --request GET 'https://your.base-url.here/platforms/60ba407d15951453e60e49f8/metrics' \
--header 'Authorization: Bearer <token>'

Response

Body:

In case of success, the response body contains a key-value pair providing information about number of trades on the specified trading platform.

RESPONSE BODY EXAMPLE
{
  "total": 1,
  "metrics": [
    {
      "key": "trades",
      "value": 2487447
    }
  ]
}

Get a list of platform groups

Use this method to obtain a list of available platform groups.

To obtain detailed information about a specified platform group, use a separate method to get platform group details.

Request

Header parameters:

  • Authorization: Bearer <token>

Query parameters:

This method supports pagination, sorting, filtering, and query. For details on applying the parameters, refer to the Query parameters section. Possible parameters for filtering, sorting, and query are listed below. For values description, refer to the Platform group object.

Possible values for the filter parameter:

  • platformGroupCurrency

  • platformGroupName

  • platformGroupId

  • uuid

  • archived

  • lotMultiplier

Possible values for the sort_by parameter:

  • createTime (default)

  • currency

  • groupId

  • name

  • platformId

  • trades

  • lotMultiplier

  • archived

  • updateTime

Possible values for the query parameter:

  • metric — information about the total number of trades on a platform group

  • platform — information about platform

GET[base]/platforms/groups

curl --location -g --request GET 'https://your.base-url.here/platforms/groups?limit=10&offset=0&sort_by=createTime&sort_order=desc&filter[currency]=BTC&filter[platformGroupName]=B2BUSD&filter[platformGroupId]=6006dda272f002519c3eb505&filter[uuid]=9&filter[archived]=<boolean>&filter[lotMultiplier]=1.000000000000000000&query[metrics]=1&query[platform]=1' \
--header 'Authorization: Bearer <token>'

Response

Body:

In case of success, the response body contains an array of Platform group objects providing information about all platform groups that correspond to the query parameters specified in the request.

Additionally, the response body may contain the following information if any of these were specified in the query parameters of the request:

  • the metrics array providing information about the total number of trades on a platform

  • the Platform object providing the platformId, name and provider of a trading platform


Get platform group details

Use this method to obtain information about a specified platform group.

To obtain a list of available platform groups, use a separate method to get a list of platform groups.

Request

Header parameters:

  • Authorization: Bearer <token>

Path parameters:

platformGroupId required

The platform group identifier.

Query parameters:

This method supports query. For details on applying the parameters, refer to the Query parameters section.

Possible values for the query parameter:

  • metric — information about the total number of trades on a platform group

  • platform — information about platform

GET[base]/platforms/groups/{platformGroupId}

curl --location -g --request GET 'https://your.base-url.here/platforms/groups/60ba407d15951453e60e49f8?query[metrics]=1&query[platform]=1' \
--header 'Authorization: Bearer <token>'

Response

Body:

In case of success, the response body contains a Platform group object providing information about the specified platform group.

Additionally, the response body may contain the following information if any of these were specified in the query parameters of the request:

  • the metrics array providing information about the total number of trades on a platform

  • the Platform object providing the platformId, name and provider of a trading platform


Update a platform group

Use this method to update a specified platform group.

Note

Instead of the method described below, you can use a similar method that uses the HTTP verb PATCH.

Request

Header parameters:

  • Authorization: Bearer <token>

Path parameters:

platformGroupId required

The platform group identifier.

Body:

The following field value can be updated for a specified platform group:

lotMultiplier number

A multiplier applied to each lot within a platform group.

This value must be within 0.1—1 range.

PUT[base]/platforms/groups/{platformGroupId}

curl --location -g --request PUT 'https://your.base-url.here/platforms/groups/60ba407d15951453e60e49f8' \
--header 'Authorization: Bearer <token>' \
--data-raw '{
  "lotMultiplier": 1
}'

Response

Body:

In case of success, the response body contains information about a Platform group object providing information about the updated platform group.


Get platform group metrics

Use this method to obtain up-to-date metrics related to a specified platform group.

Request

Header parameters:

  • Authorization: Bearer <token>

Path parameters:

platformGroupId required

The platform group identifier.

GET[base]/platforms/groups/{platformGroupId}/metrics

curl --location --request GET 'https://your.base-url.here/platforms/groups/60ba407d15951453e60e49f8/metrics' \
--header 'Authorization: Bearer <token>'

Response

Body:

In case of success, the response body contains a key-value pair providing information about number of trades on the specified platform group.

RESPONSE BODY EXAMPLE
{
  "total": 1,
  "metrics": [
    {
      "key": "trades",
      "value": 2487447
    }
  ]
}

Get a list of platform drivers

Use this method to obtain a list of drivers used to connect to a specified trading platform.

To obtain detailed information about a specified platform driver, use a separate method to get platform driver details.

Request

Header parameters:

  • Authorization: Bearer <token>

Path parameters:

platformId required

The platform identifier.

GET[base]/platforms/{platformId}/drivers

curl --location --request GET 'https://your.base-url.here/platforms/60ba407d15951453e60e49f8/drivers' \
--header 'Authorization: Bearer <token>'

Response

Body:

In case of success, the response body contains an array of Driver objects providing information about all platform drivers that correspond to the query parameters specified in the request.


Get platform driver details

Use this method to obtain information about a driver used to connect to a specified trading platform.

To obtain a list of platform drivers, use a separate method to get a list of platform drivers.

Request

Header parameters:

  • Authorization: Bearer <token>

Path parameters:

platformId required

The platform identifier.

driverId required

The driver identifier.

GET[base]/platforms/{platformId}/drivers/{driverId}

curl --location --request GET 'https://your.base-url.here/platforms/60ba407d15951453e60e49f8/drivers/60ba407d15951453e60e49f8' \
--header 'Authorization: Bearer <token>'

Response

Body:

In case of success, the response body contains information about a specified Driver object.


Add a new platform driver

Use this method to add a new driver for connecting to a specified trading platform.

Request

Header parameters:

  • Authorization: Bearer <token>

Path parameters:

platformId required

The platform identifier.

Body:

provider string required

The connection provider. Possible values:

  • PDO

  • SOAP

address string

The platform address.

credentials object

The credentials used to connect to a platform:

username string

The username.

password string

The password.

name string

The driver name.

priority integer

The priority based on which a driver is selected when multiple drivers are specified for a single platform.

version integer

The driver version.

uuid string

The unique universal identifier of the object. Refer to Integrations for more information.

POST[base]/platforms/{platformId}/drivers

curl --location --request POST 'https://your.base-url.here/platforms/60ba407d15951453e60e49f8/drivers' \
--header 'Authorization: Bearer <token>' \
--data-raw '{
  "provider": "PDO",
  "address": "mysql:host=localhost;port=3306;dbname=test;charset=utf8;collation=utf8_unicode_ci;timezone=+00:00",
  "credentials": {
    "username": "Report",
    "password": "password"
  },
  "name": "Report",
  "priority": 1,
  "version": 2,
  "uuid": null
}'

Response

Body:

In case of success, the response body contains information about a newly created Driver object.


Update a platform driver

Use this method to update a specified driver used to connect to a trading platform.

Note

Instead of the method described below, you can use a similar method that uses the HTTP verb PATCH.

Request

Header parameters:

  • Authorization: Bearer <token>

Path parameters:

platformId required

The platform identifier.

driverId required

The driver identifier.

Body:

The following field values can be updated for a specified resource:

address string

The driver address.

credentials object

The credentials used to connect to a platform:

username string

The username.

password string

The password.

name string

The driver name.

priority integer

The priority based on which a driver is selected when multiple drivers are specified for a single platform.

version integer

The driver version.

uuid string

The unique universal identifier of the object. Refer to Integrations for more information.

PUT[base]/platforms/{platformId}/drivers/{driverId}

curl --location --request PUT 'https://your.base-url.here/platforms/60ba407d15951453e60e49f8/drivers/60ba407d15951453e60e49f8' \
--header 'Authorization: Bearer <token>' \
--data-raw '{
  "address": "mysql:host=localhost;port=3306;dbname=test;charset=utf8;collation=utf8_unicode_ci;timezone=+00:00",
  "credentials": {
    "username": "Report",
    "password": "password"
  },
  "name": "Report",
  "priority": 1,
  "version": 2,
  "uuid": null
}'

Response

Body:

In case of success, the response body contains information about a Driver object providing information about the updated driver.


Delete a platform driver

Use this method to delete a specified driver used to connect to a trading platform.

Request

Header parameters:

  • Authorization: Bearer <token>

Path parameters:

platformId required

The platform identifier.

driverId required

The driver identifier.

DELETE[base]/platforms/{platformId}/drivers/{driverId}

curl --location --request DELETE 'https://your.base-url.here/platforms/60ba407d15951453e60e49f8/drivers/60ba407d15951453e60e49f8' \
--header 'Authorization: Bearer <token>'

Response

Body:

In case of success, no response body is returned.


Run platform diagnostics

Use this method to run trading platform diagnostics.

Request

Header parameters:

  • Authorization: Bearer <token>

Path parameters:

platformId required

The platform identifier.

driverId required

The driver identifier.

GET[base]/platforms/{platformId}/drivers/{driverId}/diagnostics

curl --location --request GET 'https://your.base-url.here/platforms/60ba407d15951453e60e49f8/drivers/60ba407d15951453e60e49f8/diagnostics' \
--header 'Authorization: Bearer <token>'

Response

Body:

health boolean

If true, the connection to a trading platform is alive. If false, diagnostics failed.

message string

If diagnostics failed, this field contains a problem description. If the connection to a trading platform is alive, null.

RESPONSE BODY EXAMPLE
{
  "health": true,
  "message": "The connection is alive."
}