@pranathi, sorry, it does seem like there is some wonky issue with this endpoint! It may be a bug. I’ll report it to the devs right away.
In the meantime, there might be a workaround if your project doesn’t currently have multiple locales (or you don’t mind publishing all of them). Despite what the documentation says, could you please try this:
(Just leave out the body param altogether, despite what the docs say).
That should let the request go through (tested with cma-client-node @ 3.0.6). I’ll follow up with the devs and let you know ASAP if we can fix the underlying bug. Sorry about that!
I’ve reported the issue to the devs, and will post back here once we have a resolution. In the meantime, just wanted to add a bit more nuance to the workaround:
If you want to publish the record as a whole (all locales), just leave out the body{} parameter altogether (i.e., don’t include either content_in_locales or non_localized_content)
If you want to publish only a specific locale, you MUST include BOTH:
content_in_locales with a valid array of locales, like ['en', 'it'] (no empty strings or nulls)
non_localized_content MUST be explicitly set (to either true or false, depending on what you want)
If you provide content_in_locales WITHOUT non_localized_content, it will be ignored and ALL locales will be published. This is probably a bug.
Again, this is just an observation of how the workaround functions right now – not how the endpoint is probably intended to function. I’ll post back once we have more information.