Skip Navigation
Expand
Contact login cannot be the empty string in CCOM version 1.4
Answer ID 12695   |   Last Review Date 09/12/2023

How do I fix the following error? "A problem setting a property was encountered: Minimum length not met: value 0 < 1 minimum length; Contact.Login"

Environment:
  • Any Oracle B2C Service version
  • Connect Common Object Model (CCOM) version 1.4
  • Connect for PHP (CPHP) API version 1.4
  • Connect Web Services for SOAP (CWS) API version 1.4
  • REST API for Oracle B2C Service version 1.4
Issue:
 
We are migrating to CCOM version 1.4 and updating a customization that creates or updates contacts. We get this error message in a ConnectAPIError exception in PHP, or a 400 response from the REST API, etc.
 
"A problem setting a property was encountered: Minimum length not met: value 0 < 1 minimum length; Contact.Login"
 
Resolution:
 
Unlike prior versions, CCOM version 1.4 will not accept an empty string for the contact login when you create or update the record. If you do not wish for the contact to have a login, either do not include it in the request at all, or set it to null. When updating a contact to remove an existing login, you must send a null value rather than omitting the property.
 
Notes:
 
In PHP, you could try something like this as a starting point:
 
$myContact->Login = $login ?: null;