Edit Employment Types

    Edits employment types.

    Note

    • The useEmploymentType parameter for the domain should be set to "true" to edit employment types.

    Caution

    • The previous data remains the same if the parameter is null, or is all deleted if the parameter is empty (such as "" in String or [] in List).

    • Example) Where the previous value of the i18nNames parameter is [{"name": "aa", "language": "ko_KR"}, {"name": "bb", "language": "en_US"}],

      • If the parameter is null, the previous data, [{"name": "aa", "language": "ko_KR"}, {"name": "bb", "language": "en_US"}] remains the same.
      • If the parameter is empty, the previous data is deleted.
      • If the parameter is set to [{"name": "cc", "language": "ko_KR"}], the previous data is changed to [{"name": "cc", "language": "ko_KR"}].

    API Type

    Server API

    Request URL

    • Live environment: https://apis.worksmobile.com/r/{API ID}/organization/v2/domains/{domainId}/employtypes/{externalKey}
    • Testing environment: https://sandbox-apis.worksmobile.com/r/{API ID}/organization/v2/domains/{domainId}/employtypes/{externalKey}

    HTTP Method

    PATCH (Content-Type: application/json; charset=UTF-8)

    Path Parameters

    Parameter Type Length Required Description
    domainId Integer Y Domain ID
    externalKey String 100자 Y An external key for employment types

    Request Body

    Parameter Type Length Required Description
    name String 100 characters Y Employment type name.
    It must be unique in the domain.
    The following special characters are allowed: !@&()-_+[]{},./
    sortLevel Integer Y Sort order.
    A negative number or duplicate number is allowed. Based on this value, employment types are sorted in ascending order.
    i18nNames List N Names by language code.
    Refer to Language/Timezone Code.
       name String 100 characters Y Name.
    The following special characters are allowed: !@&()-_+[]{},./
       language String Y Language

    Request Example

    PATCH https://apis.worksmobile.com/r/apiid/organization/v2/domains/123/employtypes/EX123
    
    {
        "name": "아르바이트",
        "sortLevel": 5,
        "i18nNames": [
            {
              "name":"アルバイト",
              "language":"ja_JP"
            },
            {
              "name":"Contract Employee",
              "language":"en_US"
            },
            {
              "name":"合同员工",
              "language":"zh_CN"
            },
            {
              "name":"合同員工",
              "language":"zh_TW"
            }
        ]
    }
    

    Response

    It returns HTTP status 200 with properties of the edited employment type as a response when the API call is successful.

    Response Example

    {
        "name": "아르바이트",
        "externalKey": "EX123",
        "sortLevel": 5,
        "i18nNames": [
            {
              "name":"アルバイト",
              "language":"ja_JP"
            },
            {
              "name":"Contract Employee",
              "language":"en_US"
            },
            {
              "name":"合同员工",
              "language":"zh_CN"
            },
            {
              "name":"合同員工",
              "language":"zh_TW"
            }
        ]
    }
    

    Error Code

    It returns an error code and message when the API call fails.
    Refer to Organization Integration REST API Error Codes for details.