Format of Enumeration Values

Prior to 2021.1, the values of enumerator fields were returned in an enumeration-key format, and the internal ID of the enumerator field was used in the REST response. As of 2021.1, both the internal ID and the UI label of enumerator fields are returned by default. You can use the simpleEnumFormat query parameter to control the format in which enumerator field values are returned. If the simpleEnumFormat parameter is not used or it is set to false, enumerator field values are returned in the new format. If the simpleEnumFormat parameter is set to true, only the internal ID of the enumerator field is returned.

The following example shows a response returned in the new format.

          GET /record/v1/contact/81
{
"globalSubscriptionStatus": {
"id": "2",
"refName": "Soft Opt-Out"
}
} 

        

The following example shows a request where the simpleEnumFormat query parameter is set to true to specify that the response should be returned in the response format that was used prior to 2021.1.

          GET /record/v1/contact/81?simpleEnumFormat=true
{
    ...  
 
    "globalSubscriptionStatus": "2"
 
    ...
} 

        

Additionally, as of 2021.1, when you use the POST, PATCH, and PUT operations, you can specify enumerator field values in the REST request body in both formats, by using internal IDs and reference names. Prior to 2021.1, the field values could only be changed by using internal IDs. You should start using the new format, and use reference names in POST, PATCH and PUT requests.

The following example shows a POST request using the new format.

          POST /record/v1/contact/81

{
"globalSubscriptionStatus": {
"refName": "Soft Opt-Out"
}
} 

        

Related Topics

Getting a Record Instance
Format of Sublists and Subrecords
Format of Selects and References
Format of Multiselects

General Notices