Updated on 2023-09-20 GMT+08:00

Adding Business Interfaces

According to the analysis in Configuration Scenario, you need to add multiple business interfaces. All the business interfaces are used in cache variable mode, and no real interface is invoked. If you need to invoke a real interface in actual scenarios, refer to this section.

The business interface orchestration capability is insufficient. Therefore, in actual applications, the interface adaptation team must provide the invoked interfaces to prevent the interface definition differences between different systems.

For example, if we need to invoke an interface to obtain the values of two parameters from two interfaces in the actual business system, the interfaces need to be orchestrated to one interface for invocation.

Procedure

  1. Choose Configuration Center > Flow Configuration > Intelligent IVR.
  2. Contact the system administrator to add the IP address or domain name of the third-party interface to be invoked to the trustlist.
  3. Choose Resource Management > Business Interface. Click Add.
  4. Add an interface by automatically generating a message body or manually entering a message body. The following describes how to add an interface in either of the two ways.
  5. Add an interface by automatically generating a message body.

    1. On the Automatic Message Body tab page, set basic information about the interface to be invoked, including the interface name, request method, and request URL.

      • When Request Method is set to TUC, enter one of the following URLs in the Request URL text box based on site requirements. For details about the input and output parameters of the interface, see TUC Interfaces.
        Table 1 Request URLs when Request Method is set to TUC

        URL

        Description

        /chatbot/rest/tuc/v1/nlp/detectRegularEntity

        Rule entity detection used in the case flow.

        /chatbot/rest/tuc/v1/nlp/identify

        Language interface.

        /chatbot/rest/tuc/v1/recommendFaq

        FAQ recommendation interface.

        /chatbot/rest/tuc/v1/qualityInspection/qiOnline/recognize

        Interface for intelligent assistant real-time inspection.

        /chatbot/rest/tuc/v1/nlp/feedback

        Satisfaction feedback interface.

        /chatbot/rest/tuc/v1/nlp/textClassify

        Text classification interface.

        /chatbot/rest/tuc/v1/nlp/detectEntity

        Entity recognition interface.

        /chatbot/rest/tuc/v1/qualityInspection

        Intelligent training interface.

        HTTP is not secure and may cause security risks. HTTPS is recommended.

      • Sign: Set this parameter based on whether signature verification is performed on the third-party interface. If signature verification is enabled, contact the third party to provide the shared key.
        • If signature verification is disabled, security risks exist. You are advised to enable signature verification.
        • If signature verification is enabled, after the shared key provided by the third party is changed periodically, change the shared key on this page accordingly.
    2. (Optional) If the interface has query parameters, add the query parameters, that is, Interface request URL?Path parameter 1=Parameter value&Path parameter 2=Parameter value.
    3. Add interface input parameters. On the Input Parameter tab page, click Add. Generally, the input parameters of the interface are the same as those of the third-party system interface specifications.

      For security purposes, set Encrypted to YES if the input parameter contains personal data, such as the customer ID card number.

    4. Add interface output parameters. On the Output Parameter tab page, click Add. The output parameters of the interface are the same as those of the third-party system interface specifications.

      For security purposes, set Encrypted to YES if the output parameter contains personal data, such as the customer ID card number.

      The following figure shows how to set Path. To obtain the entire return result, set Path to $. To obtain a field, add $ at the beginning and use periods (.) to separate each level. The level structure must be the same as the structure of the return result. Otherwise, the parsing fails, or the required field cannot be obtained.

      Figure 1 Output parameter configuration example
    5. (Optional) Add an interface message header. On the Message Header tab page, add the authentication information required by the interface. If the information does not exist, ignore this step. The authentication information is configured based on the specifications of the third-party system.

      For security purposes, set Encrypted to YES if the interface message header contains personal data, such as the customer ID card number.

    6. On the Message Body tab page, view the automatically generated message body. You can copy the generated message to the commissioning tool to check whether the interface can be invoked successfully.
    7. Click Confirm.

  6. Add an interface by manually entering a message body.

    1. Click the Manual Message Body tab. Set basic information about the interface to be invoked, including the interface name, request method, and request URL. For details about the parameters, see 5.a.
    2. (Optional) If the interface has query parameters, add the query parameters, that is, Interface request URL?Path parameter 1=Parameter value&Path parameter 2=Parameter value.
    3. Add interface output parameters. On the Output Parameter tab page, click Add. The output parameters of the interface are the same as those of the third-party system interface specifications.

      For security purposes, set Encrypted to YES if the output parameter contains personal data, such as the customer ID card number.

      The following figure shows how to set Path. To obtain the entire return result, set Path to $. To obtain a field, add $ at the beginning and use periods (.) to separate each level. The level structure must be the same as the structure of the return result. Otherwise, the parsing fails, or the required field cannot be obtained.

      Figure 2 Output parameter configuration example
    4. (Optional) Add an interface message header. On the Message Header tab page, add the authentication information required by the interface. If the information does not exist, ignore this step. The authentication information is configured based on the specifications of the third-party system.

      For security purposes, set Encrypted to YES if the interface message header contains personal data, such as the customer ID card number.

    5. Add a message body. On the Message Body tab page, enter the request message body. The following is an example:
      {
          "callId": "${businessReqId}",
          "provId": "202205130514",
          "busiType": "0",
          "params": {
              "tenantId": "${tenantId}"
          }
      }

      If a message body is manually entered, the input parameters cannot be manually added. Instead, the input parameters are automatically generated by parsing the message body content. In the preceding example, two input parameters businessReqId and tenantId are generated. The input parameters businessReqId and tenantId can be variables that need to be transferred when the interface is invoked in the subsequent flow.

    6. Click Confirm.