CLOVA Chatbot overview

Prev Next

Available in Classic and VPC

CLOVA Chatbot is a NAVER Cloud Platform service that identifies the intent of the user's question and provides appropriate answers in various formats. The CLOVA Chatbot Custom API provides an API for the question and answer feature in RESTful form based on the training results of the domain set in CLOVA Chatbot Builder, and is suitable if you want to implement a chatbot on the general web or app instead of the messenger channel.
This guide describes how to send a request to CLOVA Chatbot from a Custom channel.

CLOVA Chatbot integration and development process

This section describes the process for Custom integration and development of CLOVA Chatbot.

Integration process

The integration process is as follows.

  1. Create a conversation scenario using the CLOVA Chatbot Builder.
  2. Build and deploy the conversation model.
  3. Set up CLOVA Chatbot Custom integration.
  4. Create an API Gateway call URL and issue a secret key.
  5. Call the API from the application with the API Gateway invoke URL.

Development process

The development process is as follows.

  1. Check the API Gateway invoke URL.
  2. Create a signature to generate the authentication key to pass in the request header.
    • Use the secret key generated in * CLOVA * Chatbot Custom.
  3. Create a response body value to request a conversation query.
  4. Make a request using the API Gateway invoke URL.

Common CLOVA Chatbot settings

The following describes commonly used request and response formats in CLOVA Chatbot Custom APIs.

Request

The following describes the common request format.

API URL

The request API URL is as follows.

API Gateway's unique invoke URL created in CLOVA Chatbot Builder

Request headers

The following describes the headers.

Field Required Description
X-NCP-CHATBOT_SIGNATURE Required Base64-encoded signature that encrypts the request information with a secret key and request body created on NAVER Cloud Platform's CLOVA Chatbot Custom, using the HMAC encryption algorithm (HmacSHA256)
  • Issue and check secret key: See How to issue and check secret key
  • Create signature: See X-NCP-CHATBOT_SIGNATURE creation examples
  • Content-Type Required Request data type

    How to issue and check secret key

    The following describes how to issue or check the secret key in CLOVA Chatbot.

    1. From the NAVER Cloud Platform console, click the Services > CLOVA Chatbot > Domain menus, in that order.
    2. Click the [Run builder] button of the domain you want to run the chatbot builder.
    3. From the chatbot builder, click [Chatbot settings] button.
    4. From the chatbot settings, click the Integrate messenger tab.
    5. Under the Custom item, click the [Integrate] button.
    6. Issue or check the secret key in the Integrate Custom pop-up.

    X-NCP-CHATBOT_SIGNATURE creation examples

    The following are examples of language-specific X-NCP-CHATBOT_SIGNATURE settings.

    • JavaScript

      const HmacSHA256 = require('crypto-js/hmac-sha256');
      const EncBase64 = require('crypto-js/enc-base64');
      signatureHeader = HmacSHA256(requestBodyString, secretKey).toString(EncBase64);
      
    • Java

      byte[] secretKeyBytes = secretKey.getBytes(StandardCharsets.UTF_8);
      SecretKeySpec secretKeySpec = new SecretKeySpec(secretKeyBytes, "HmacSHA256");
      Mac mac = Mac.getInstance("HmacSHA256");
      mac.init(secretKeySpec);
      byte[] signature = mac.doFinal(body.getBytes(StandardCharsets.UTF_8));
      String signatureHeader = Base64.getEncoder().encodeToString(signature);
      

    Response

    The following describes the common response format.

    Response status codes

    The following describes the response status codes.

    Note

    For response status codes common to NAVER Cloud Platform, see Ncloud API response status codes.

    HTTP status code Code Message Description
    500 - Internal server error Internal server errors
    - 1000 version not support Unsupported version
    - 1001 Not found domain code Domain code not found
    - 1002 check url param is invalid Invalid URL parameter
    - 4000 request param invalid Invalid request parameter
    - 4010 Unauthorized Not authenticated
    - 4030 Forbidden to access Access unauthorized
    - 4031 Signature validate failed Signature validation failed
    - 4032 timestamp exceeded time window(10000ms) Allowed time range (10000 ms) exceeded
    - 5000 Unknown service error Unknown service error
    - 5010 Current protocol version not support this reply structure Current protocol version does not support this response structure
    - 5020 Calls to this api have exceeded the rate limit API call count limit exceeded

    CLOVA Chatbot Custom API

    The following describes the APIs provided by the CLOVA Chatbot Custom service.

    API Description
    Open Open the welcome message of CLOVA Chatbot
    Send Send questions to CLOVA Chatbot
    getPersistentMenu Get the list of persistent menus

    CLOVA Chatbot related resources

    NAVER Cloud Platform provides a variety of related resources to help users better understand CLOVA Chatbot Custom APIs.