FAQ

FAQ #

The FAQ module contains a single FAQ, FAQ section and all FAQ categories, and supports different ways to jump to robot and human services through configuration.

API #

You can call this function to display the FAQ section list, you can search a specific FAQ, and show the entrance of AIHelp conversation system in the appropriate location.

This API requires the following parameters:

  • FaqConfig

    Optional. Configuration for FAQ module.

    Field Description Type
    showConversationMoment when to show conversation entrance in FAQ page ConversationMoment(always / never / after-marking-unhelpful)
    conversationConfig configuration for conversation system from FAQ page ConversationConfig(see end tab for details)

Note:

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.

Different from displaying all FAQ sections, AIHelp supports displaying a FAQ section separately in some special scenarios.

This API requires the following parameters:

  • sectionId

    Required. This parameter is the ID of the FAQ section about to display, How to get this?

  • FaqConfig

    Optional. Configuration for FAQ module.

    Field Description Type
    showConversationMoment when to show conversation entrance in FAQ page ConversationMoment(always / never / after-marking-unhelpful)
    conversationConfig configuration for conversation system from FAQ page ConversationConfig(see end tab for details)

Note:

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.

You can show a specific FAQ question by calling this method.

This API requires the following parameters:

  • faqId

    Required. This parameter is the ID of the specific FAQ about to display, How to get this?

  • FaqConfig

    Optional. Configuration for FAQ module.

    Field Description Type
    showConversationMoment when to show conversation entrance in FAQ page ConversationMoment(always / never / after-marking-unhelpful)
    conversationConfig configuration for conversation system from FAQ page ConversationConfig(see end tab for details)

Note:

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 FAQ page.

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 examples #

Let’s assume a scenario.

A season is finally over. You configure a series of Season award related issues in the AIHelp dashboard, and then show them on the first screen of the game by FAQ, hoping to solve the problems that users may have.

At the same time, the game has different support and care schemes for different levels of users.

The details are as follows:

1、Users with level < 20 can only see the conversation entrance button after marking the FAQ unhelpful;

2、Users with level 20 < level < 50 can always see the conversation entrance button in the upper right corner of the FAQ page. After clicking this button, users can contact robot customer service by default. At the same time, the access to contact manual customer service is provided in the upper right corner of the robot page;

3、Users with level > 50 can always see the contact customer service button on the FAQ page. After clicking, they can directly contact manual customer service and display a special welcome message different from other users.

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

public void showAllFAQSections(int level) {
    FaqConfig.Builder faqBuilder = new FaqConfig.Builder();
    ConversationConfig.Builder conversationBuilder = new ConversationConfig.Builder();
    if (level < 50) {
        faqBuilder.setShowConversationMoment(ShowConversationMoment.AFTER_MARKING_UNHELPFUL);
    } else if (level < 100) {
        faqBuilder.setShowConversationMoment(ShowConversationMoment.ALWAYS);
        conversationBuilder.setAlwaysShowHumanSupportButtonInBotPage(true);
        faqBuilder.setConversationConfig(conversationBuilder.build());
    } else {
        faqBuilder.setShowConversationMoment(ShowConversationMoment.ALWAYS);
        conversationBuilder.setConversationIntent(ConversationIntent.HUMAN_SUPPORT);
        conversationBuilder.setWelcomeMessage("THIS IS YOUR SPECIAL WELCOME MESSAGE");
        faqBuilder.setConversationConfig(conversationBuilder.build());
    }
    AIHelpSupport.showAllFAQSections(faqBuilder.build());
}
- (void)showAllFAQSections:(int)level {
    AIHelpFAQConfigBuilder *faqBuilder = [[AIHelpFAQConfigBuilder alloc] init];
    AIHelpConversationConfigBuilder *conversationBuilder = [[AIHelpConversationConfigBuilder alloc] init];
    if (level < 50) {
        faqBuilder.showConversationMoment = AIHelpFAQShowConversationMomentAfterMarkingUnhelpful;
    }else if (level < 100) {
        faqBuilder.showConversationMoment = AIHelpFAQShowConversationMomentAlways;
        conversationBuilder.alwaysShowHumanSupportButtonInBotPage = YES;
        faqBuilder.conversationConfig = conversationBuilder.build;
    }else {
        faqBuilder.showConversationMoment = AIHelpFAQShowConversationMomentAlways;
        conversationBuilder.conversationIntent = AIHelpConversationIntentHumanSupport;
        conversationBuilder.welcomeMessage = @"THIS IS YOUR SPECIAL WELCOME MESSAGE";
        faqBuilder.conversationConfig = conversationBuilder.build;
    }
    [AIHelpSupportSDK showAllFAQSections: config:faqBuilder.build];
}
public void showAllFAQSections(int level) {
    FaqConfigBuilder faqBuilder = FaqConfigBuilder();
    ConversationConfigBuilder conversationBuilder = ConversationConfigBuilder();
    if (level < 50) {
        faqBuilder.setShowConversationMoment(ConversationMoment.AFTER_MARKING_UNHELPFUL);
    } else if (level < 100) {
        faqBuilder.setShowConversationMoment(ConversationMoment.ALWAYS);
        conversationBuilder.setAlwaysShowHumanSupportButtonInBotPage(true);
        faqBuilder.setConversationConfig(conversationBuilder.build());
    } else {
        faqBuilder.setShowConversationMoment(ConversationMoment.ALWAYS);
        conversationBuilder.setConversationIntent(ConversationIntent.HUMAN_SUPPORT);
        conversationBuilder.setWelcomeMessage("THIS IS YOUR SPECIAL WELCOME MESSAGE?");
        faqBuilder.setConversationConfig(conversationBuilder.build());
    }
    AIHelpSupport::showAllFAQSections(faqBuilder.build());
}
public void showAllFAQSections(int level) {
    FaqConfig.Builder faqBuilder = new FaqConfig.Builder();
    ConversationConfig.Builder conversationBuilder = new ConversationConfig.Builder();
    if (level < 50) 
    {
        faqBuilder.setShowConversationMoment(ConversationMoment.AFTER_MARKING_UNHELPFUL);
    } 
  	else if (level < 100) 
    {
        faqBuilder.setShowConversationMoment(ConversationMoment.ALWAYS);
        conversationBuilder.setAlwaysShowHumanSupportButtonInBotPage(true);
        faqBuilder.setConversationConfig(conversationBuilder.build());
    } 
  	else 
    {
        faqBuilder.setShowConversationMoment(ConversationMoment.ALWAYS);
        conversationBuilder.setConversationIntent(ConversationIntent.HUMAN_SUPPORT);
        conversationBuilder.setWelcomeMessage("THIS IS YOUR SPECIAL WELCOME MESSAGE");
        faqBuilder.setConversationConfig(conversationBuilder.build());
    }
    AIHelpSupport.showAllFAQSections(faqBuilder.build());
}
<script src="https://aihelp.net/webchat/aihelp.js"></script>
<script>
    // Example for showAllFAQSections case
    (function () {
        var supportConfig = {};
        if (level < 20) {
            supportConfig['showConversationMoment'] = 3; // 3 for after marking unhelpful
        } else if (level < 50) {
            supportConfig['showConversationMoment'] = 1; // 1 for always
            supportConfig['alwaysShowHumanSupportButtonInBotPage'] = true;
        } else {
            supportConfig['showConversationMoment'] = 1; // 1 for always
            supportConfig['conversationIntent'] = 2; // 2 for manual support
            supportConfig['welcomeMessage'] = 'THIS IS YOUR SPECIAL WELCOME MESSAGE';
        }
        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: 'showAllFAQSections',
            supportConfig: supportConfig,
            userConfig: {userId: "", customData: {}}
        }
        if (typeof AIHelpSupport !== undefined) AIHelpSupport.init(initConfig);
    })();
    function openAIHelp() {
        if (typeof AIHelpSupport !== undefined) AIHelpSupport.show();
    }
</script>

Page examples #

Page examples based on the above scenario are as follows:

Remark #

  • FAQ Section ID

  • Specific FAQ ID