Glossary overview
- Print
- PDF
Glossary overview
- Print
- PDF
Article Summary
Share feedback
Thanks for sharing your feedback!
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 name | Description |
---|---|
x-ncp-apigw-timestamp | Time 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-key | Access key ID value issued from NAVER Cloud Platform portalx-ncp-iam-access-key:{Main Account Access Key} |
x-ncp-apigw-signature-v2 | Signature encrypted with the Access Key ID value and Secret Keyx-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?