用語集の概要
    • PDF

    用語集の概要

    • PDF

    Article Summary

    概要

    Papago Text Translation使用時、翻訳の一貫性維持に役立つ用語集(Glossary)機能を提供します。
    用語集はコンソール画面または APIで管理でき、用語集 APIご利用ガイドの説明は次のとおりです。
    コンソールの利用方法は用語集のユーザーガイドをご参照ください。

    共通設定

    API URL

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

    リクエストヘッダ

    ヘッダ名説明
    x-ncp-apigw-timestamp1970年1月1日 00:00:00協定世界時(UTC)からの経過時間をミリ秒(Millisecond)で示したもの
    API Gatewayサーバとの時間差が5分以上の場合は無効なリクエストとみなす
    x-ncp-apigw-timestamp:{Timestamp}
    x-ncp-iam-access-keyNAVERクラウドプラットフォームポータルで発行された Access Key ID値
    x-ncp-iam-access-key:{Main Account Access Key}
    x-ncp-apigw-signature-v2Access Key ID値と Secret Keyで暗号化した署名
    x-ncp-apigw-signature-v2:{API Gateway Signature}

    NAVERクラウドプラットフォームコンソール認証キーおよび Signature作成ガイドのショートカット
    以下は Javaで 'x-ncp-apigw-signature-v2'を作成する例です。
    詳細については以下のドキュメントをご参照ください。

    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");
        }  
    }
    

    API提供機能


    この記事は役に立ちましたか?

    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.