Cloud Data Box overview
- Print
- PDF
Cloud Data Box overview
- Print
- PDF
Article summary
Did you find this summary helpful?
Thank you for your feedback
The latest service changes have not yet been reflected in this content. We will update the content as soon as possible. Please refer to the Korean version for information on the latest updates.
Overview
The Cloud Data Box API is provided in RESTful form. It is done through the HTTP method GET/POST/DELETE method call.
Data Box file import is executed via API.
Common settings
Cloud Data Box API Endpoint
Regions | Endpoint |
---|---|
Korea (KR) | https://databox.apigw.ntruss.com/api/v1 |
Request Headers
Header name | Description |
---|---|
x-ncp-apigw-timestamp | This is the number of milliseconds that have elapsed since January 1, 1970 00:00:00 UTC. If the time difference compared to the API Gateway server is more than 5 minutes, then the request is considered invalidx-ncp-apigw-timestamp:{Timestamp} |
x-ncp-iam-access-key | Access key ID value issued on NAVER Cloud Platform portalx-ncp-iam-access-key:{Account Access Key} |
x-ncp-apigw-signature-v2 | The signature encrypted with access key ID value and secret keyx-ncp-apigw-signature-v2:{API Gateway Signature} |
x-ncp-lang | A value for multilingual processing of API response values. (Example of input values: ko-KR, en-US, and zh-CN / Default: en-US)x-ncp-lang:{language code} |
Authentication header
The Data Box API is provided via NAVER Cloud Platform API Gateway, which requires you to get 2 authentication keys (Access key ID and secret key).
For more information, see NAVER Cloud Platform API Guide.
- Create authentication key
- Go to My Page > Manage Account > Manage Authentication Key on NAVER Cloud Platform portal, and then click Create a new API authentication key to create an access key ID and secret key
- You can use your existing access key ID and secret key.
Request examples
curl -X GET "https://databox.apigw.ntruss.com/api/v1/import/get-bucket-list" -H "accept: application/json" -H "x-ncp-iam-access-key: ft1GKEpjSc53lHuqtAxE" -H "x-ncp-apigw-timestamp: 1699857251740" -H "x-ncp-apigw-signature-v2: CsVRem0Sn4ToxvxfIcd8/CiIxx7GjQNXrL5075BVTdY=" -H "cache-control: no-cache" -H "pragma: no-cache"
Create a signature (add a new line with
\n
)- Create a StringToSign appropriate for your request, encrypt it with your secret key and the HMACSHA256 algorithm, and encode it with Base64
- This value is used as
x-ncp-apigw-signature-v2
.
Sample code
public String makeSignature() {
String space = " "; // Space
String newLine = "\n"; // Line break
String method = "POST"; // HTTP method
String url = "/api/v1/mails"; // Full URL under "/" (including query strings), excluding the domain
String timestamp = "{timestamp}"; // Current timestamp (epoch, millisecond)
String accessKey = "{accessKey}"; // access key id (from portal or sub account)
String secretKey = "{secretKey}"; // secret key (from portal or sub account)
String message = new StringBuilder()
.append(method)
.append(space)
.append(url)
.append(newLine)
.append(timestamp)
.append(newLine)
.append(accessKey)
.toString();
SecretKeySpec signingKey = new SecretKeySpec(secretKey.getBytes("UTF-8"), "HmacSHA256");
Mac mac = Mac.getInstance("HmacSHA256");
mac.init(signingKey);
byte[] rawHmac = mac.doFinal(message.getBytes("UTF-8"));
String encodeBase64String = Base64.getEncoder().encodeToString(rawHmac);
return encodeBase64String;
}
function makeSignature() {
$space = " "; // Space
$newLine = "\n"; // Line break
$method = "POST"; // HTTP method
$uri = "/api/v1/mails"; // Full URL under "/" (including query strings), excluding the domain
$timestamp = "{timestamp}"; // Current timestamp (epoch, millisecond)
$accessKey = "{accessKey}"; // access key id (from portal or sub account)
$secretKey = "{secretKey}"; // secret key (from portal or sub account)
$hmac = $method.$space.$uri.$newLine.$timestamp.$newLine.$accessKey;
$signautue = base64_encode(hash_hmac('sha256', $hmac, $secretKey,true));
return $signautue;
}
Operation
Import
Object Storage-Bucket
Was this article helpful?