Updated on 2025-07-28 GMT+08:00

Obtaining a Login Token

API Description

This API is used to obtain a login token.

Precautions

  1. This API is an asynchronous API. The return value only indicates whether the API is successfully called. The actual service processing result is returned in the corresponding callback function.

Method Definition

1
HWM_SDK_AGENT_API hwmsdk::HwmErrCode GetLoginToken();

Callback Function

1
virtual void OnGetLoginTokenResult(hwmsdk::HwmErrCode ret, const char* reason, const  HwmLoginTokenInfo* loginTokenInfo) {};

Parameter Description

Table 1 HwmLoginTokenInfo description

Parameter

Mandatory

Type

Description

loginToken

Yes

char[]

Login token.

1
2
3
4
5
6
7
8
9
/**
* Obtain a login token.
*/
int demoGetLoginTokenDlg::GetLoginToken()
{
    // Call the API for obtaining a login token.
    int ret = hwmsdkagent::GetLoginToken();
    return ret;
}