Glossary overview
    • PDF

    Glossary overview

    • PDF

    Article Summary

    Overview

    When using Papago Text Translation, a glossary feature is provided to help maintain consistency in translation.
    The glossary can be managed through the console screen or API. The following is a guide on how to use the glossary API.
    For how to use the console, see the Glossary user guide.

    Common settings

    API URL

    https://papago.apigw.ntruss.com/glossary/v1
    

    Request headers

    Header nameDescription
    x-ncp-apigw-timestampTime elapsed in milliseconds since January 1, 1970, 00:00:00 UTC
    If the time differs from that of the API Gateway server by 5 minutes or more, then the request is considered invalid
    x-ncp-apigw-timestamp:{Timestamp}
    x-ncp-iam-access-keyAccess key ID value issued from NAVER Cloud Platform portal
    x-ncp-iam-access-key:{Main Account Access Key}
    x-ncp-apigw-signature-v2Signature encrypted with the Access Key ID value and Secret Key
    x-ncp-apigw-signature-v2:{API Gateway Signature}

    Go to the creation guide of NAVER Cloud Platform authentication key and signature
    Here is an example of generating 'x-ncp-apigw-signature-v2' in Java.
    For details, see the document below.

    public String makeSignature() {
        String space = " ";                      // one space
        String newLine = "\n";                   // new line
        String method = "POST";                  // method
        String url = "/glossary/v1";             // url (include query string)
        String timestamp = "{timestamp}";        // current timestamp (epoch)
        String accessKey = "{accessKey}"         // access key id (from portal or sub account)
        String secretKey = "{secretKey}";
        String algorithm = "HmacSHA256";
     
        String message = new StringBuilder()
            .append(method)
            .append(space)
            .append(url)
            .append(newLine)
            .append(timestamp)
            .append(newLine)
            .append(accessKey)
            .toString();
      
        try{
            SecretKeySpec signingKey = new SecretKeySpec(secretKey.getBytes("UTF-8"),  algorithm);
            Mac mac = Mac.getInstance(algorithm);
            mac.init(signingKey);
      
            byte[] rawHmac = mac.doFinal(message.getBytes("UTF-8"));
            return org.apache.commons.codec.binary.Base64.encodeBase64String(rawHmac);
        } catch (InvalidKeyException | NoSuchAlgorithmException e) {
            throw new RuntimeException("make Signature failed");
        }  
    }
    

    Features provided by API


    Was this article helpful?

    Changing your password will log you out immediately. Use the new password to log back in.
    First name must have atleast 2 characters. Numbers and special characters are not allowed.
    Last name must have atleast 1 characters. Numbers and special characters are not allowed.
    Enter a valid email
    Enter a valid password
    Your profile has been successfully updated.