WORKPLACE Summary
    • PDF

    WORKPLACE Summary

    • PDF

    Article Summary

    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

    HeaderDescription
    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.
      Caution

      The x-ncp-apigw-timestamp value of the request header and timestamp of StringToSign must be an identical value.

    RequestedStringToSign
    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 codeResponse messageDescription
    200OKGeneral successful request
    201CreatedResponse code for successful resource creation
    400Bad RequestUsed for general request failure
    500Internal Server Error
  • Response code for general server error
  • 4xx error codes are used to represent client-side errors.
  • 5xx error codes are used to represent server-side errors.

  • Scope of error codes returned from status codes in the 400 range

    Scope of error codesDescription
    From -1000 to -1999Common
    From -2000 to -2999Management service
    From -4000 to -4999Member service
    From -5000 to -5999Accounting service
    From -6000 to -6999Expense service
    From -7000 to -7999Common Data service
    From -8000 to -8999Pledge service
    From -9000 to -9999Sales service
    From -10000 to -10999Account service
    From -11000 to -11999System service
    From -12000 to -12999Attendance service
    From -13000 to -13999Electronic Tax Invoice service
    From -14000 to -14999Post service
    From -15000 to -15999Common UI service
    From -16000 to -16999Alarm service
    From -17000 to -17999HR service
    From -18000 to -18999Service Connector service
    From -19000 to -19999Expenditure service
    From -20000 to -20999Payroll service
    From -21000 to -21999Budget service
    From -99000 to -99999User 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?

    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.