WORKPLACE Summary
- Print
- PDF
WORKPLACE Summary
- Print
- PDF
Article Summary
Share feedback
Thanks for sharing your feedback!
Summary
It provides an API that enables you to set departments, employees, job grades, job titles, and basic information in WORKPLACE.
It is done through the HTTP method POST/PUT/DELETE method call.
Common Attributes
Workplace URL
POST/PUT/DELETE
https://workplace.apigw.ntruss.com/organization/apigw/v1
Request Header
Header | 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 invalid. |
x-ncp-iam-access-key | * Access key ID issued on the NAVER Cloud Platform portal or by Sub Account |
x-ncp-apigw-signature-v2 | * A signature that encrypts the body of the example above with the secret key mapped to the access key ID * Uses HmacSHA256 for the HMAC encryption algorithm |
AUTHPARAMS request example
curl -i -X GET \ -H "x-ncp-apigw-timestamp:1505290625682" \ -H "x-ncp-iam-access-key:D78BB444D6D3C84CA38D" \ -H "x-ncp-apigw-signature-v2:WTPItrmMIfLUk/UyUIyoQbA/z5hq9o3G8eQMolUzTEa=" \ 'https://workplace.apigw.ntruss.com/organization/apigw/v2/company/c1798784-9a47-4751-ab9f-b9629825ab93/department?offset=0&limit=10'
Create signature
- Use
\n
as new line character. - Create StringToSign matching the request, encrypt using SecretKey with HmacSHA256 algorithm, and encode using Base64.
- This value is used for x-ncp-apigw-signature-v2.
CautionThe x-ncp-apigw-timestamp value of the request header and timestamp of StringToSign must be an identical value.
- Use
Requested | StringToSign |
---|---|
GET /organization/apigw/v2/company/c1798784-9a47-4751-ab9f-b9629825ab93/department?offset=0&limit=10 x-ncp-apigw-timestamp={timestamp} x-ncp-iam-access-key={accesskey} x-ncp-apigw-signature-v2={signature} | GET /organization/apigw/v2/company/c1798784-9a47-4751-ab9f-b9629825ab93/department?offset=0&limit=10 {timeStamp} {accessKey} |
- Request examples
public String makeSignature() {
String space = " "; // one space
String newLine = "\n"; // new line
String method = "GET"; // method
String url = "/organization/apigw/v2/company/c1798784-9a47-4751-ab9f-b9629825ab93/department?offset=0&limit=10"; // 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 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.encodeBase64String(rawHmac);
return encodeBase64String;
}
Common Errors
Response status code example
HTTP status code | Response message | Description |
---|---|---|
200 | OK | General successful request |
201 | Created | Response code for successful resource creation |
400 | Bad Request | Used for general request failure |
500 | Internal Server Error |
Scope of error codes returned from status codes in the 400 range
Scope of error codes | Description |
---|---|
From -1000 to -1999 | Common |
From -2000 to -2999 | Management service |
From -4000 to -4999 | Member service |
From -5000 to -5999 | Accounting service |
From -6000 to -6999 | Expense service |
From -7000 to -7999 | Common Data service |
From -8000 to -8999 | Pledge service |
From -9000 to -9999 | Sales service |
From -10000 to -10999 | Account service |
From -11000 to -11999 | System service |
From -12000 to -12999 | Attendance service |
From -13000 to -13999 | Electronic Tax Invoice service |
From -14000 to -14999 | Post service |
From -15000 to -15999 | Common UI service |
From -16000 to -16999 | Alarm service |
From -17000 to -17999 | HR service |
From -18000 to -18999 | Service Connector service |
From -19000 to -19999 | Expenditure service |
From -20000 to -20999 | Payroll service |
From -21000 to -21999 | Budget service |
From -99000 to -99999 | User service |
In case of errors, the HTTP status code is returned to the 400 range, and the Body information is forwarded in the following format.
{
"status": 400,
"code": -1015,
"message": "emp not found",
"errors": [],
}
Was this article helpful?