Initializing the Client
AK/SK-based Authentication
//
//Obtain the AK/SK, region, and project ID by referring to sections "Authentication", "Obtaining SDKs", and "Obtaining a Project ID".
//For example, if the AK is {ak}, the SK is {sk}, the region is {region}, the project ID is {projectId}, the client is constructed as follows:
//
AuthInfo authInfo = new AuthInfo("{ak}","{sk}","{region}","{projectId}");
//
//After AuthInfo is constructed, initialize the corresponding client. In this case, set the first parameter of the construction method to AuthMode.AKSK.
//
NluClient client = new NluClient(AuthMode.AKSK,authInfo); Username and Password-based Authentication
//
//Obtain the region and project ID by referring to sections "Obtaining SDKs" and "Obtaining a Project ID".
//For example, if the username is {userName}, the password is {pwd}, the account is {domainName}, the region is {region}, the project ID is {projectId}, the client is constructed as follows:
//An account can have two or more users. If a user uses the account for login, the value of userName should be the same as that of domainName.
//
AuthInfo authInfo = new AuthInfo("{userName}","{pwd}","{domainName}","{region}","{projectId}");
//
//After AuthInfo is constructed, initialize the corresponding client. In this case, set the first parameter of the construction method to AuthMode.TOKEN.
//
NluClient client = new NluClient(AuthMode.TOKEN,authInfo); Last Article: Using the LU SDK
Next Article: Calling LU APIs
Did this article solve your problem?
Thank you for your score!Your feedback would help us improve the website.