API Key Login
ApikeyLogin
Version Requirement
New feature added in version 2.2.7
Input Parameters
| Parameter | Type | Description |
|---|---|---|
| personalID | String | Login ID |
| key | String | Applied API Key |
| certPath | String | Certificate Path |
| certPass | String | Certificate Password |
Result Return
| Parameter | Type | Description |
|---|---|---|
| isSuccess | bool | Whether the login was successful |
| data | List | Returns account information |
| message | string | Returns error message when isSuccess = False |
Account Information Fields
Return type : Object
| Parameter | Type | Description |
|---|---|---|
| name | String | Client Name |
| account | String | Client Account |
| branchNo | String | Branch Code |
| accountType | string | Account Type. Returns stock for Securities, futopt for Futures/Options |
Request Example
loginResp, err := sdk.ApikeyLogin(personalId, key, certPath, &certPass)
if err != nil {
fmt.Printf("❌ Login Format/Parse Error: %v (Type: %T)\n", err, err)
return
}
if loginResp.IsSuccess {
fmt.Println("✓ Login successful!")
} else {
fmt.Printf("❌ Login failed: %s\n", *loginResp.Message)
return
}
Response Example
{
isSuccess = true,
message = ,
data = [
Account{
name = Fubon Bill, // Client Name (string)
account = 28, // Client Account (string)
branchNo = 6460, // Branch Code (string)
accountType = stock // Account Type (string)
}
]
}