422 INVALID_TYPE (details: {})

Hi

I am getting the below error while trying to create the record using javascript client library method “client.items.create”

422 INVALID_TYPE (details: {})

I debugged the code and checked the request body. It contains the below value, and it looks fine as well.

{“data”:{“type”:“item”,“attributes”:{“title”:“Leave management System”},“relationships”:{“item_type”:{“data”:{“type”:“item_type”,“id”:“video_presentation”}}}}}

Please help to resolve this issue.

I figured out the issue. I was using the wrong module ID. Refer the below picture, It has two module ID, I have to use the module ID which is numeric(green tick in the picture)

thank you for the follow up! Yes, only in a few places we allow using the textual model representation. We’ll progressively expand that around, but if possible use the numeric model id, that works everywhere!