Creating or updating Office 365 Groups can become a guessing game if you get the InvalidLength error code 😮 First of all, it is really nice that Microsoft has started providing those details in the error response. I believe, they will improve the details information over the time, so it will be easier to understand the reason for bad requests. Anyway, the InvalidLength error message doesn't indicate the supported length for the Office 365 group properties. It results in trial and error sessions in order to figure out what the supported length limit is.
These are the error messages that you get, when trying to create a group which contains properties with invalid length:
• Invalid value specified for property 'description' of resource 'Group'.
• Invalid value specified for property 'displayName' of resource 'Group'.
• Invalid value specified for property 'mailNickname' of resource 'Group'.
After doing some research, I listed below the supported length for those properties:
• description: 1024 characters
• displayName: 256 characters
• mailNickname: 64 characters
That's it for today! I hope this blog post helps you to bypass those kind of exceptions!