How do I set the value of a menu type custom field using the Rest API functionality?
Environment
Oracle B2C Service
All releases
Resolution
When setting the value of a custom field for a standard or custom object, one needs to take into account that the custom fields are nested under the customFields resource and follow the same CCOM structure as presented in the documentation below:
Connect Common Object Model Overview
With the Rest API, the customFields sub-resource will contain the following:
- A c sub-resource containing all legacy custom fields
- Zero or more sub-resources representing packages under which custom attributes (also known as system attributes) have been defined
When setting the value of a menu type custom field, we can make use of the LookupName for the specific value that needs to be set, as in the code samples below:
==============================
{
"name": {
"first": "Jonathan",
"last": "Randall"
},
"address":{
"city": "Oracle",
"street":"test"
},
"customFields":{
"c":{
"custom_field":{"lookupName": "Oracle"}
}
}
}
==============================
For any other information on how to use the Rest API functionality available with Oracle B2C Service, see the link below: