Operation

Operation #

We integrate announcements, guides, news, etc. with the customer service system at the same entrance, greatly improving the efficiency of information dissemination, so that users can understand the latest product trends more conveniently, and communicate with the customer service team more directly and efficiently.

API #

You can call the AIHelp operation module by calling this function.

This API requires the following parameters:

  • OperationConfig

    Optional. Configurations for operation module.

    Field Description Type
    selectIndex default select tab index in operation int(>=0)
    conversationTitle conversation tab title in operation String(custom string)
    ConversationConfig configuration for conversation ConversationConfig(see end tab for details)

For HTML5 platform, you need to set the above API name as the supportMode, and encapsulate all your needed fields into supportConfig and pass in. You can get more details in following code examples and here.

AIHelp supports direct access to conversation system from operation module.

The following is a detailed field description of the ConversationConfig that configures the conversation system.

Field Description Type
conversationIntent intent for conversation display ConversationIntent(BOT / HUMAN)
alwaysShowHumanSupportButtonInBotPage entrance visiblity for human support button boolean(true / false)
welcomeMessage custom welcome messag for human support String(custom string)
storyNode entrance node for specific story line String(story lines’ user say)

Code example #

Let’s assume a scenario where the application has different support and care schemes for different levels of users.

1、For users with level > 50, conversation tab is selected by default, and configure their conversation title to “Support”;

2、At the same time, these users can choose to contact the manual customer service directly, and there is a special welcome message for them.

Then, the code example for this scenario is as follows:

Unlike other platforms, you also need to pass in the activity reference when calling this API.

public void showOperation(int level) {
    OperationConfig.Builder operationBuilder = new OperationConfig.Builder();
    if (level > 50) {
        operationBuilder.setSelectIndex(Integer.MAX_VALUE);
        operationBuilder.setConversationTitle("Support");
        operationBuilder.setConversationConfig(new ConversationConfig.Builder()
                .setAlwaysShowHumanSupportButtonInBotPage(true)
                .setWelcomeMessage("CUSTOM WELCOME MSG FROM OPERATION")
                .build()
        );
    } else {
        operationBuilder.setSelectIndex(0);
    }
    AIHelpSupport.showOperation(operationBuilder.build());
}
- (void)showOperation:(int)level {
    AIHelpOperationConfigBuilder *operationBuilder = [[AIHelpOperationConfigBuilder alloc] init];
    AIHelpConversationConfigBuilder *conversationBuilder = [[AIHelpConversationConfigBuilder alloc] init];
    if (level < 50) {
        operationBuilder.selectIndex = INT_MAX;
        operationBuilder.conversationTitle = @"Support";
        conversationBuilder.alwaysShowHumanSupportButtonInBotPage = YES;
        conversationBuilder.welcomeMessage = @"CUSTOM WELCOME MSG FROM OPERATION";
        operationBuilder.conversationConfig = conversationBuilder.build;
    }else {
        operationBuilder.selectIndex = 0;
    }
    [AIHelpSupportSDK showOperation:operationBuilder.build];
}
public void showOperation(int level) {
    OperationConfigBuilder operationBuilder = OperationConfigBuilder();
    if (level > 50) {
        operationBuilder.setSelectIndex(intmax_t);
        operationBuilder.setConversationTitle("Support");
        operationBuilder.setConversationConfig(new ConversationConfig.Builder()
                .setAlwaysShowHumanSupportButtonInBotPage(true)
                .setWelcomeMessage("CUSTOM WELCOME MSG FROM OPERATION")
                .build()
        );
    } else {
        operationBuilder.setSelectIndex(0);
    }
    AIHelpSupport::showOperation(operationBuilder.build());
}
public void showOperation(int level) 
{
    OperationConfig.Builder operationBuilder = new OperationConfig.Builder();
    if (level > 50) 
    {
        operationBuilder.setSelectIndex(Integer.MAX_VALUE);
        operationBuilder.setConversationTitle("Support");
        operationBuilder.setConversationConfig(new ConversationConfig.Builder()
                .setAlwaysShowHumanSupportButtonInBotPage(true)
                .setWelcomeMessage("CUSTOM WELCOME MSG FROM OPERATION")
                .build()
        );
    } 
  	else 
    {
        operationBuilder.setSelectIndex(0);
    }
    AIHelpSupport.showOperation(this, operationBuilder.build());
}
<script src="https://aihelp.net/webchat/aihelp.js"></script>
<script>
    // Example for showOperation case
    (function () {
        var supportConfig = {};
        if (level > 50) {
            supportConfig['selectIndex'] = Number.MAX_VALUE;
            supportConfig['conversationTitle'] = 'Support';
            supportConfig['alwaysShowHumanSupportButtonInBotPage'] = true;
            supportConfig['welcomeMessage'] = 'CUSTOM WELCOME MSG FROM OPERATION';
        } else {
            supportConfig['selectIndex'] = 0;
        }
        var initConfig = {
            appKey: 'THIS IS YOUR APP KEY',
            domain: 'THIS IS YOUR APP DOMAIN',
            appId: 'THIS IS YOUR APP ID',
            appName: "THIS IS YOUR APP NAME(OPTIONAL)",
            language: 'THIS IS YOUR DEFAULT LANGUAGE(OPTIONAL)',
            supportMode: 'showOperation',
            supportConfig: supportConfig,
            userConfig: {userId: "", customData: {}}
        }
        if (typeof AIHelpSupport !== undefined) AIHelpSupport.init(initConfig);
    })();
    function openAIHelp() {
        if (typeof AIHelpSupport !== undefined) AIHelpSupport.show();
    }
</script>

Page example #

Page examples based on the above scenario are as follows: