Update or replace enumeration values of a property

put

/rest/ofscMetadata/v1/properties/{label}/enumerationList

This operation updates or replaces the enumeration values of the specified property.

The operation is applicable only for properties of type 'enumeration'.

Consider the following while updating the enumeration values of a property:

  • The specified property must exist in Oracle Field Service Cloud.
  • The enumeration values cannot be deleted.
  • The property 'country_code' cannot be updated using this operation, though the property is of type enumeration.
  • The field 'label' cannot be set to '-1' or '0'.
  • The English translation for each enumeration value is required and cannot be cleared.

Request

Path Parameters
  • Minimum Length: 1
    Maximum Length: 40
    The label of the property.
Body ()
The property enumerations object that needs to be updated.
Root Schema : schema
Type: array
Show Source
  • Items
    Title: Items
    An array of enumeration values.

    Note: At least one item in the array should be active.

Nested Schema : Items
Type: array
Title: Items
An array of enumeration values.

Note: At least one item in the array should be active.

Show Source
Nested Schema : Property Enumeration
Type: object
Title: Property Enumeration
Show Source
  • Title: Active
    Contains one of the following values: true or false. If true, then the enumeration item is active. If false, then then the enumeration item is inactive.
  • Title: Label
    Minimum Length: 1
    Maximum Length: 255
    The code of the enumeration item. This code is unique only to the specified property. The values '0' and '-1' are reserved for internal purposes and cannot be used. The values cannot be changed or deleted.
  • Translations
    Title: Translations
    An array containing the translations of the enumeration item in different languages.
Nested Schema : Translations
Type: array
Title: Translations
An array containing the translations of the enumeration item in different languages.
Show Source
Nested Schema : Translation
Type: object
Show Source
  • This field contains language code of a text translation, it conatains two characters length code in responses (e.g. 'en', 'es') but can be used in requests as extended ISO code (e.g. 'en-US') as well as old two character format.
  • This field is used only in responses and returns ISO language code (e.g. 'en-US'). This field is ignored in the requests (use 'language' instead)
Back to Top

Response

Supported Media Types

200 Response

This section describes the 200 status response for this operation.
Body ()
Root Schema : Property Enumeration
Type: object
Title: Property Enumeration
Show Source
  • Title: Active
    Contains one of the following values: true or false. If true, then the enumeration item is active. If false, then then the enumeration item is inactive.
  • Title: Label
    Minimum Length: 1
    Maximum Length: 255
    The code of the enumeration item. This code is unique only to the specified property. The values '0' and '-1' are reserved for internal purposes and cannot be used. The values cannot be changed or deleted.
  • Translations
    Title: Translations
    An array containing the translations of the enumeration item in different languages.
Nested Schema : Translations
Type: array
Title: Translations
An array containing the translations of the enumeration item in different languages.
Show Source
Nested Schema : Translation
Type: object
Show Source
  • This field contains language code of a text translation, it conatains two characters length code in responses (e.g. 'en', 'es') but can be used in requests as extended ISO code (e.g. 'en-US') as well as old two character format.
  • This field is used only in responses and returns ISO language code (e.g. 'en-US'). This field is ignored in the requests (use 'language' instead)

Default Response

This section describes the default error response for this operation.
Body ()
Root Schema : Error
Type: object
Error response
Show Source
Back to Top

Examples

The following example shows how to update or replace the enumeration of property's by submitting a PUT request on the REST resource.

Example of Request Header

The following shows an example of the request header.

curl -u 'clientId@instanceName:clientSecret' \
-X PUT \
--url 'https://<instance_name>.etadirect.com/rest/ofscMetadata/v1/properties/someEnumPropertyLabel/enumerationList' \
-d '{
    "items": [
        {
            "label": "code1",
            "active": true,
            "translations": [
                {
                    "language": "en",
                    "name": "Code 1"
                }
            ]
        },
        {
            "label": "code2",
            "active": true,
            "translations": [
                {
                    "language": "en",
                    "name": "Code 2"
                }
            ]
        }
    ]
}'

Example of Response Body

The following example shows the contents of the response body in JSON format.

HTTP/1.1 200 OK

{
    "items": [
        {
            "label": "code1",
            "active": true,
            "translations": [
                {
                    "language": "en",
                    "name": "Code 1"
                }
            ]
        },
        {
            "label": "code2",
            "active": true,
            "translations": [
                {
                    "language": "en",
                    "name": "Code 2"
                }
            ]
        }
    ]
}
Back to Top