WORKBOX Overview
- Print
- PDF
WORKBOX Overview
- Print
- PDF
Article summary
Did you find this summary helpful?
Thank you for your feedback
Overview
WORKBOX API enables you to set departments, members, job grades, job titles and basic information in the WORKBOX service, using HTTP POST, PUT and DELETE methods.
Common information
WORKBOX URL
POST/PUT/DELETE
https://workbox.apigw.ntruss.com/workbox/workbox/openapi/v1
Request header
Header | Description |
---|---|
x-ncp-apigw-timestamp | It is the number of milliseconds that have elapsed since January 1, 1970 00:00:00 UTC. If the time difference with the API Gateway server is more than 5 minutes, the request is considered invalid. x-ncp-apigw-timestamp:{Timestamp} |
x-ncp-apigw-api-key | API key issued by API Gatewayx-ncp-apigw-api-key:{API Gateway API Key} |
x-ncp-iam-access-key | Access Key ID issued from the NAVER CLOUD PLATFORM portal. x-ncp-iam-access-key:{Account Access Key} |
x-ncp-apigw-signature-v1 | Signature encrypted with your Access Key ID and Secret Key. x-ncp-apigw-signature-v1:{API Gateway Signature} |
Content-Type | Set the request body content type to application/json.Content-Type: application/json |
Authorization header
The WORKBOX API is provided via NAVER CLOUD PLATFORM’s API Gateway, which requires you to get three authentication keys, Access Key ID
, Secret Key
, and API Key
.
For more information, refer to NAVER Cloud Platform API.
- Create authentication keys
- Go to My Page > Manage Account > Manage Auth Key on NAVER CLOUD PLATFORM’s portal, and click Create a New API Authentication Key to create an
Access Key ID
andSecret Key
- You can use your existing
Access Key ID
andSecret Key
.
- Go to My Page > Manage Account > Manage Auth Key on NAVER CLOUD PLATFORM’s portal, and click Create a New API Authentication Key to create an
Request example
curl -i -X GET \
-H "x-ncp-apigw-timestamp:1505290625682" \
-H "x-ncp-apigw-api-key:cstWXuw4wqp1EfuqDwZeMz5fh0epaTykRRRuy5Ra" \
-H "x-ncp-iam-access-key:D78BB444D6D3C84CA38A" \
-H "x-ncp-apigw-signature-v1:WTPItrmMIfLUk/UyUIyoQbA/z5hq9o3G8eQMolUzTEo=" \
'https://workplageg.apigw.ntruss.com//calendar/v1/holiday?year=2018&locale=ko_KR&companyId=e721e2da-29ee-4782-9672-3d2b150ac1a6'
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
- Use this value as
x-ncp-apigw-signature-v1
.
Sample code
public String makeSignature() {
String space = " "; // Empty space
String newLine = "\n"; // Line break
String method = "GET"; // HTTP method
String url = "/calendar/v1/holiday?year=2018&locale=ko_KR&companyId=e721e2da-29ee-4782-9672-3d2b150ac1a6"; // Full URL under "/", except for the domain (including query strings)
String timestamp = "{timestamp}"; // Current time stamp (epoch, millisecond)
String apiKey = "{apiKey}"; // api key (from api gateway)
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(apiKey)
.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.encodeBase64String(rawHmac);
return encodeBase64String;
}
Common errors
It returns an HTTP status code in the response body.
Parameter | Description |
---|---|
resultCode | Error code |
resultMessage | Error description |
Error code | Description |
---|---|
E900 | Path parameter error |
E901 | WORKBOX > Developers API On or Off |
E902 | Body parameter error |
E903 | Basic settings is set to NO. |
E904 | externalKey validation error |
E1001 | Internal server error |
E1003 | Failed to upload photo files. |
{
"resultCode": "E901",
"resultMessage": "Please check if API is used in the developer console."
}
HTTP status code | Response message | Description |
---|---|---|
200 | OK | Success |
201 | Created | Resource successfully created. |
400 | Bad Request | Failure (It is usually used to respond to the request format that the server cannot understand.) |
500 | Internal Server Error | General server error. Whereas 4XX error codes represent client-side errors, 5XX error codes represent server-side errors. |
Was this article helpful?