All URIs are relative to https://api.gateio.ws/api/v4
Method | HTTP request | Description |
---|---|---|
ListSubAccounts | GET /sub_accounts | List sub-accounts |
CreateSubAccounts | POST /sub_accounts | Create a new sub-account |
GetSubAccount | GET /sub_accounts/{user_id} | Get the sub-account |
ListSubAccountKeys | GET /sub_accounts/{user_id}/keys | List all API Key of the sub-account |
CreateSubAccountKeys | POST /sub_accounts/{user_id}/keys | Create API Key of the sub-account |
GetSubAccountKey | GET /sub_accounts/{user_id}/keys/{key} | Get the API Key of the sub-account |
UpdateSubAccountKeys | PUT /sub_accounts/{user_id}/keys/{key} | Update API key of the sub-account |
DeleteSubAccountKeys | DELETE /sub_accounts/{user_id}/keys/{key} | Delete API key of the sub-account |
LockSubAccount | POST /sub_accounts/{user_id}/lock | Lock the sub-account |
UnlockSubAccount | POST /sub_accounts/{user_id}/unlock | Unlock the sub-account |
ListUnifiedMode | GET /sub_accounts/unified_mode | Get sub-account mode |
List<SubAccount> ListSubAccounts (string type = null)
List sub-accounts
using System.Collections.Generic;
using System.Diagnostics;
using Io.Gate.GateApi.Api;
using Io.Gate.GateApi.Client;
using Io.Gate.GateApi.Model;
namespace Example
{
public class ListSubAccountsExample
{
public static void Main()
{
Configuration config = new Configuration();
config.BasePath = "https://api.gateio.ws/api/v4";
config.SetGateApiV4KeyPair("YOUR_API_KEY", "YOUR_API_SECRET");
var apiInstance = new SubAccountApi(config);
var type = "0"; // string | `0` to list all types of sub-accounts (currently supporting cross margin accounts and sub-accounts). `1` to list sub-accounts only. If no parameter is passed, only sub-accounts will be listed by default. (optional)
try
{
// List sub-accounts
List<SubAccount> result = apiInstance.ListSubAccounts(type);
Debug.WriteLine(result);
}
catch (GateApiException e)
{
Debug.Print("Exception when calling SubAccountApi.ListSubAccounts: " + e.Message);
Debug.Print("Exception label: {0}, message: {1}", e.ErrorLabel, e.ErrorMessage);
Debug.Print("Status Code: "+ e.ErrorCode);
Debug.Print(e.StackTrace);
}
}
}
}
Name | Type | Description | Notes |
---|---|---|---|
type | string | `0` to list all types of sub-accounts (currently supporting cross margin accounts and sub-accounts). `1` to list sub-accounts only. If no parameter is passed, only sub-accounts will be listed by default. | [optional] |
- Content-Type: Not defined
- Accept: application/json
Status code | Description | Response headers |
---|---|---|
200 | List retrieved | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
SubAccount CreateSubAccounts (SubAccount subAccount)
Create a new sub-account
using System.Collections.Generic;
using System.Diagnostics;
using Io.Gate.GateApi.Api;
using Io.Gate.GateApi.Client;
using Io.Gate.GateApi.Model;
namespace Example
{
public class CreateSubAccountsExample
{
public static void Main()
{
Configuration config = new Configuration();
config.BasePath = "https://api.gateio.ws/api/v4";
config.SetGateApiV4KeyPair("YOUR_API_KEY", "YOUR_API_SECRET");
var apiInstance = new SubAccountApi(config);
var subAccount = new SubAccount(); // SubAccount |
try
{
// Create a new sub-account
SubAccount result = apiInstance.CreateSubAccounts(subAccount);
Debug.WriteLine(result);
}
catch (GateApiException e)
{
Debug.Print("Exception when calling SubAccountApi.CreateSubAccounts: " + e.Message);
Debug.Print("Exception label: {0}, message: {1}", e.ErrorLabel, e.ErrorMessage);
Debug.Print("Status Code: "+ e.ErrorCode);
Debug.Print(e.StackTrace);
}
}
}
}
Name | Type | Description | Notes |
---|---|---|---|
subAccount | SubAccount |
- Content-Type: application/json
- Accept: application/json
Status code | Description | Response headers |
---|---|---|
201 | Created Successfully | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
SubAccount GetSubAccount (long userId)
Get the sub-account
using System.Collections.Generic;
using System.Diagnostics;
using Io.Gate.GateApi.Api;
using Io.Gate.GateApi.Client;
using Io.Gate.GateApi.Model;
namespace Example
{
public class GetSubAccountExample
{
public static void Main()
{
Configuration config = new Configuration();
config.BasePath = "https://api.gateio.ws/api/v4";
config.SetGateApiV4KeyPair("YOUR_API_KEY", "YOUR_API_SECRET");
var apiInstance = new SubAccountApi(config);
var userId = 56; // long | Sub-account user id
try
{
// Get the sub-account
SubAccount result = apiInstance.GetSubAccount(userId);
Debug.WriteLine(result);
}
catch (GateApiException e)
{
Debug.Print("Exception when calling SubAccountApi.GetSubAccount: " + e.Message);
Debug.Print("Exception label: {0}, message: {1}", e.ErrorLabel, e.ErrorMessage);
Debug.Print("Status Code: "+ e.ErrorCode);
Debug.Print(e.StackTrace);
}
}
}
}
Name | Type | Description | Notes |
---|---|---|---|
userId | long | Sub-account user id |
- Content-Type: Not defined
- Accept: application/json
Status code | Description | Response headers |
---|---|---|
200 | Successful | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
List<SubAccountKey> ListSubAccountKeys (int userId)
List all API Key of the sub-account
using System.Collections.Generic;
using System.Diagnostics;
using Io.Gate.GateApi.Api;
using Io.Gate.GateApi.Client;
using Io.Gate.GateApi.Model;
namespace Example
{
public class ListSubAccountKeysExample
{
public static void Main()
{
Configuration config = new Configuration();
config.BasePath = "https://api.gateio.ws/api/v4";
config.SetGateApiV4KeyPair("YOUR_API_KEY", "YOUR_API_SECRET");
var apiInstance = new SubAccountApi(config);
var userId = 56; // int | Sub-account user id
try
{
// List all API Key of the sub-account
List<SubAccountKey> result = apiInstance.ListSubAccountKeys(userId);
Debug.WriteLine(result);
}
catch (GateApiException e)
{
Debug.Print("Exception when calling SubAccountApi.ListSubAccountKeys: " + e.Message);
Debug.Print("Exception label: {0}, message: {1}", e.ErrorLabel, e.ErrorMessage);
Debug.Print("Status Code: "+ e.ErrorCode);
Debug.Print(e.StackTrace);
}
}
}
}
Name | Type | Description | Notes |
---|---|---|---|
userId | int | Sub-account user id |
- Content-Type: Not defined
- Accept: application/json
Status code | Description | Response headers |
---|---|---|
200 | List retrieved | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
List<SubAccountKey> CreateSubAccountKeys (long userId, SubAccountKey subAccountKey)
Create API Key of the sub-account
using System.Collections.Generic;
using System.Diagnostics;
using Io.Gate.GateApi.Api;
using Io.Gate.GateApi.Client;
using Io.Gate.GateApi.Model;
namespace Example
{
public class CreateSubAccountKeysExample
{
public static void Main()
{
Configuration config = new Configuration();
config.BasePath = "https://api.gateio.ws/api/v4";
config.SetGateApiV4KeyPair("YOUR_API_KEY", "YOUR_API_SECRET");
var apiInstance = new SubAccountApi(config);
var userId = 56; // long | Sub-account user id
var subAccountKey = new SubAccountKey(); // SubAccountKey |
try
{
// Create API Key of the sub-account
List<SubAccountKey> result = apiInstance.CreateSubAccountKeys(userId, subAccountKey);
Debug.WriteLine(result);
}
catch (GateApiException e)
{
Debug.Print("Exception when calling SubAccountApi.CreateSubAccountKeys: " + e.Message);
Debug.Print("Exception label: {0}, message: {1}", e.ErrorLabel, e.ErrorMessage);
Debug.Print("Status Code: "+ e.ErrorCode);
Debug.Print(e.StackTrace);
}
}
}
}
Name | Type | Description | Notes |
---|---|---|---|
userId | long | Sub-account user id | |
subAccountKey | SubAccountKey |
- Content-Type: application/json
- Accept: application/json
Status code | Description | Response headers |
---|---|---|
200 | Created Successfully | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
SubAccountKey GetSubAccountKey (int userId, string key)
Get the API Key of the sub-account
using System.Collections.Generic;
using System.Diagnostics;
using Io.Gate.GateApi.Api;
using Io.Gate.GateApi.Client;
using Io.Gate.GateApi.Model;
namespace Example
{
public class GetSubAccountKeyExample
{
public static void Main()
{
Configuration config = new Configuration();
config.BasePath = "https://api.gateio.ws/api/v4";
config.SetGateApiV4KeyPair("YOUR_API_KEY", "YOUR_API_SECRET");
var apiInstance = new SubAccountApi(config);
var userId = 56; // int | Sub-account user id
var key = "key_example"; // string | The API Key of the sub-account
try
{
// Get the API Key of the sub-account
SubAccountKey result = apiInstance.GetSubAccountKey(userId, key);
Debug.WriteLine(result);
}
catch (GateApiException e)
{
Debug.Print("Exception when calling SubAccountApi.GetSubAccountKey: " + e.Message);
Debug.Print("Exception label: {0}, message: {1}", e.ErrorLabel, e.ErrorMessage);
Debug.Print("Status Code: "+ e.ErrorCode);
Debug.Print(e.StackTrace);
}
}
}
}
Name | Type | Description | Notes |
---|---|---|---|
userId | int | Sub-account user id | |
key | string | The API Key of the sub-account |
- Content-Type: Not defined
- Accept: application/json
Status code | Description | Response headers |
---|---|---|
200 | Successful | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
void UpdateSubAccountKeys (int userId, string key, SubAccountKey subAccountKey)
Update API key of the sub-account
using System.Collections.Generic;
using System.Diagnostics;
using Io.Gate.GateApi.Api;
using Io.Gate.GateApi.Client;
using Io.Gate.GateApi.Model;
namespace Example
{
public class UpdateSubAccountKeysExample
{
public static void Main()
{
Configuration config = new Configuration();
config.BasePath = "https://api.gateio.ws/api/v4";
config.SetGateApiV4KeyPair("YOUR_API_KEY", "YOUR_API_SECRET");
var apiInstance = new SubAccountApi(config);
var userId = 56; // int | Sub-account user id
var key = "key_example"; // string | The API Key of the sub-account
var subAccountKey = new SubAccountKey(); // SubAccountKey |
try
{
// Update API key of the sub-account
apiInstance.UpdateSubAccountKeys(userId, key, subAccountKey);
}
catch (GateApiException e)
{
Debug.Print("Exception when calling SubAccountApi.UpdateSubAccountKeys: " + e.Message);
Debug.Print("Exception label: {0}, message: {1}", e.ErrorLabel, e.ErrorMessage);
Debug.Print("Status Code: "+ e.ErrorCode);
Debug.Print(e.StackTrace);
}
}
}
}
Name | Type | Description | Notes |
---|---|---|---|
userId | int | Sub-account user id | |
key | string | The API Key of the sub-account | |
subAccountKey | SubAccountKey |
void (empty response body)
- Content-Type: application/json
- Accept: Not defined
Status code | Description | Response headers |
---|---|---|
204 | Updated | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
void DeleteSubAccountKeys (int userId, string key)
Delete API key of the sub-account
using System.Collections.Generic;
using System.Diagnostics;
using Io.Gate.GateApi.Api;
using Io.Gate.GateApi.Client;
using Io.Gate.GateApi.Model;
namespace Example
{
public class DeleteSubAccountKeysExample
{
public static void Main()
{
Configuration config = new Configuration();
config.BasePath = "https://api.gateio.ws/api/v4";
config.SetGateApiV4KeyPair("YOUR_API_KEY", "YOUR_API_SECRET");
var apiInstance = new SubAccountApi(config);
var userId = 56; // int | Sub-account user id
var key = "key_example"; // string | The API Key of the sub-account
try
{
// Delete API key of the sub-account
apiInstance.DeleteSubAccountKeys(userId, key);
}
catch (GateApiException e)
{
Debug.Print("Exception when calling SubAccountApi.DeleteSubAccountKeys: " + e.Message);
Debug.Print("Exception label: {0}, message: {1}", e.ErrorLabel, e.ErrorMessage);
Debug.Print("Status Code: "+ e.ErrorCode);
Debug.Print(e.StackTrace);
}
}
}
}
Name | Type | Description | Notes |
---|---|---|---|
userId | int | Sub-account user id | |
key | string | The API Key of the sub-account |
void (empty response body)
- Content-Type: Not defined
- Accept: Not defined
Status code | Description | Response headers |
---|---|---|
204 | Delete successfully | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
void LockSubAccount (long userId)
Lock the sub-account
using System.Collections.Generic;
using System.Diagnostics;
using Io.Gate.GateApi.Api;
using Io.Gate.GateApi.Client;
using Io.Gate.GateApi.Model;
namespace Example
{
public class LockSubAccountExample
{
public static void Main()
{
Configuration config = new Configuration();
config.BasePath = "https://api.gateio.ws/api/v4";
config.SetGateApiV4KeyPair("YOUR_API_KEY", "YOUR_API_SECRET");
var apiInstance = new SubAccountApi(config);
var userId = 56; // long | The user id of the sub-account
try
{
// Lock the sub-account
apiInstance.LockSubAccount(userId);
}
catch (GateApiException e)
{
Debug.Print("Exception when calling SubAccountApi.LockSubAccount: " + e.Message);
Debug.Print("Exception label: {0}, message: {1}", e.ErrorLabel, e.ErrorMessage);
Debug.Print("Status Code: "+ e.ErrorCode);
Debug.Print(e.StackTrace);
}
}
}
}
Name | Type | Description | Notes |
---|---|---|---|
userId | long | The user id of the sub-account |
void (empty response body)
- Content-Type: Not defined
- Accept: Not defined
Status code | Description | Response headers |
---|---|---|
204 | Lock successfully | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
void UnlockSubAccount (long userId)
Unlock the sub-account
using System.Collections.Generic;
using System.Diagnostics;
using Io.Gate.GateApi.Api;
using Io.Gate.GateApi.Client;
using Io.Gate.GateApi.Model;
namespace Example
{
public class UnlockSubAccountExample
{
public static void Main()
{
Configuration config = new Configuration();
config.BasePath = "https://api.gateio.ws/api/v4";
config.SetGateApiV4KeyPair("YOUR_API_KEY", "YOUR_API_SECRET");
var apiInstance = new SubAccountApi(config);
var userId = 56; // long | The user id of the sub-account
try
{
// Unlock the sub-account
apiInstance.UnlockSubAccount(userId);
}
catch (GateApiException e)
{
Debug.Print("Exception when calling SubAccountApi.UnlockSubAccount: " + e.Message);
Debug.Print("Exception label: {0}, message: {1}", e.ErrorLabel, e.ErrorMessage);
Debug.Print("Status Code: "+ e.ErrorCode);
Debug.Print(e.StackTrace);
}
}
}
}
Name | Type | Description | Notes |
---|---|---|---|
userId | long | The user id of the sub-account |
void (empty response body)
- Content-Type: Not defined
- Accept: Not defined
Status code | Description | Response headers |
---|---|---|
204 | Unlock successfully | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
List<SubUserMode> ListUnifiedMode ()
Get sub-account mode
Unified account mode: - classic
: Classic account mode - multi_currency
: Multi-currency margin mode - portfolio
: Portfolio margin mode
using System.Collections.Generic;
using System.Diagnostics;
using Io.Gate.GateApi.Api;
using Io.Gate.GateApi.Client;
using Io.Gate.GateApi.Model;
namespace Example
{
public class ListUnifiedModeExample
{
public static void Main()
{
Configuration config = new Configuration();
config.BasePath = "https://api.gateio.ws/api/v4";
config.SetGateApiV4KeyPair("YOUR_API_KEY", "YOUR_API_SECRET");
var apiInstance = new SubAccountApi(config);
try
{
// Get sub-account mode
List<SubUserMode> result = apiInstance.ListUnifiedMode();
Debug.WriteLine(result);
}
catch (GateApiException e)
{
Debug.Print("Exception when calling SubAccountApi.ListUnifiedMode: " + e.Message);
Debug.Print("Exception label: {0}, message: {1}", e.ErrorLabel, e.ErrorMessage);
Debug.Print("Status Code: "+ e.ErrorCode);
Debug.Print(e.StackTrace);
}
}
}
}
This endpoint does not need any parameter.
- Content-Type: Not defined
- Accept: application/json
Status code | Description | Response headers |
---|---|---|
200 | Successfully retrieved | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]